Changing the background color of the system settings menu above the action bar

I have been trying for several hours to change the background color of the system settings menu located on top of the action bar. I was looking for stack overflow and google, but I only found answers in the action bar. See Image for further explanation. Like the Gmail app, I want to change the color to dark red. Can any postal code how to achieve this? Also what is the actual name of the blue highlighted section in the picture?

Thanks!

enter image description here

+4
source share
2 answers

This area is called the status bar. Using a material theme, you can add this line to your xml styles to change the color.

<item name="android:colorPrimaryDark">@color/primary_dark</item>

: https://developer.android.com/training/material/theme.html

,

<!-- extend one of the Theme.AppCompat themes -->
<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
    <!-- customize the color palette -->
    <item name="colorPrimary">@color/primary</item>
    <item name="colorPrimaryDark">@color/primary_dark</item>
    <item name="colorAccent">@color/accent</item>
</style>

build.gradle

dependencies {
    compile 'com.android.support:appcompat-v7:21.0.+'
}

: https://developer.android.com/training/material/compatibility.html

. Material, .

,

+4

Pre Lollipop Appcombat v7 21, :

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
}
+1

Source: https://habr.com/ru/post/1610444/


All Articles