How can I change item selector for hardkey menu? I was able to set custom item selector for actionbar menu. Unfortunately some devices with hardkey menu(like Nexus S) create different menu style. I want to replace default blue highlight selector with my custom red. I searched topics here and elsewhere without success. ICS+ compatibility is enough.
Related
I styled my action bar with Android Action Bar Style Generator, so when i press an action drop down item, the background color changes to a custom color instead of the default. Now i want to implement this behavior in the old options menu, too. I tried everything from this answer collection, unfortunately none of them worked. How can i achieve this on the options menu? Note that i'm using ActionbarSherlock and HoloEverywhere, but i think this does not matter here, because these uses the native implementation for the options menu.
I partially solved the issue.
I generated a theme for List Selector with the Android Holo Colors Generator.
I applied the theme. The option menu style also changed on API 11+, because it uses List Selector to theme the options menu dropdown list.
I still cannot properly style the options menu on API 10 and below, but at least my application theme is consistent from API 11.
I've used the action bar style generator to generate a custom action bar theme for an app, and it works well after a few tweaks. My custom theme is based on Holo (the dark version) and changes the highlight colours. My action bar overflow menu correctly shows my custom state_pressed colour on the overflow items when I press them. I've set android:colorPressedHighlight to the colour I want, and put an appropriate drawable for android:selectableItemBackground.
The problem is on one of my test devices, which has a hard menu button. (It's a Samsung Galaxy S III.) When I show the overflow menu with the hard menu button, pressing an item from this menu gives it the default blue highlight. Either it uses another attr instead of android:selectableItemBackground, or it's taking it from another style. I'd like to know what attr it's using, or what style it's taking it from, so that I can set this colour.
P.S. Before anyone suggests it, I know that you can use android:panelBackground to set the background of the bottom menu. But I don't want to change the overall menu background, only the item background.
I'm using ActionBarSherlock with a theme whos parent is Theme.Sherlock.Light.DarkActionBar (generated with http://jgilfelt.github.com/android-actionbarstylegenerator ).
the problem is that the text for dropdown navigation list items, dropdown navigation title in actionbar and options menu list items (on devices with menu key) is dark instead of white. I checked it on both 4.2 device and 2.3 emulator.
something weird is that tabs navigation that automatically changes to dropdown menu in landscape mode has the correct text color both in title and list item, but a simple dropdown navigation doesn't..
I tried overriding some colors in the actionbar style but it didn't change anything.
how do I fix this ?
btw - if I change the theme's parent to Theme.Sherlock, those colors are correct, but then the activity background is dark..
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)
while I'm able to set "highlight color" for ListView items using android:listSelector
attribute and appropriate selector, I'm unable to do the same, or something similar,
for Menu items - they just keep using default system color scheme. I've read Creating Menus article and found nothing there. Any clues?
Btw: I'm referring to Menu accessible via 'Menu' button.