From the course: Android Development Essential Training: The User Interface with Kotlin

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Define visual styles and themes

Define visual styles and themes - Android Tutorial

From the course: Android Development Essential Training: The User Interface with Kotlin

Start my 1-month free trial

Define visual styles and themes

- When you customize your Android app with a certain appearance, you can either set Visual Attributes one view object at a time, or if want to be more efficient, you can create and apply styles. A style is a collection of visual attributes, and a theme is a collection of styles. To demonstrate this, I'm going to change some settings on the first button in my application. I'll make the change in text mode. I'll go to my first button component, and I'll add an attribute called "Background Tint." And I'm going to set it to a color that's already defined in my application, called "Color Accent." This color is to find in a file called "Colors.xml" which is in the value's Resource Directory. You can define as many different colors as you like, using hexadecimal notation. Now I'm also going to set the text color. And for this, I'm going to use a color that's defined in the Android SDK. I'll start with "@android:" and I'll choose "color/white." And then I'll make my application, that'll link…

Contents