-1

I read somewhere that we should use holo theme upto api level 14 and as from level there is mterial design and in between we should use support themes no matter v4 or v7, is it true? Also what about resource qualifier and what is design support library

Thanks

blackHawk
  • 6,047
  • 13
  • 57
  • 100

1 Answers1

0

No, best way is to create seperate values folders values, values-v14, and values-v21. Best practice for now is to use Theme.Appcompat, it's available if you use extend AppcompatActivity class

 <!-- Main Base Theme -->
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/primary</item>
    <item name="colorPrimaryDark">@color/primary_dark</item>
</style>

You can modify your styles inside each folder if you want your app to look different for android versions 14 and below, above 14 but below 21, or 21 and above.

You can change part after Theme.AppCompat however you like, NoActionBar is useful if you wish to use Toolbar from Design library of Android.

Thracian
  • 43,021
  • 16
  • 133
  • 222
  • The appcompatactivity was introduce in v7 so we should use theme.appcompat based themes, right? – blackHawk May 13 '17 at 17:36
  • Yes, you should use AppCompatActiviy for backward compatibility and you must use appcompat themes with it. If you don't, i can exactly remember but your app crashes if my memory serves right. You can check it by extending an AppcompatActivity for your activity but not setting a appcompat style – Thracian May 13 '17 at 17:39
  • What about if i use material design and mintarget is 11, what about backward compatibility – blackHawk May 13 '17 at 17:43
  • Mintarget is 7 for appcompat library. But even 14 is less than 1% of total devices now. Check [here](http://stackoverflow.com/questions/29797172/whats-the-enhancement-of-appcompatactivity-over-actionbaractivity) – Thracian May 13 '17 at 17:46
  • So we should use material design now onward ni matter what mintargetsdk is? – blackHawk May 13 '17 at 17:53
  • If you want to target android 4.0 and above keep minimum at 14, but i started to update my apps to 16. You can see which changes had been made in which version when you create a new project in Android Studio – Thracian May 13 '17 at 17:55
  • I asked if i use material design for my app having mintargetsdk 15, will material design degrade to provide same ui for versions older than 5? – blackHawk May 13 '17 at 17:59