I am having a menu item "CLEAR" in my app. I am using different typefaces in my app. I want to set a specific typeface for this menu item. Is it possible? Then how?
Related
I'm trying to do something like the mockup I drew below. I have menu items but on each I want one image view and one text view. All I'm seeing is title and icon attributes in the menu items which don't do the job.
If you want to use the standard Android widgets (Menu, MenuItem, etc), then no, this is not possible.
However, you could create your own floating view that looked just like a standard Android menu, and then do whatever you want.
I have created options menu it has some attributes like android:I'd, android : title,android:icon etc how can I set a image as android option menu and also I want title of the item below the icon not beside the icon
You cannot do this easily and you should not. What you explain sounds more like Tabs to me, which you could use instead. With these you'll get text below the icon out of the box.
I have a use case where I need to create menu items and sub menus dynamically in onPrepareOptionsMenu and set those item's and sub menu's background colors dynamically.
The background colors are determined at runtime. There isn't a pre-existing list of background colors I can put in XML (you can basically consider them to be RGB values typed into a text view in the same activity as the menu).
I only want to change the menu item's backgrounds if they are shown in popups (i.e. SHOW_AS_ACTION_NEVER or SHOW_AS_ACTION_IF_ROOM when there is not enough room), not when they are shown directly in the action bar.
I know I can use a custom view inflater to change the background as the menu item views are inflated, but that requires reflection and depends on the View subclass's name. That name might be different on different versions of Android or for different manufacturer's devices.
Is there a way to do this without depending on anything OS version- and device-specific?
Are there default icons for a menu item whose functionality is to change gridview to listview or vice versa. I know there are some icons like search, done, edit etc. I just couldn't find any for this purpose.
You can view all default icons in sdk/platforms/apiversion/android.jar
just unzip it and you can see all the icons
Depending on Muhammad's comment, there is no such icon in sdk/platforms/api version/android.jar on API 21.
Play Music uses an icon in the menu to show whether an item is saved on the device.
What's the best way to do this in my app? If the answer is to create a ListView inside a PopupWindow, then how do I style a list so that it looks just like a PopupMenu?