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.
Related
Actually I am using
#android:style/Theme.Holo.Wallpaper.NoTitleBar
in my android launcher app. But the problem is when I am changing
navigation bar color
for lollipop and above devices, it's not changing. I tried pro-grammatically as well as from styles.xml.
If I am using appcompat theme, then it's working. But I don't wanna use appcompat theme for my launcher app. So what is the reason behind it and give me solution as well.
I want to make my app in Material Design, but one thing I noticed was that the ContextMenus are themed in Holo, as seen here: .
Is there a way to make the context menu Material Themed?
Maybe this post helps:
Styling the popup menu in Android 5.0
They try to do exactly the opposite there. Note that using the ActionBar and using the right application/activity theme should do the trick.
This however is for the ActionBar context menu. I think the longpress ListView context menu is being phased out. It might be possible to make a custom theme for it though:
Android: Theme ContextMenu item selection
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.
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.
I want to create custom options menu as below and also want this to be available on all activities.
So far I am able to add options menu using onCreateOptionsMenu method, and setting its icons.
But have no idea how it can be inflated as shown in images.
After doing some google search found out one example . If can get more help on implementing custom options menu.
Neither of those are options menus. If they happen to be triggered by pressing a MENU button, then those apps are monitoring onKeyDown() for MENU button presses. This also means that their menus will not work on devices that lack such a MENU button.
I strongly encourage you to follow the Android design guidelines. I recommend that you start integrating an action bar and using action items and the action overflow area, perhaps leveraging ActionBarSherlock to support Android 2.x devices.