Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 234
mandev Avatar asked Sep 12 '15 11:09

mandev


People also ask

How do you change the color of your toolbar on android?

Just go to res/values/styles.edit the xml file to change the color of action bar.

What is Androidx Appcompat widget toolbar?

androidx.appcompat.widget.Toolbar. A standard toolbar for use within application content. A Toolbar is a generalization of action bars for use within application layouts.


1 Answers

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.

like image 114
ʍѳђઽ૯ท Avatar answered Nov 15 '22 05:11

ʍѳђઽ૯ท