Beispiel #1
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;
		}
Beispiel #2
0
		public virtual bool onOpenSubMenu([email protected] subMenu
			)
		{
			if (subMenu == null)
			{
				return false;
			}
			if (!subMenu.hasVisibleItems())
			{
				return true;
			}
			// Current menu will be dismissed by the normal helper, submenu will be shown in its place.
			new [email protected](mContext, subMenu, mAnchor).show(
				);
			return true;
		}
Beispiel #3
0
		public virtual bool onPreparePanel(int featureId, android.view.View view, android.view.Menu
			 menu)
		{
			if (featureId == android.view.Window.FEATURE_OPTIONS_PANEL && menu != null)
			{
				bool goforit = onPrepareOptionsMenu(menu);
				goforit |= mFragments.dispatchPrepareOptionsMenu(menu);
				return goforit && menu.hasVisibleItems();
			}
			return true;
		}
Beispiel #4
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;
		}
Beispiel #5
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;
		}
Beispiel #6
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;
			}