How to change the Overflow icon to white in Action bar? - android

Hello can any one help me in this how to change the overflow icon to white colour I have tried a lot but it is not coming here is my code can any one help me. Help will be appreciated. Here is the code I think so their is only a minor mistake I'am unable find the mistake please help me.
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="MyTheme" parent="#android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="android:textAppearance">#style/MyTheme.ActionBar.Text</item>
</style>
<style name="MyActionBar" parent="#android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:background">#336699</item>
<item name="android:actionOverflowButtonStyle">#style/MyTheme.ActionBar.OverFlow</item>
</style>
<style name="MyTheme.ActionBar.OverFlow" parent="#android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">#drawable/menu</item>
</style>
<style name="MyTheme.ActionBar.Text" parent="#android:style/TextAppearance">
<item name="android:textColor">#ffffff</item>
<item name="android:textSize">25dp</item>
</style>
<style name="myTheme" parent="#android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/myTheme.ActionBar</item>
<item name="android:actionMenuTextColor">#ffffff</item>
</style>
<style name="myTheme.ActionBar" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#336699</item>
<item name="android:actionOverflowButtonStyle">#style/myTheme.ActionBar.OverFlow</item>
<item name="android:titleTextStyle">#style/myTheme.ActionBar.Text</item>
</style>
<style name="myTheme.ActionBar.OverFlow" parent="#android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">#drawable/menu</item>
</style>
<style name="myTheme.ActionBar.Text" parent="#android:style/TextAppearance">
<item name="android:textSize">23dip</item>
<item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:textColor">#ffffff</item>
</style>
</resources>

Make your theme dark:
<style name="MyTheme" parent="#android:style/Theme.Holo.Dark">
or you can change the actionbar theme instead:
<style name="MyTheme" parent="#android:style/Theme.Holo.Light.DarkActionBar">

Related

How to change Action Mode's color and text

I want to Change Action mode background and title color in it . i tried this But nothing has changed
Here is my styles.xml file
<style name="AppBaseTheme" parent="android:Theme.Light"></style>
<style name="AppTheme" parent="AppBaseTheme"></style>
<style name="LiveoActionBarTheme" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarStyle">#style/LiveoActionBar</item>
</style>
<style name="LiveoActionBar" parent="#style/Widget.AppCompat.ActionBar">
<item name="titleTextStyle">#style/Liveo.TitleTextStyle</item>
<item name="subtitleTextStyle">#style/Liveo.SubTitleTextStyle</item>
<item name="background">#color/green_google_play</item>
</style>
<style name="Liveo.TitleTextStyle" parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#color/white</item>
<item name="android:textStyle">normal</item>
</style>
<style name="Liveo.SubTitleTextStyle" parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle">
<item name="android:textColor">#color/white</item>
<item name="android:textStyle">normal</item>
</style>
<style name="menu_labels_style">
<item name="android:background">#drawable/fab_label_background</item>
<item name="android:textColor">#color/white</item>
</style>
</resources>
Update your code as follows and try ,
<style name="LiveoActionBarTheme" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/LiveoActionBar</item>
</style>
<style name="LiveoActionBar" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:titleTextStyle">#style/Liveo.TitleTextStyle</item>
<item name="android:subtitleTextStyle">#style/Liveo.SubTitleTextStyle</item>
<item name="android:background">#color/green_google_play</item>
</style>

Android. ActionBar. How to change ActionBar title color?

I am trying to change ActionBar title color. I tried different ways to do it. But I could not solve this problem. I have created my own actionbar theme in values/styles.xml and values-14/styles.xml
values/styles.xml
<style name="CustomActionBarTheme" parent="#style/Theme.AppCompat.Light">
<item name="actionBarStyle">#style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="#style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">#color/grey_actionbar_background</item>
<item name="icon">#drawable/ic_launcher</item>
<item name="actionBarTabTextStyle">#style/MyActionBarTabText</item>
</style>
<style name="MyActionBarTabText" parent="#style/Widget.AppCompat.Light.ActionBar.TabText">
<item name="android:textColor">#color/grey_text</item>
</style>
values-v14/styles.xml
<style name="CustomActionBarTheme" parent="#style/Theme.AppCompat.Light">
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="actionBarStyle">#style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="#style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:background">#color/grey_actionbar_background</item>
<item name="background">#color/grey_actionbar_background</item>
<item name="android:icon">#drawable/ic_launcher</item>
<item name="icon">#drawable/ic_launcher</item>
<item name="actionBarTabTextStyle">#style/MyActionBarTabText</item>
<item name="android:actionBarTabTextStyle">#style/MyActionBarTabText</item>
</style>
<style name="MyActionBarTabText" parent="#style/Widget.AppCompat.Light.ActionBar.TabText">
<item name="android:textColor">#color/grey_text</item>
</style>
grey_text color is #58585A. But when I am running on 4.3 device, ActionBar title color is F3F3F3.
I am wondering why this is happening. How to solve this problem?
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/ActionBar</item>
...
</style>
<style name="ActionBar" parent="#android:style/Widget.ActionBar">
<item name="android:titleTextStyle">#style/ActionBar.Title</item>
<item name="android:subtitleTextStyle">#style/ActionBar.Subtitle</item>
...
</style>
<style name="ActionBar.Title">
<item name="android:textColor">#color/my_color</item>
</style>
<style name="ActionBar.Subtitle">
<item name="android:textColor">#color/my_color</item>
</style>
just try method of Activity class "setTitleColor(int color)"

Android: action overflow icon blue underline

I'm trying to remove the blue underline in the action bar overflow icon. Here is the screenshot:
I don't have tabs but I saw some similar answered questions about action bar tabs underline but nothing worked for me. My Base application theme is Theme.AppCompat.Light. Here are the applied styles:
<style name="AppThemeNoActionBar" parent="Theme.AppCompat.Light">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:activatedBackgroundIndicator">#drawable/nav_drawer_selection</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:windowActionBar">true</item>
<item name="android:windowNoTitle">false</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="android:actionMenuTextColor">#color/white</item>
<item name="android:actionOverflowButtonStyle">#style/OverFlow</item>
<item name="actionBarStyle">#style/MyActionBar</item>
<item name="actionMenuTextColor">#color/white</item>
<item name="actionOverflowButtonStyle">#style/OverFlow</item>
<item name="android:activatedBackgroundIndicator">#drawable/nav_drawer_selection</item>
</style>
<style name="MyActionBar"
parent="#style/Widget.AppCompat.ActionBar">
<item name="android:titleTextStyle">#style/MyActionBarTitleText</item>
<item name="android:background">#color/red</item>
<item name="titleTextStyle">#style/MyActionBarTitleText</item>
</style>
<style name="MyActionBarTitleText"
parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#color/white</item>
</style>
<style name="OverFlow"
parent="#style/Widget.AppCompat.ActionBar">
<item name="android:src">#drawable/ic_launcher</item>
</style>
Thanks for all the help! If you need more info about the app and code let me know :)
#nejc.m i think it's due to inheritance from the "Widget" parent. Try replacing "Widget.AppCompat.ActionBar" with "Theme.AppCompat.Light.DarkActionBar". Let me know if this works.
I played around and I found out that it's a very easy solution. I added <item name="android:background">#color/red</item> to <style name="OverFlow" parent="#style/Widget.AppCompat.ActionBar">

Android app label color

I don't want to create any custom layout for app label, just want to change it's color to white (now it's black). How could I do that?
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="MyTheme" parent="#android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="#android:style/Widget.Holo.ActionBar">
<item name="android:background">#drawable/bg_blue_solid_onclick</item>
//////CHANGE label color
</style>
</resources>
styles.xml
<style name="MyTheme" parent="#android:style/Theme.Holo">
<item name="android:actionBarStyle">#style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#FF9D21</item>
<item name="android:titleTextStyle">#style/MyActionBarTitleText</item>
</style>
<style name="MyActionBarTitleText"
parent="#android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#color/red</item>
</style>
colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red">#FF0000</color>
</resources>
For more info
https://developer.android.com/training/basics/actionbar/styling.html#CustomText
Snap
Edit : For making it bold
<style name="MyActionBarTitleText"
parent="#android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#color/red</item>
<item name="android:textStyle">bold</item>
</style>
None of the previous answers worked for me, so I'm showing the one that worked in my case.
<style name="AppThemeCustom" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/primary</item>
<item name="colorPrimaryDark">#android:color/black</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="actionBarStyle">#style/MyActionBar</item>
<item name="android:windowBackground">#android:color/white</item>
</style>
<style name="MyActionBar" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:titleTextStyle">#style/MyTitleTextStyle</item>
<!-- Support library compatibility -->
<item name="titleTextStyle">#style/MyTitleTextStyle</item>
</style>
<style name="MyTitleTextStyle"
parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#android:color/black</item>
</style>
I wish if you find yourself in my situation this solution save your day. LOL
You need to style the android:titleTextStyle in your ActionBar.
<style name="MyActionBar" parent="#android:style/Widget.Holo.ActionBar">
<item name="android:titleTextStyle">#style/MyTextTitle</item>
</style>
<style name="MyTextTitle" parent="#android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#color/white</item>
</style>
You can see this in Android Documentation: Customize the Text Color in ActionBar
Hope this helps.
in styles.xml
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
in toolbar
android:theme="#style/AppTheme.AppBarOverlay"

Changing The Style Of Actionbar Overflow

I am using Theme.Holo in My Current android app.
Above is the overflow UI from my current theme.
I want to customize overflow menu's background color to RGB (245, 243, 239), and the font color to RGB (64, 64, 64).
Following is the style.xml I am using
<style name="CustomActivityTheme" parent="#android:style/Theme.Holo">
<item name="android:actionBarStyle">#style/CustomActivityTheme.ActionBar</item>
<item name="android:actionMenuTextColor">#000000</item>
<item name="android:divider">#drawable/action_bar_div</item>
<item name="android:actionOverflowButtonStyle">#style/MyActionButtonOverflow</item>
</style>
<style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">#drawable/overflow</item>
</style>
<style name="CustomActivityTheme.ActionBar" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#drawable/actionbar_bg</item>
<item name="android:titleTextStyle">#style/CustomActivityTheme.ActionBar.Text</item>
<item name="android:subtitleTextStyle">#style/CustomActivityTheme.ActionBar.Text</item>
</style>
<style name="CustomActivityTheme.ActionBar.Text" parent="#android:style/TextAppearance">
<item name="android:textColor">#000000</item>
<item name="android:textSize">16sp</item>
</style>
<style name="activated" parent="android:Theme.Holo">
<item name="android:background">?android:attr/activatedBackgroundIndicator</item>
</style>
<!-- style for removing the floating dialog -->
<style name="CustomDialogTheme">
<item name="android:windowIsFloating">false</item>
<item name="android:windowNoTitle">true</item>
</style>
<!-- style for transparent image resource activity -->
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowAnimationStyle">#style/MyAnimation.Window</item>
</style>
<!-- Animations for a non-full-screen window or activity. -->
<style name="MyAnimation.Window" parent="#android:style/Animation.Dialog">
<item name="android:windowEnterAnimation">#anim/grow_from_middle</item>
<item name="android:windowExitAnimation">#anim/shrink_to_middle</item>
</style>
<!-- style for transparent audio and video resource activity -->
<style name="Theme.Transparent_Player" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowAnimationStyle">#style/MyPlayerAnimation.Window</item>
</style>
<!-- Animations for a non-full-screen window or activity. -->
<style name="MyPlayerAnimation.Window" parent="#android:style/Animation.Dialog">
<item name="android:windowEnterAnimation">#anim/grow_from_action_bar</item>
<item name="android:windowExitAnimation">#anim/shrink_to_action_bar</item>
</style>
How can I customize theme to match overflow menu's background color to RGB (245, 243, 239), and the font color to RGB (64, 64, 64) in above code?
Thanks in advance..
to change text color you can use :
<item name="android:textAppearanceLargePopupMenu" >#style/m_textAppearanceLargePopupMenu</item>
<item name="android:textAppearanceSmallPopupMenu" >#style/m_textAppearanceSmallPopupMenu</item>
<style name="m_textAppearanceLargePopupMenu" parent="#android:style/TextAppearance.Holo.Widget.PopupMenu.Large">
<item name="android:textColor">#FFF</item>
</style>
<style name="m_textAppearanceSmallPopupMenu" parent="#android:style/TextAppearance.Holo.Widget.PopupMenu.Small">
<item name="android:textColor">#FFF</item>
</style>
this will change the popup menu text color to white
Try this:
<style name="CustomActivityTheme" parent="#android:style/Theme.Holo">
...
<item name="android:popupMenuStyle">#style/MyPopupMenu</item>
...
</style>
<style name="MyPopupMenu" parent="android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:background">#f5fdef</item>
</style>
I found it at this post
<style name="MyActionBar3" parent="#style/Widget.AppCompat.Light.ActionBar">
<item name="android:background">#color/ActionBarBackground</item>
</style>
<style name="MyActionBarDropDownStyle" parent="">
<item name="android:background">#00FF00</item>
<item name="android:divider">#ff0000</item>
<item name="android:dividerHeight">1dp</item>
<item name="android:textColor">#FFFFFF</item>
<item name="android:textSize">10sp</item>
</style>
<style name="MyTextStyle" parent="#style/Widget.AppCompat.Light.Base.ListPopupWindow">
<item name="android:popupBackground">#FF0000</item>
</style>
Apply the style to android:textAppearanceLargePopupMenu" item's attribute

Categories

Resources