I need help on how I would make an options menu outside of toolbar. The one with the dropdown like the options menu in chrome or messaging, not the contextual which pops up like an alert/progress dialog.
I am planning to use it beside a textview, not on a toolbar. I get the idea of having to create an xml for the menu, but what do I use on the layout and how do I inflate it?
How to add menu button without action bar?
those are two pretty acceptable solutions, doubt there is any other workaround...or just use a spinner
Related
I want to create a menu similar to this.
Please guide me to do that. Thanks.
Start by following this: https://developer.android.com/training/appbar/actions.html
It specifically shows adding buttons to the bar but in the same xml you can set them to show up as a menu like you want.
I'm making a simple android app, and I'm trying to work out the best way to make the main menu. The users of this app are not likely to be that sophisticated, so I want to make it as simple as possible.
So I want the first screen they see when the app opens to be this menu - they click on what they want, and it takes them to that part of the app (Not pressing a "Menu" button to bring it across from the left, which is common nowdays).
So, I want the menu to look a bit like this: http://cloud.addictivetips.com/wp-content/uploads/2012/10/AppZapp-Android-Menu.jpg , minus the search box, and the strip down the right hand side. (also this looks like it is one of those menus that slide out from the left, which I dont want)
I have had a look into menus (https://developer.android.com/guide/topics/ui/menus.html#options-menu), but it seems it is more used for contextual stuff, or letting the user select an option), then a navigation menu.
So - what is the best way to do this? Do I just create a list and put a button in each item?
Based on the your requirement , Use Navigation drawer see the below link.
Navigation drawer tutorial
NavigationDrawerSample
After used navigation drawer, you need to add search view on navigation header.For more info see the link
SearchView tutorial
I'm trying to add a submenu to the Android BottomBar, similar to this except the submenu should show after clicking a BottomBar icon.
I was able to get the BottomBar working, just looking for a simple submenu example. I basically want the user to click "Color" on the BottomBar and have a list of colors appear. After selecting, an ImageView tint will change based on selection.
I ended up abandoning BottomBar and using a row of plain Buttons with ListViews for pop-up menus. Much more control and better suited for my scenario.
How can I display a menu in my application when I don't have a hardware menu button on my phone and when I hide the titlebar?
To answer to your question: you can open the menu programmatically using openOptionsMenu().
However, you probably should include a ActionBar instead, as suggested in the comments.
as the title suggests I'm trying to add code to my app which allows the user to click on an item in the action bar menu which then unfolds a drop down menu (spinner class?) containing a few options such as lamp, tv etc. - each with an icon. The user will then be able to select one of these and drag and drop the icon (or an image representing the icon) to the canvas where it is then drawn. What is the best way to go about this?
If you're referring to the ActionBar overflow menu items, then you would have to take a look at the code for the ActionBar in the framework and extend it in your application, but that would firstly require quite a hassle and secondly would break compatibility when changes are made to the ActionBar in new versions of Android.
Also, this goes completely away from what the ActionBar is intended to be. You should only have actions in the overflow menu, not contain elements that directly interact with the Activity content. It's just wrong. Consider redesigning your UI so that you implement the requested featured inside the content view, not on the ActionBar.