Example #1
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);
 }
Example #2
0
            public ActionButtonSubmenu(ActionMenuPresenter _enclosing, android.content.Context
                                       context, [email protected] subMenu) : base(context, subMenu
                                                                                                           )
            {
                this._enclosing = _enclosing;
                this.mSubMenu   = subMenu;
                [email protected] item = ([email protected]
                                                                 )subMenu.getItem();
                if (!item.isActionButton())
                {
                    // Give a reasonable anchor to nested submenus.
                    this.setAnchorView(this._enclosing.mOverflowButton == null ? (android.view.View) this
                                       ._enclosing.mMenuView : this._enclosing.mOverflowButton);
                }
                this.setCallback(this._enclosing.mPopupPresenterCallback);
                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;
                        }
                    }
                }
                this.setForceShowIcon(preserveIconSpacing);
            }
Example #3
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);
 }
Example #4
0
 public virtual bool onSubMenuSelected([email protected]
                                       menu)
 {
     if (mCallback != null)
     {
         return(mCallback.onOpenSubMenu(menu));
     }
     return(false);
 }
Example #5
0
 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);
 }
Example #6
0
 public override void onRestoreInstanceState(android.os.Parcelable state)
 {
     [email protected] saved = ([email protected]
                                                                         .SavedState)state;
     if (saved.openSubMenuId > 0)
     {
         android.view.MenuItem item = mMenu.findItem(saved.openSubMenuId);
         if (item != null)
         {
             [email protected] subMenu = ([email protected]
                                                                   )item.getSubMenu();
             onSubMenuSelected(subMenu);
         }
     }
 }
Example #7
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);
 }
Example #8
0
 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);
 }
Example #9
0
		internal void setSubMenu([email protected] subMenu)
		{
			mSubMenu = subMenu;
			subMenu.setHeaderTitle(getTitle());
		}
Example #10
0
 internal void setSubMenu([email protected] subMenu)
 {
     mSubMenu = subMenu;
     subMenu.setHeaderTitle(getTitle());
 }
Example #11
0
 /// <hide></hide>
 public virtual void onCloseSubMenu([email protected] menu
                                    )
 {
 }
Example #12
0
		public virtual android.view.SubMenu addSubMenu(int group, int id, int categoryOrder
			, java.lang.CharSequence title)
		{
			[email protected] item = ([email protected]
				)addInternal(group, id, categoryOrder, title);
			[email protected] subMenu = new [email protected]
				(mContext, this, item);
			item.setSubMenu(subMenu);
			return subMenu;
		}
Example #13
0
 public virtual void onCloseSubMenu([email protected] menu
                                    )
 {
     throw new System.NotImplementedException();
 }
Example #14
0
 public virtual bool onSubMenuSelected([email protected]
                                       subMenu)
 {
     throw new System.NotImplementedException();
 }