Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the action bar settings icon color

Tags:

java

android

How can one change the color of the overflow icon in the action bar?

enter image description here

(The most right icon)

like image 574
Ori Seri Avatar asked Apr 16 '13 11:04

Ori Seri


People also ask

How do I change the color of my icon?

Search for and select Open App, and then, on the New Shortcut page, tap Choose. Locate the app whose appearance you want to change. Back on the New Shortcut page, you'll see the app name; tap More (three dots), change the app's name, tap its icon, select Color, and choose a new color.

What are action bar icons?

The ActionBar, now known as the App Bar, is a consistent navigation element that is standard throughout modern Android applications. The ActionBar can consist of: An application icon. An "upward" navigation to logical parent.


3 Answers

You can use something like this

<style name="MyTheme" parent="android:style/Theme.Holo.Light">
     <item name="android:actionOverflowButtonStyle">@style/MyActionButtonOverflow</item>
</style>

<style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.ActionButton.Overflow">
    <item name="android:src">@drawable/my_action_bTutton_overflow</item>
</style>

in your AndroidManifest.xml

<application
    android:theme="@style/MyTheme" >

If you want to change actionBar color @style/MyActionBar

        <!-- Support library compatibility -->
        <item name="actionBarStyle">@style/MyActionBar</item>
    </style>

    <!-- ActionBar styles -->
    <style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
        <item name="android:background">@color/app_theme_color</item>

        <!-- Support library compatibility -->
        <item name="background">@color/app_theme_color</item>
        <item name="android:alwaysDrawnWithCache">true</item>
        <item name="android:displayOptions">showTitle|showHome|homeAsUp</item>
        <item name="android:icon">@android:color/transparent</item>
    </style>

Then in your AndroidManifest.xml you need to refer this one inside your application tag.

    android:theme="@style/CustomActionBarTheme"
like image 106
Alex Chengalan Avatar answered Oct 09 '22 17:10

Alex Chengalan


If you just want to change the color you can simply tint it:

  <style name="DotsDarkTheme" parent="@style/Widget.AppCompat.ActionButton.Overflow" >
    <item name="android:tint">@color/yourColor</item>
  </style>

and then use it in your style:

 <item name="actionOverflowButtonStyle">@style/DotsDarkTheme</item>
like image 37
Mike Birkhoff Avatar answered Oct 09 '22 17:10

Mike Birkhoff


if you are using action bar use :

        toolbar.getOverflowIcon().setColorFilter(Color.WHITE , PorterDuff.Mode.SRC_ATOP);
like image 45
Karem Mohamed Avatar answered Oct 09 '22 16:10

Karem Mohamed