Creating custom actionbar popup menu using layout - android

I'm trying to create a custom popup/drop down menu on Android where when I click the action button from action bar the list of overflow options will appear but in a different format (image on right instead of left, button, etc). I tried to find some question and the one close to this is this question but the answer is incomplete and lacks the explanation. Now what I tried so far is to replicate it but removed the DropDown class but nothing happens as expected. I also tried some ways using the xml menu but its just giving me the same result of image on left and text on right. I think setActionView also doesn't work the way I expected it. Hope someone can help me on this.

Related

open action bar overflow menu programatically in Android app

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

ActionBar in android at bottom

I want to put an action bar with 4 clickable entities, on the bottom of the activity. I should be able to associate each of the 4 entities/buttons with intents. Can anyone please tell me the xml file and the java code for this. I am not able to find this anywhere.
You can try a SplitActionBar but in general it is recommended that the ActionBar be at the top and contactual actions go in the bottom bar.
Alternatively you can try playing with the gravity layout parameter as shown here, though I have not tried this and would advise against it.

Android: Create a Quick Action Menu

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

Dropd down tabs or drop down menus beneath ActionBar in Android

My need is to add a drop down menu like the one shown in attached image link.
http://i.imgur.com/cWtykfN.jpg
I don't know what to be used, whether it is tabs or menus. My need is when I press the last tab/menu, the sub menu should be shown and I could be able to handle the corresponding actions. Even when I handle those menus, I should be able to show the top tab/ menu without interruption.
It's called as overflow menus. Look this example, you will get an idea.
http://wptrafficanalyzer.in/blog/adding-action-items-and-overflow-menu-items-to-action-bar-in-android/
And nice explanation been given here. http://blog.stylingandroid.com/archives/1249 and for source code.ref here: https://github.com/StylingAndroid/StylingActionBar/Tree/StylingPart2
Use the ActionBar with tab-navigation-mode and if the last tab is clicked you could simply trigger a PopupMenu (even though this seems a little weird and is not what I expect to happen when I click tab).

How to create a custom Pulldown in the Honeycomb ActionBar?

I would like to add a custom pulldown menu to the actionbar in my project similar to the one that can be found in the google books app (screen).
In this case it represents the complete table of contents of the book.
I tried to follow the guide from the developer site where there is an example with a SpinnerAdapter. But when i use a custom Layout (in my case a RelativeLayout with two TextViews in it) i get an Exception that saying "ArrayAdapter requires the resource ID to be a TextView". So i dismissed my idea with the pulldown but then i found the pulldown in the books app wich looks to me like they used a custom layout as well because it looks to me like two single TextViews in one Layout.
Could anybody please enlighten me if what i want to do is even possible and how?
To me, that looks like the options menu -- that's where options menu items not promoted to the action bar itself appear. Use onCreateOptionsMenu() and add whatever items you want to the Menu.
EDIT:
Sorry, the screenshot was a bit confusing. There are two possibilities that I can see:
This could be a submenu for that action bar item -- I haven't played with submenus and the action bar yet (though this reminds me that I need to do that...)
This could be a PopupMenu tied to a custom action bar View

Categories

Resources