1

How do I configure My App to use Material Theme. I don't wanna use Android Studio because its too slow and freezes a lot. I have read the instructions from answer to similar question. I followed the steps but I didn't get values-21 folder as mentioned in the answer. What can I do now?

suraj bora
  • 61
  • 1
  • 11

2 Answers2

0

There is no difference at project folders structure in this case in Eclipse and AS, maybe you just can't get right preview at Eclipse.

Kirill Zotov
  • 561
  • 3
  • 7
  • 18
  • May be. But whenever I used android:style/Theme.Material... it gave me errors. When I tried @Colin method , it didn't produce error but the app crashed. – suraj bora Sep 08 '15 at 16:41
  • Check out your imported libraries at gradle Android Studio and just make the same at Eclipse but manually. – Kirill Zotov Sep 10 '15 at 11:35
-1

I'm assuming that you currently have a folder res/values that has a file styles.xml which contains your apps theme. Manually create a folder res/values-v21 and copy your styles.xml into it. Modify the new file now so that it uses the material theme as its parent.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent="@android:style/Theme.Material">
        <!-- Customize your theme here. -->
    </style>
</resources>

Now when your app is run on a device/emulator running API 21+ it will use the Material theme.

Breavyn
  • 2,232
  • 16
  • 29