I want to use Material Theme in my application which has minimum sdk version of 8. As per docs - "The material theme is only available in Android 5.0 (API level 21) and above. The v7 Support Libraries provide themes with material design styles for some widgets and support for customizing the color palette." Does it mean I can use it if I add v7 Support Libarary in my project? Because after adding this library I got the following error:
android:Theme.Material.Light requires API level 21 (current min is 8).
Or maybe I understood something wrong? Any suggestion will be appreciated. Thanks in advance.
For this you need to have 2 values folder.
One that exist by default, and another, u have to create in your res folder and name it values-v21.
In the default values folder, in styles.xml, use theme other than Material theme And in the styles.xml of values-v21 folder that you created, use Material theme.
Android phone will automatically pickup the styles.xml which it support. If the phone supports Material Design (Lollipop devices), your app will use material theme (values-21 folder).
if it doesnt (in phones running older android versions), the default values folder will be used.