How do you eat an elephant? One bite at a time, of course! We’ve all heard it before, but if you’ve taken a moment to look at the massive specs for Android’s new material design guide you may have a new found appreciation for those tried and true words of wisdom. I’ve been itching to get my hands on the new material design features, but it’s a little tough to know where to start.

To that end, I decided to dip my toes into the shallow end of the material design pool and test the waters of styles.xml. Feel free to follow along with the brief tutorial below, or download and import the entire project directly into Android Studio.

1. Create a new project in Android Studio. Target a min SDK of API 14, and choose the “blank activity” template.

2. Under the /Gradle Scripts folder add the following line to the “dependencies” section of your build file:

compile ''

3. In the /res folder update the default layout to include a button.


4. In the /res/values/styles folder you will find styles for each of the platforms you will be supporting. Since we are using the support app-compat library, you should be able to delete all the alternate style resources, meaning the only file you should leave is styles.xml.


5. Open the MainActivity .java file in the app/java/package folder and extend ActionBarActivity.
package com.authorwjf.hellomaterials;

import android.os.Bundle;

public class MainActivity extends ActionBarActivity {

protected void onCreate(Bundle savedInstanceState) {

We are ready to run the application. Because we used the compatibility library the features should degrade gracefully, but I recommend creating a Lollipop emulator so you can see what sort of effects you get for free. In particular, I’m a big fan of the ink animation that occurs when you press the button down.

Now that you have a base project set up there are plenty of other theming attributes to play with. Check out this link for the scoop on:

  • colorPrimaryDark
  • colorAccent
  • colorControlNormal
  • colorControlActivated
  • colorControlHighlight
  • colorSwitchThumbNormal