14

I recently updated my Android Support Library Yesterday to version 23.2.0

and all of a sudden all pre Lolipop devices changed the colors of the back arrow, hamburger and (three dots menu) to black. When they where always white.

Lollipop devices seem to be fine.

here is my style.xml which was not edited at all between updates.

<?xml version="1.0" encoding="utf-8"?>
<resources>    
    <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/primaryColor</item>
        <item name="colorPrimaryDark">@color/primaryColorDark</item>
        <item name="colorAccent">@color/accentColor</item>
    </style>

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppTheme.Base">
    </style> 

    <!-- Theme to customise the tool bar -->
    <style name="MyCustomToolBarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
    <item name="textColorPrimary">@color/textColorWhite</item>
    <!-- Added this now to test, still nothing --!> 
    <item name="colorControlNormal">@color/textColorWhite</item>

    </style>

    <style name="MyApp.MyCustomToolBarStyle" parent="@style/Widget.AppCompat.Light.ActionBar">
        <!--to add-->
    </style>
</resources>

and then here is my toolbar layout

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="@dimen/toolbar_height"
    android:background="@color/primaryColor"
    app:theme="@style/MyCustomToolBarTheme"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Dark">
</android.support.v7.widget.Toolbar>
Zapnologica
  • 22,170
  • 44
  • 158
  • 253
  • http://stackoverflow.com/questions/30775024/android-material-design-navigation-drawer-menu-icon-chage – Nouman Ghaffar Mar 01 '16 at 11:34
  • For your Toolbar xml, can you try android:theme="@style/ThemeOverlay.AppCompat.Dark" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" (instead of your custom theme) – Kevin Lee Mar 01 '16 at 11:37
  • It seems working fine for my case. can you please show us the java code as well? – Bhavesh Patadiya Mar 01 '16 at 11:48
  • Possible duplicate of [Back Arrow and Overflow Icons Wrong Color in Pre-Lollipop Devices After Updating to Support Library 23.2.0](http://stackoverflow.com/questions/35653131/back-arrow-and-overflow-icons-wrong-color-in-pre-lollipop-devices-after-updating) – guipivoto Mar 01 '16 at 12:28
  • Another side note, I noticed. I make use of the google places intent. And since updating its text is gone white and in my instance the background is a light colour. So you cant see the text in its action bar. – Zapnologica Mar 09 '16 at 07:50

3 Answers3

9

This is an AppCompat bug. To fix this, update the gradle to use vector drawables:

// Gradle Plugin 2.0+  
android {  
    defaultConfig {  
         vectorDrawables.useSupportLibrary = true  
    }  
}

Earlier gradle:

// Gradle Plugin 1.5  
android {  
  defaultConfig {  
    generatedDensities = []  
 }  

 // This is handled for you by the 2.0+ Gradle Plugin  
 aaptOptions {  
   additionalParameters "--no-version-vectors"  
 }  
}  

Edit: You no longer need to set the flags according to Android blog. This has been fixed in 23.2.1.

For AppCompat users, the flags for enabling support vector drawables described in the 23.2 blog post are no longer required for usage of AppCompat. However, you can still take advantage of the app:srcCompat attribute if you wish to use support vector drawables for your own resources.

Solution now: Update your support library to use 23.2.1 or above as follows:

dependencies {
    compile 'com.android.support:appcompat-v7:23.2.1'
}
Yogesh Umesh Vaity
  • 41,009
  • 21
  • 145
  • 105
5

I had the same issue, now it seems this bug has been fixed with support library 23.2.1+. So you can just update Android Support Library and change your appcompat revision number in build.gradle

dependencies {
    compile 'com.android.support:appcompat-v7:23.2.1'
}
ghstefano
  • 171
  • 2
  • 9
0

I think you are using parent="ThemeOverlay.AppCompat.Dark.ActionBar" in style name="MyCustomToolBarTheme", change this to Light theme might worked...

Because you are using this style to your Toolbar app:theme="@style/MyCustomToolBarTheme"

Try to modify it and then check...