use of android.support.v7.view.menu.SubMenuBuilder in project HoloEverywhere by Prototik.
the class ActionMenuPresenter method onSubMenuSelected.
public boolean onSubMenuSelected(SubMenuBuilder subMenu) {
if (!subMenu.hasVisibleItems()) {
return false;
}
SubMenuBuilder topSubMenu = subMenu;
while (topSubMenu.getParentMenu() != mMenu) {
topSubMenu = (SubMenuBuilder) topSubMenu.getParentMenu();
}
View anchor = findViewForItem(topSubMenu.getItem());
if (anchor == null) {
if (mOverflowButton == null) {
return false;
}
anchor = mOverflowButton;
}
mOpenSubMenuId = subMenu.getItem().getItemId();
mActionButtonPopup = new ActionButtonSubmenu(mContext, subMenu);
mActionButtonPopup.setAnchorView(anchor);
mActionButtonPopup.show();
super.onSubMenuSelected(subMenu);
return true;
}
use of android.support.v7.view.menu.SubMenuBuilder in project material-components-android by material-components.
the class NavigationMenu method addSubMenu.
@Override
public SubMenu addSubMenu(int group, int id, int categoryOrder, CharSequence title) {
final MenuItemImpl item = (MenuItemImpl) addInternal(group, id, categoryOrder, title);
final SubMenuBuilder subMenu = new NavigationSubMenu(getContext(), this, item);
item.setSubMenu(subMenu);
return subMenu;
}
Aggregations