I want to display popup menu with sub items as shown in the image.
What is the correct approach for this.
Related
I have a SubMenu with a list of checkable MenuItems as shown below:
The number of menu items in SubMenu is too long and the problem is when user selects a menu item located at the end of the list, and then reopen the SubMenu, menu items list is shown from the top with unchecked items and user has to scroll to bottom to see previous selection:
Now the question is, is there any way to scroll the list to show checked item? I have the same problem with PopupMenu.
The attached UI is the calllog. What i am interested is that how the horizontal menu is implemented. When click on one list item, it appeared in one line under the list item.
In the earlier android, one click on list item, we can use Context menu popup menu to show the available action to do.
I am curious that it is using expandable list view concept?
I want to design like that when click on list item to show like this, but my layout would not be the same as this one. I want to put custom layout depending on the list item type. It may include button, textview, other widgets and the layout height will not be the list item height.
Can someone give some suggestion? Thanks a lot.
I have a GridView with some items and when the user clicks on an item, I show a DialogFragment with all the item details. I wanted to know if there is a way to create my own dropdown menu like the ones in the ActionBar. Meaning, when the user will click on an ImageButton let's say, I would show all the available actions for this item, like deletion, editing etc.
Any ideas are welcomed.
you could try PopupMenu. PopupMenu could be used to display a custom dropdown menu which could be anchored to a view
https://developer.android.com/reference/android/widget/PopupMenu.html
Hi in my application I need to add Some menu items. The problem is, one menu item should only display when the focus is on one of the listview items.
Simply one of the menu items should only display if the focus is on at one the of the listview items. When the focus is at anywhere else then should display only the other menu items except that. Other menu items will display always.
I can track the focus. I tried to run following code only when focus is on listview.
menu.add(0, Menu.FIRST, 0, "Add to favourite List"); [Problem: if I press menu button more than one time while focus there it creates new menu item each time when I press the menu button.]
I am inflating from xml menu and create others.
Can anyone guide me how to do this... Thanks
use onPrepareOptionsMenu method and clear all menu first using
menu.clear();
then add menu.
You could have a variable to keep track of whether that menu item was added or not.
In my android application I have a list view and some other buttons above the listview. I need to implement the functionality to add the selected item of the listview to my favourites list by creating a menu item.
I can create a menu item to click and add the functionality.
But it should only show the menu item if the focus is on any listview item and not when the focus is on any other button or anyItem. the menu item should only display when the focus is on any listview item and press the menu button.
Can Someone help me please.
Have you considered using a context menu instead of trying to modify the main menu? It seems like behavior might be more in line with the UI guidelines.