1

I have defined

<item name="android:statusBarColor">@color/some_color</item>
<item name="android:navigationBarColor">@color/some_color2</item>

and it works well in emulator with API 22 but in my Huawei with the same Android version status bar and navigation bar color not works. It remains the same like before.

I can add that another attributes like android:textApperance or android:background works fine there is a problem just with those two.

2 Answers2

0

Place this is your values/styles.xml

<style name="MyMaterialTheme" parent="Theme.AppCompat.Light">
    <!-- colorPrimary is used for the default action bar background -->
    <item name="colorPrimary">@color/my_awesome_color</item>

    <!-- colorPrimaryDark is used for the status bar -->
    <item name="colorPrimaryDark">@color/my_awesome_darker_color</item>

    <!-- colorAccent is used as the default value for colorControlActivated
         which is used to tint widgets -->
    <item name="colorAccent">@color/accent</item>

    <!-- You can also set colorControlNormal, colorControlActivated
         colorControlHighlight & colorSwitchThumbNormal. -->
</style>

and set this theme to your Activity in manifist like this

 <activity
            android:name=".MainHomeFragmentActivity"
            android:theme="@style/MyMaterialTheme" />
sivaBE35
  • 1,876
  • 18
  • 23
  • Not work. I dont know why but suppose 'colorPrimaryDark' is like under the higher some kind of layer the same with "android:navigationBarColor" –  Nov 08 '16 at 15:22
0

Huawei has not implemented in EMUI 3.1 based on Lollipop 5.1.1 which have colors of status bar. So there are 2 ways to solve it.

1-) The files you need:

[emui3.1.png https://drive.google.com/file/d/0BwQ4XeikVQ3kU2ZNVW53UFQ4WDQ/view?usp=sharing]

[emui3.1bg.png https://drive.google.com/file/d/0BwQ4XeikVQ3kVnh5UTBrS3F4aW8/view?usp=sharing]

This is an EMUI theme from EMUI offical BBS(this theme works well but without Translucent Status Bars): https://drive.google.com/file/d/0BwQ4XeikVQ3kRmdSZ19LblpiQ00/view?usp=sharing

HUAWEI LAUNCHER

  1. Download any Huawei theme and get .hwt file.
  2. Use any unzip sofaware and unzip it.
  3. Put emui3.1bg.png into it(I think you will now how to do it.), then zip again, make sure it likes before(Well, added a photo...), change its name to XXX.hwt
  4. Put the new .hwt into (NOT SDCARD1) /sdcard/HWThemes(if there is not it, you must create one)
  5. Open THEMES APP on your EMUI phone and change to the theme you changed before.
  6. Open emui3.1.png with system library, and set it to the launcher wallpaper.
  7. It maybe works, if not, do 1-6 again.

Here is a tutorial: https://www.youtube.com/watch?v=HTweBQgjXr8

2-) You need to root your device. You can check here to root : https://www.kingoapp.com/root-huawei.htm

then [https://drive.google.com/file/d/0BwQ4XeikVQ3kZGJDMWpuSGF0bDA/view?usp=sharing] just flash this zip

Mert
  • 83
  • 1
  • 7