Learn Android Studio by Adam Gerber & Clifton Craig
Author:Adam Gerber & Clifton Craig
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA
Here you’ve added member fields for each of the TextView and EditText components. The onCreate() method starts by finding each view component and saving them in the individual member variables. Next you find the parent of the name label and change its background color to light blue. Android Studio sports a unique feature that decorates the left-hand gutter with a square, illustrating the color referenced on this line. These squares also appear on other lines that reference color resources. You then change the text appearance of each TextView, making the name stand out with a large appearance. You are using predefined styles from within the android.R class, which includes references to all available resources from the Android SDK. Each remaining TextView is also updated to use either a medium or an inverse appearance. Finally, you disable the description EditText to prevent modification of its contents. You also set its background to white while changing the text color to black.
To try our new ProfileActivity and layout, you have to define it in AndroidManifest.xml and link it to MainActivity. Open the manifest and add a tag for our ProfileActivity under the MainActivity definition:
<activity
android:name=".ProfileActivity"
android:label="@string/app_name" />
Next return to MainActivity and override the onListItemClick() method with the following code to create a new intent around the ProfileActivity class, and start the activity. Run the example and try clicking any list item to bring up its profile. See Figure 8-26.
Figure 8-26.New layout with buttons and EditText
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(6534)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6419)
Kotlin in Action by Dmitry Jemerov(5066)
Odoo 15 Development Essentials - Fifth Edition by Daniel Reis & Greg Mader(3361)
Odoo 15 Development Essentials by Daniel Reis(2814)
React Native - Building Mobile Apps with JavaScript by Novick Vladimir(2531)
Learning Angular - Second Edition by Christoffer Noring(2360)
Pride and Prejudice by Jane Austen(2350)
Mobile Forensics Cookbook by Igor Mikhaylov(2017)
Computers For Seniors For Dummies by Nancy C. Muir(1996)
Bulletproof Android: Practical Advice for Building Secure Apps (Developer's Library) by Godfrey Nolan(1874)
Android Development with Kotlin by Marcin Moskala & Igor Wojda(1799)
Building Android UIs with Custom Views by Raimon Ràfols Montané(1791)
1936941139 (N) by Bob Rosenthal(1732)
Building Progressive Web Apps: Bringing the Power of Native to the Browser by Ater Tal(1727)
Hands-On Internet of Things with MQTT by Tim Pulver(1708)
Android App Development by Franceschi Hervé J.;(1703)
Ember.js in Action by Joachim Haagen Skeie(1689)
Hands-On Design Patterns with React Native by Mateusz Grzesiukiewicz(1656)
