4

I am using android studio 1.0
Trying to make material design app that is compatible with older versions of android too...
Made new blank project, Added compile 'com.android.support:appcompat-v7:21.0.3' dependency to the gradle file
Still no luck :/
Anyone please help me out....

Edric
  • 24,639
  • 13
  • 81
  • 91
Salmaan
  • 3,543
  • 8
  • 33
  • 59

3 Answers3

4

Create the values-v21 folder and create styles.xml Inside styles.xml choose Material Theme.

ch3tanz
  • 3,070
  • 3
  • 16
  • 24
  • Open your main.xml. select Graphical Layout. Look for Theme drop down menu. From there you can select Material Theme. If your sdk is updated. Theme.Material will be listed in that Theme drop down. – ch3tanz Dec 26 '14 at 10:00
  • which version of SDK should i have? – Salmaan Dec 26 '14 at 10:02
  • Its still saying "cannot resolve symbol Theme.Material.Toolbar" :/ – Salmaan Dec 26 '14 at 16:53
1

It was in older versions of Android Sudio. In Android Studio 1.0 you have to create by yourself. Check your SDK version update it to Android 5.0 (Api 21). And you will be good to go.

Maintain material design Compatibility to older version of Android by following this link. https://developer.android.com/training/material/compatibility.html

Cheers..

Ahmad Arslan
  • 4,498
  • 8
  • 38
  • 59
0

If you want to make a material design app that is compatible with older versions of Android, you really need to include the library

'com.android.support:appcompat-v7:21.+'

And make some changes to your app. This link shows a pretty good how to

http://android-developers.blogspot.com.br/2014/10/appcompat-v21-material-design-for-pre.html

The most importante change is the new Toolbar, that you can eather include in every layout you want, or work with "ActioBarActivities". Again, reading this official blog post will help you.

But, as the title of your question said, you can create a folder called "values-21" and put a new "style.xml", that will target only Android Lollipop. In this file, you can extend android:Theme.Material and use some features that are only present in Android 5.0, like ripples and some animations.

Renan Ferreira
  • 2,122
  • 3
  • 21
  • 30