8.4.4. styles.xml

In this section, you’ll define the styles for the DetailsFragment’s TextViews that display a contact’s information (Section 8.4.7). Like other resources, style resources are placed in the app’s res/values folder. When you create a project, the IDE creates a styles.xml file containing predefined styles. Each new style you create specifies a name that’s used to apply that style to GUI components and one or more items specifying property values to apply. To create the new styles:

1. In the app’s res/values folder, open the styles.xml file and ensure that the Resources tab is selected at the bottom of the editor window.

2. Click Add..., then select Style/Theme and click OK to create a new style.

3. Set the style’s Name to ContactLabelTextView ...

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.