‫Welcome back.
‫The themes.
‫That Xaml file is a resource file used to define styles and themes for your Android application.
‫Themes in Android define the look and feel of your application, including colors, fonts, and other
‫visual attributes.
‫The style element is used to define a theme.
‫The name attribute assigns a unique identifier to the theme.
‫The parent attribute specifies the parent theme from which your theme inherits.
‫Styles.
‫In this example, this style inherits from theme material three dot Daynight dot no action bar.
‫Inside the style.
‫You can use the item elements to customize specific attributes of the theme.
‫For example, I can use the item element to specify the primary color attribute as my newly defined
‫color in the Colors.xml file.
‫Here I am referencing the primary key, the primary color of this theme to the newly defined blue color.
‫If I run the program, you can see that the primary color is applied to the top bar.
‫This is the newly defined color in our application.
‫You can create your own style by starting by style element my own style.
‫And here I'll give it a parent attribute from the base dot theme dot resources app that inherits the
‫attributes from this.
‫Again, my own style.
‫My newly defined style inherits directly from this.
‫No action bar themes can inherit from each other, creating a hierarchy.
‫This allows you to reuse the styles and attributes from a parent theme, and override or add specific
‫attributes in child themes.
‫If you go to the manifest file, you can see that there is a theme attribute specified inside the application
‫element.
‫Here I'm using the theme and referencing the style.
‫By using its unique identifier.
‫I can use my own style that I created here as the theme for my application.
‫You can override the elements in the parent theme.
‫For example, if I want to change a primary color attribute from the parent and inherited from the parent,
‫no action bar or this style I can change it to.
‫For example, red.
‫Run the program and you can see I override the inherited attribute, which is the primary color in this
‫own style element.
‫This is how we use styles and themes in Android Studio.