Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toolbar NavigationIcon loose theme

I use two themes for my app depending of the actionBar color I want (dark or light color) : - Theme.AppCompat.Light.NoActionBar - Theme.AppCompat.NoActionBar

Here's my toolbar layout :

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:minHeight="?attr/actionBarSize"
    app:theme="@style/ThemeOverlay.AppCompat.ActionBar"
    >

    <TextView
        android:id="@+id/toolbar_title"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:maxLines="1"
        android:ellipsize="end"
        android:textAppearance="?android:attr/textAppearanceLarge"
        />

</android.support.v7.widget.Toolbar>

In my manifest, I set the Application theme to light and some activities have the attribute theme set as dark.

I see a weird behaviour with my toolbar. Let's say I'm in an activity with white toolbar (the activity use the light theme) and i navigate to an activity with Red toolbar (that has the dark theme). When I come back to the activity with the white toolbar, the navigation icon (the left pointing arrow) is now white. Like it has taken my dark theme.

Hope I explained the situation clearly.

Thank you!

like image 391
Mathbl Avatar asked Nov 07 '14 19:11

Mathbl


1 Answers

EDIT Fixed in Support Library v22.0.0

Finally, I found out it is a bug in appCompat. It is fixed, but still not merged/released.

https://code.google.com/p/android/issues/detail?id=78289

like image 169
Mathbl Avatar answered Nov 15 '22 02:11

Mathbl