How to Apply Material Design Theme to your Android Application

Here, we will discuss the important steps that will guide you to apply the material design theme in your android application:

1. Firstly create a new project In Android Studio. Select Blank Activity when it asks you to select a default activity.

2. Now this seacond is very crucial when you are adding android design support library components to your app. Just open build.gradle and add android design support library

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile ''
    compile ''

3. Next, edit colors.xml file, which you can find under res ⇒ values and add copy paste the below color values.

<?xml version="1.0" encoding="utf-8"?>
    <color name="colorPrimary">#125688</color>
    <color name="colorPrimaryDark">#125688</color>
    <color name="textColorPrimary">#FFFFFF</color>
    <color name="windowBackground">#FFFFFF</color>
    <color name="navigationBarColor">#000000</color>
    <color name="colorAccent">#c8e8ff</color>

4. Edit styles.xml file which is also found under res ⇒ values and add copy paste the below styles. I have named the material theme as MyMaterialTheme

    <style name="MyMaterialTheme" parent="MyMaterialTheme.Base">
    <style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>

5. Now, we have to create a new folder named values-v21 under res. Inside values-v21 folder, you now create another styles.xml file and copy paste the below styles code which are specific to Android 5.0.

    <style name="MyMaterialTheme" parent="MyMaterialTheme.Base">
        <item name="android:windowContentTransitions">true</item>
        <item name="android:windowAllowEnterTransitionOverlap">true</item>
        <item name="android:windowAllowReturnTransitionOverlap">true</item>
        <item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
        <item name="android:windowSharedElementExitTransition">@android:transition/move</item>

6. Now edit AndroidManifest.xml and alter the theme according to our customized theme by changing the android:theme attribute value.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
    package="info.androidhive.materialtabs" >
        android:theme="@style/MyMaterialTheme" >
            android:label="@string/app_name" >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />

7. Lastly, its time to run the app and test the material theme by checking the notification bar color. The color change in the notification bar color indicates that the material design theme is applied in the app successfully.