Change color of options in overflow button? - android

I have been having an issue where my overflow settings button appears black and makes the text difficult to read. I instead want the settings button to appear like this as that is how it shows up in my menu.xml
I have tried searching for a solution but most of them are how to change the color of the three dots and not of the actual options. Any help solving the issue would be appreciated.

Did you try using a light theme? like Theme.AppCompat.Light.NoActionBar

Related

Copy-Paste options in ActionBar appear totally white

Maybe this is not quite an ActionBar problem but the problem is as follows;
I have an EditText and when you long click on the EditText, text selection options appear on ActionBar's position by default. My problem is that, both the texts and background are white, so they cannot be read. Here is the screenshot:
I tried some possible causes of the problem but nothing helped. For example, I tried to change the theme
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
However, any theme with the AppCompat results totally white.
Also I changed the project theme in Android Studio's interface as follows:
However it's still white.
The copy-paste options are there and you can click on them, but how can I make them appear? Another solution on SA suggested manually replacing gray icons. But I believe this is not the usual case in Android and there should be another way. Any ideas?

Android toolbar icons style

I'm working on an app which has two activites. The second activity has a back button which provide back navigation.
The problem I have is that the back navigation button takes the background from the toolbar no matter if the toolbar has the "style=" attribute or the "app:theme=".
Here is the toolbar with the "style=" attribute:
http://postimg.org/image/f57zaap4p/
http://postimg.org/image/3u5blxi9l/
An here is the toolbar with the "app:theme=" attribute:
htt.p://postimg.org/image/kkqxgo8d1/
htt.p://postimg.org/image/ofpq5i251/
(Please remove the point from "htt.p" from the last two links - I can't post more than two links)
I want the icons to have a white background. I would appreciate if you can help!
You can style the action overflow button in your styles.xml adding this line:
<item name="android:actionBarItemBackground">...</item>
You can set it as a #drawable or a #color resource. I suggest you to define a selector to manage, e.g, the background color as the icon is pressed.
As for the back arrow, this is, to me, quite an open question. You could take a look at my own question here , where you can also find a selector sample.
Basically you can override the arrow/burger background with
<item name="android:selectableItemBackground">...</item>
but (I fear) it acts as a background for a lot of widgets you might have. In facts, this also overrides actionBarItemBackground, so if you want to use both, the latter is enough.

Android Sub Menu Changes Background Color

I have an android application that I want to add a sub menu for. The background of the application is the default which is black. All of the text on the app is white which I also think is the default. So I added in the sub menu but when I click on the sub menu the background turns to white but the text doesn't turn to black.
Any idea why the default sub menu behavior isn't working correctly? I'm hoping not to have to create styles and all that and the solution will be fairly simple.
Figured this out. This was due to me using titleCondensed instead of just using title. For some reason on sub menus it needs to use title but on the regular menu it works fine. Programming mistake by me.

Change Android ActionBar overflow icon in code

Is it possible to change overflow icon in code?
I read this solution: Changing overflow icon in the action bar
But I need to make it in code, to select white or grey style during runtime.
Is it possible?
You can only change this in a theme.
One potential solution would be to call setTheme as the very first thing in onCreate with different themes depending on whether you needed white or gray.

Android menu item background

I want to change the menu item background beacuse I use black icons, but on some phones the default color of background is black or other dark color. I tried this solution and it's worked but there was a little problen with it:
I have ten items and that's why I have a "More" item to show other options, but if I choose the More item (which is got the custom background) and after that I press back button, the item will be in the default state, default colors. What is the solution? Thanks!
The style attribute for the menu background is android:panelFullBackground. It's not hackish like the other solution, so it's not as buggy.
Despite what the documentation says, it needs to be a resource (e.g. #android:color/black or #drawable/my_drawable), it will crash if you use a color value directly.
try to use android own menu icon like as setIcon(android.R.drawable.ic_menu_search)

Categories

Resources