Styles in Android

The theme we just defined represents style. All styles are defined in the styles.xml file. We will create several styles to demonstrate how easy it is for you to create styles and how powerful they are. You can define styles for buttons, text, or any other view. You can inherit styles too.

For the purpose of styling, we will define the color palette that we will use in the application. Open your colors.xml file and extend it as follows:

 <color name="green">#11c403</color> <color name="green_dark">#0e8c05</color> <color name="white">#ffffff</color> <color name="white_transparent_40">#64ffffff</color> <color name="black">#000000</color> <color name="black_transparent_40">#64000000</color> <color name="grey_disabled">#d5d5d5</color> ...

Get Mastering Android Development with Kotlin 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.