Tutorial by Examples

In themes.xml: <style name="AppTheme" parent="Theme.AppCompat"> <!-- Theme attributes here --> </style> In AndroidManifest.xml: <application android:icon="@mipmap/ic_launcher" android:label="@string/app_name" andr...
You can customize your theme’s color palette. Using framework APIs 5.0 <style name="AppTheme" parent="Theme.Material"> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimaryDark">@color/pri...
In themes.xml: <style name="MyActivityTheme" parent="Theme.AppCompat"> <!-- Theme attributes here --> </style> In AndroidManifest.xml: <application android:icon="@mipmap/ic_launcher" android:label="@string/app_name" ...
<style name="AppTheme" parent="Theme.AppCompat"> <item name="android:colorEdgeEffect">@color/my_color</item> </style>
5.0 The ripple animation is shown when user presses clickable views. You can use the same ripple color used by your app assigning the ?android:colorControlHighlight in your views. You can customize this color by changing the android:colorControlHighlight attribute in your theme: This effect colo...
This attribute can change the background of the Status Bar icons (at the top of the screen) to white. <style name="AppTheme" parent="Theme.AppCompat"> <item name="android:windowLightStatusBar">true</item> </style>
The navigation bar (at the bottom of the screen) can be transparent. Here is the way to achieve it. <style name="AppTheme" parent="Theme.AppCompat"> <item name="android:windowTranslucentNavigation">true</item> </style> The Status Bar (t...
5.0 This attribute is used to change the navigation bar (one, that contain Back, Home Recent button). Usually it is black, however it's color can be changed. <style name="AppTheme" parent="Theme.AppCompat"> <item name="android:navigationBarColor">@col...
When defining themes, one usually uses the theme provided by the system, and then changes modifies the look to fit his own application. For example, this is how the Theme.AppCompat theme is inherited: <style name="AppTheme" parent="Theme.AppCompat"> <item name=&quo...
Using more than one theme in your Android application, you can add custom colors to every theme, to be like this: First, we have to add our themes to style.xml like this: <style name="OneTheme" parent="Theme.AppCompat.Light.DarkActionBar"> </style> <!--...

Page 1 of 1