I want to create a custom menu like Google play book. in fact I want when I click on a menu item in action bar show a custom layout that show somethings different from sub menu. I may put some object like seek bars or switches.
this is what I want:
http://www.andriman.com/media/other/Screenshot_2014-01-20-17-31-16.png
how can I do like that?
Related
I am developing my first android app. I would like to add a dropdown menu to action bar. I used the second option described in this question, but I am not able to set the onItemSelectedListner. I am using the tab navigation, so I can't set the navigation to listview. How can I get this to work?
I'm trying to make a feature where there's a button on the bottom action bar, and once I click on it, a progress bar appears on top of the button and makes the button slightly transparent (not disappear).
I used a custom layout for the top action bar, so on the bottom action bar, I wrote it through menu.xml since I've hard I couldn't have a second custom layout. I was wondering if this feature was possible just from the menu item properties.
Is it possible to make some form of like a frame-layout just from the menu.xml?
I'm assuming you're using a split action bar (uiOptions="splitActionBarWhenNarrow"), so that the custom layout you use is on the top with the application icon? The bottom bar is the menu items contained in an XML?
If this is the case, you can specify a custom layout for a menu item by using the layout attribute on the item. You could make a layout which has both items on top of each other (initially the button is VISIBLE with no alpha and the progress is GONE), then set up a click handler on the item in the onPrepareOptionMenu to set the alpha on the button to make it semi-transparent and change the visibility of the progress bar to VISIBLE.
I believe in the case where you use a custom layout, you can't use the id of the menu item for click handling (onMenuItemClicked), so you'd have to register a click listener either programatically or through the XML onClick attribute.
I apologize if any of the API calls are not 100% correct. I'm doing this mostly from memory.
I would like to create an simple menu type Action Bar along the top. I like using buttons, but need the color or image to change and hold when on selected link. Or else, could a radio button be used as an alternative to Action Bar? I would like it to look like the menu tabs on this screenshot link: view link hereThank you!
I'm looking for a way to implement a drop down on a contextual action bar, that shows the number of items selected, then has a drop down for either Select all or Deselect all. The standard Gallery app has this.
Is the only way to do it, to create a custom view to replace the title, or is there a simpler way? If you need to call
setCustomView
and replace the title, what's the best way of doing this. Would a Popup Menu be suitable. I want it to follow the same style as the contextual action bar for things like touch feedback, colours and the small arrow indicating their are more options.
Thanks.
Does anyone know how to add "menu" text under the dots menu icons in action bar?
Also, how can I make my option menu items to display the icon in Android 4.0?
You can't add text under the default menu icon in the 4.0 Action bar, you do however have two alternatives
1) You can create your own icon that includes the text 'Menu' (Unfavourable)
2) Create a custom menu item with the dots image and the properties so that the text appears next to it.
android:showAsAction="always|withText"
Take a look at The Android SDK Documentation on Action Bar to see how to create custom items and make them perform tasks.