Beispiel #1
0
 public override bool onSubMenuSelected([email protected]
                                        subMenu)
 {
     if (!subMenu.hasVisibleItems())
     {
         return(false);
     }
     [email protected] topSubMenu = subMenu;
     while (topSubMenu.getParentMenu() != mMenu)
     {
         topSubMenu = ([email protected])topSubMenu.getParentMenu
                          ();
     }
     android.view.View anchor = findViewForItem(topSubMenu.getItem());
     if (anchor == null)
     {
         if (mOverflowButton == null)
         {
             return(false);
         }
         anchor = mOverflowButton;
     }
     mOpenSubMenuId     = subMenu.getItem().getItemId();
     mActionButtonPopup = new android.view.@internal.menu.ActionMenuPresenter.ActionButtonSubmenu
                              (this, mContext, subMenu);
     mActionButtonPopup.setAnchorView(anchor);
     mActionButtonPopup.show();
     base.onSubMenuSelected(subMenu);
     return(true);
 }
Beispiel #2
0
 public virtual bool onSubMenuSelected([email protected]
                                       subMenu)
 {
     if (subMenu.hasVisibleItems())
     {
         [email protected] subPopup = new [email protected]
                                                                    (mContext, subMenu, mAnchorView, false);
         subPopup.setCallback(mPresenterCallback);
         bool preserveIconSpacing = false;
         int  count = subMenu.size();
         {
             for (int i = 0; i < count; i++)
             {
                 android.view.MenuItem childItem = subMenu.getItem(i);
                 if (childItem.isVisible() && childItem.getIcon() != null)
                 {
                     preserveIconSpacing = true;
                     break;
                 }
             }
         }
         subPopup.setForceShowIcon(preserveIconSpacing);
         if (subPopup.tryShow())
         {
             if (mPresenterCallback != null)
             {
                 mPresenterCallback.onOpenSubMenu(subMenu);
             }
             return(true);
         }
     }
     return(false);
 }
 public virtual bool onSubMenuSelected([email protected]
                                       subMenu)
 {
     if (!subMenu.hasVisibleItems())
     {
         return(false);
     }
     // The window manager will give us a token.
     new [email protected](subMenu).show(null);
     if (mCallback != null)
     {
         mCallback.onOpenSubMenu(subMenu);
     }
     return(true);
 }
Beispiel #4
0
 public virtual bool onSubMenuSelected([email protected]
                                       subMenu)
 {
     if (this.mCallback == null)
     {
         return(false);
     }
     if (!subMenu.hasVisibleItems())
     {
         return(true);
     }
     new [email protected](this._enclosing.getThemedContext(
                                                         ), subMenu).show();
     return(true);
 }
 public override bool onSubMenuSelected([email protected]
                                        subMenu)
 {
     if (!subMenu.hasVisibleItems())
     {
         return(false);
     }
     // The window manager will give us a token.
     [email protected] helper = new [email protected]
                                                               (subMenu);
     helper.setPresenterCallback(mSubMenuPresenterCallback);
     helper.show(null);
     mOpenSubMenu   = helper;
     mOpenSubMenuId = subMenu.getItem().getItemId();
     base.onSubMenuSelected(subMenu);
     return(true);
 }