everyone! I have question for Android guys. Any help or suggestion will be appreciated.
So my problem:
I have application with ActionBarCompat and in this action bar I have a lot of different hiden menu items, which appear only if user click on menu button at action bar. Also I have couple menu items at action bar, which always visible.
I need some customization for one of visible menu item. When user click on this menu item (let's say it would be "Add new" menu item), I need to show different menu in this case. And if user click on standart menu item, it should act like usually.
So I really confused. And I have no idea how I can do it. Maybe someone had the same problem or similar. Thank you!
Screenshot for better understanding:
Related
I need to open android support library action bar overflow menu (the one shown with three vertical dots) programatically. I know its a silly requirement but one of my client is insisting that they want the menu option to be opened and visible when user tap on a button in an activity.
Any pointer on how to do this will be highly appreciated.
Try using openOptionsMenu in your Activity.
You can do something similar to this implementing your own custom ActionProvider Check this out, in the "Creating a custom action provider" section.
Hope it helps
I need to create some type of quick action menu that appears to the right side of the clicked item (button) whenever the user clicks the button.
Here's an example of what I'm trying to achieve:
When the user clicks button1 I want the "sub quick action menu" to appear like it's shown in the image above.
Is there anyway to do this 'natively' in android?
I have found this plugin but it only allows you to show the menu from the top or bottom of the button.
https://github.com/lorensiuswlt/NewQuickAction3D
As tyczj said, you could achieve that with a PopupMenu. The idea is that the popup menu will inflate a custom view with all the elements, having as background a 9 patch image.
Here's a blog post that shows how to do that. Hope it will help you.
You can do the same using Quick Action Menu, for more details you can follow the
"http://www.codeproject.com/Articles/521455/Quick-action-pattern-in-Android-and-simple-impleme"
Link.
In example Items are presented in horizontal manner, whereas you can manage them, like listview as per your requirement.
there is a PopupMenu but there is no arrow or anything pointing to where it came from. Its basically the same thing that comes up when clicking the Overflow actionbar item
Maybe this link can help you ;) But instead of sliding use press button.
Making a slide menu
I am using Action bar and having menu items implemented using Action Provider. Clicking on menu item shows Popup Spinner. Now when any Menu item is clicked and Popup screen is ON and that time - If Overflow menu item is clicked then it doesn't show menu items under Overflow list (I need to click once again to get Overflow menu items).
Is this known issue? Is there any workaround for this?
Is this known issue?
It's known. It is not an issue. The drop-down for list navigation (what I presume the "Popup Spinner" is) has the focus. It takes a tap outside of the drop-down, anywhere in the activity, to dismiss the drop-down.
This is not significantly different than the behavior of a Spinner anywhere else in Android. For example, edit a contact, and tap on the Spinner to change a phone number type (e.g., mobile vs. home vs. work). It takes a tap anywhere else to dismiss the drop-down list, before a tap will have any other meaning.
Is there any workaround for this?
Do not use list navigation or other Spinners in your app.
I'm using ActionBarSherlock and I wonder if it is possible to have a popup menu at the bottom of the screen additionally? I'd like this menu to appear when the user clicks the default menu button (hardware for older mobiles).
How can I do this?
The actionbar menu overflow is automatically replaced by items in "menu" popup if you have a hardware menu button.
http://developer.android.com/design/patterns/compatibility.html
In order for items to appear in there you should set
android:showAsAction="never"
to your menu items
You must take a look at the How to Create Android Menus?
I hope this will help you.
Does anyone know how to add a listener to the action overflow menu button ( the three dots on the action bar )?
I would like to add elements dynamically to the overflow menu, and I can't figure out how to do it.
Help please :)
Does anyone know how to add a listener to the action overflow menu button
You don't.
I would like to add elements dynamically to the overflow menu
You can try invalidateOptionsMenu() at the point when you know that you want different menu choices than what you had set up previously. However, I have heard reports that this may not affect the action bar.
If the "dynamic" aspect is based on fragments coming and going, have your fragments implement the option menu items (via overriding onCreateOptionsMenu() and calling setHasOptionsMenu(true)). Android will add and remove items based on the changing mix of fragments on the screen.