Search code examples
androidmaterial-designandroid-5.0-lollipopandroid-toolbar

How to change android title color with Coordinator layout and custom toolbar


I'm trying to change this toolbar color Completly White like Android Lollipop Settings action bar color but, there is a bug or something like that in our view or perhaps an Android bug!!

My toolbar:

<android.support.v7.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:layout_collapseMode="pin"
                    app:popupTheme="@style/Theme.AppCompat.Light"
                    app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

Style:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
     <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>

and style Arrow:

<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
    <item name="spinBars">true</item>
    <item name="color">@android:color/white</item>
</style>

Result:

As you can see, the name is black! and after add these also, the search icon is a little bit black. (You can try it ;) )

But i need Completely White color with white actions.

How can achieve this?

I've tried everything you can expect!


Solution

  • You can try this :

    taken from : https://github.com/sagar-viradiya/android-design-support-lib-demo/blob/master/app/src/main/res/layout/fragment_collapsing_toolbar.xml

    Just add this in the AppBarLayout: app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"

    e.x:

    <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar_layout"
            android:layout_width="match_parent"
            android:layout_height="256dp"
            app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
    

    For PopUptheme:

    <android.support.v7.widget.Toolbar
                        android:id="@+id/Main_toolbar"
                        android:layout_width="match_parent"
                        android:layout_height="?attr/actionBarSize"
                        app:layout_collapseMode="pin"
                        app:popupTheme="@style/Theme.AppCompat.Light" />
    

    But i have no idea about that search action and why that is still a little bit black.

    If some one knows, please guide us.