I was studying a little bit about the Android layout guidelines like:
So I tried to customize my theme , like this:
<resources>
<!-- inherit from the material theme -->
<style name="AppTheme" parent="android:Theme.Material">
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="android:colorPrimary">@color/primary</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/accent</item>
</style>
</resources>
But the attributes, android:colorPrimary
, android:colorPrimaryDark
and android:colorAccent
, are only available for recent versions of Android (API 21+), which is not currently my target .
Then I took another path, customizing the components manually. So I tried to set StatusBar color, using the setStatusBarColor(int color)
method, but this is also not available for versions prior to API 21.
Questions:
Important notes
- My
minTarget
is API 14.