Esempio n. 1
0
 public OverflowPopup(ActionMenuPresenter _enclosing, android.content.Context context
                      , [email protected] menu, android.view.View anchorView, bool
                      overflowOnly) : base(context, menu, anchorView, overflowOnly)
 {
     this._enclosing = _enclosing;
     this.setCallback(this._enclosing.mPopupPresenterCallback);
 }
Esempio n. 2
0
		public virtual void initForMenu(android.content.Context context, [email protected]
			 menu)
		{
			mContext = context;
			mInflater = android.view.LayoutInflater.from(mContext);
			mMenu = menu;
		}
Esempio n. 3
0
 public virtual void initForMenu(android.content.Context context, [email protected]
                                 menu)
 {
     mContext  = context;
     mInflater = android.view.LayoutInflater.from(mContext);
     mMenu     = menu;
 }
Esempio n. 4
0
 public virtual void onCloseMenu([email protected] menu, bool
                                 allMenusAreClosing)
 {
     if (menu is [email protected])
     {
         (([email protected])menu).getRootMenu().close(false);
     }
 }
Esempio n. 5
0
 public virtual void onCloseMenu([email protected] menu, bool
                                 allMenusAreClosing)
 {
     if (mDismissListener != null)
     {
         mDismissListener.onDismiss(this);
     }
 }
Esempio n. 6
0
 public virtual void onCloseMenu([email protected] menu, bool
                                 allMenusAreClosing)
 {
     if (mCallback != null)
     {
         mCallback.onCloseMenu(menu, allMenusAreClosing);
     }
 }
Esempio n. 7
0
 public virtual bool onMenuItemSelected([email protected] menu
                                        , android.view.MenuItem item)
 {
     if (mMenuItemClickListener != null)
     {
         return(mMenuItemClickListener.onMenuItemClick(item));
     }
     return(false);
 }
Esempio n. 8
0
 public virtual bool onOpenSubMenu([email protected] subMenu
                                   )
 {
     if (mPresenterCallback != null)
     {
         return(mPresenterCallback.onOpenSubMenu(subMenu));
     }
     return(false);
 }
Esempio n. 9
0
 public ActionModeImpl(ActionBarImpl _enclosing, android.view.ActionMode.Callback
                       callback)
 {
     this._enclosing = _enclosing;
     this.mCallback  = callback;
     this.mMenu      = new [email protected](this._enclosing.getThemedContext
                                                                       ()).setDefaultShowAsAction(android.view.MenuItemClass.SHOW_AS_ACTION_IF_ROOM);
     this.mMenu.setCallback(this);
 }
Esempio n. 10
0
 public virtual void onCloseMenu([email protected] menu, bool
                                 allMenusAreClosing)
 {
     this._enclosing.mOpenSubMenuId = 0;
     if (this._enclosing.mOpenSubMenu != null)
     {
         this._enclosing.mOpenSubMenu.dismiss();
         this._enclosing.mOpenSubMenu = null;
     }
 }
Esempio n. 11
0
 public virtual bool onOpenSubMenu([email protected] subMenu
                                   )
 {
     if (subMenu != null)
     {
         this._enclosing.mOpenSubMenuId = (([email protected])subMenu
                                           ).getItem().getItemId();
     }
     return(false);
 }
Esempio n. 12
0
 public MenuAdapter(MenuPopupHelper _enclosing, [email protected]
                    menu)
 {
     this._enclosing   = _enclosing;
     mExpandedIndex    = -1;
     this.mAdapterMenu = menu;
     this.registerDataSetObserver(new android.view.@internal.menu.MenuPopupHelper.ExpandedIndexObserver
                                      (this._enclosing));
     this.findExpandedIndex();
 }
Esempio n. 13
0
 /// <summary>Construct a new PopupMenu.</summary>
 /// <remarks>Construct a new PopupMenu.</remarks>
 /// <param name="context">Context for the PopupMenu.</param>
 /// <param name="anchor">
 /// Anchor view for this popup. The popup will appear below the anchor if there
 /// is room, or above it if there is not.
 /// </param>
 public PopupMenu(android.content.Context context, android.view.View anchor)
 {
     // TODO Theme?
     mContext = context;
     mMenu    = new [email protected](context);
     mMenu.setCallback(this);
     mAnchor = anchor;
     mPopup  = new [email protected](context, mMenu, anchor);
     mPopup.setCallback(this);
 }
Esempio n. 14
0
 public virtual void onMenuModeChange([email protected] menu
                                      )
 {
     if (this.mCallback == null)
     {
         return;
     }
     this.invalidate();
     this._enclosing.mContextView.showOverflowMenu();
 }
Esempio n. 15
0
		/// <summary>Construct a new PopupMenu.</summary>
		/// <remarks>Construct a new PopupMenu.</remarks>
		/// <param name="context">Context for the PopupMenu.</param>
		/// <param name="anchor">
		/// Anchor view for this popup. The popup will appear below the anchor if there
		/// is room, or above it if there is not.
		/// </param>
		public PopupMenu(android.content.Context context, android.view.View anchor)
		{
			// TODO Theme?
			mContext = context;
			mMenu = new [email protected](context);
			mMenu.setCallback(this);
			mAnchor = anchor;
			mPopup = new [email protected](context, mMenu, anchor);
			mPopup.setCallback(this);
		}
Esempio n. 16
0
 public virtual bool onMenuItemSelected([email protected] menu
                                        , android.view.MenuItem item)
 {
     if (this.mCallback != null)
     {
         return(this.mCallback.onActionItemClicked(this, item));
     }
     else
     {
         return(false);
     }
 }
Esempio n. 17
0
 public virtual void onCloseMenu([email protected] menu, bool
                                 allMenusAreClosing)
 {
     if (allMenusAreClosing || menu == mMenu)
     {
         dismiss();
     }
     if (mPresenterCallback != null)
     {
         mPresenterCallback.onCloseMenu(menu, allMenusAreClosing);
     }
 }
Esempio n. 18
0
 public virtual void initForMode(android.view.ActionMode mode)
 {
     if (mClose == null)
     {
         android.view.LayoutInflater inflater = android.view.LayoutInflater.from(mContext);
         mClose = inflater.inflate([email protected]_mode_close_item, this
                                   , false);
         addView(mClose);
     }
     else
     {
         if (mClose.getParent() == null)
         {
             addView(mClose);
         }
     }
     android.view.View closeButton = mClose.findViewById([email protected]_mode_close_button
                                                         );
     closeButton.setOnClickListener(new _OnClickListener_212(mode));
     [email protected] menu = ([email protected]
                                                     )mode.getMenu();
     mActionMenuPresenter = new [email protected](mContext
                                                                                );
     mActionMenuPresenter.setReserveOverflow(true);
     android.view.ViewGroup.LayoutParams layoutParams = new android.view.ViewGroup.LayoutParams
                                                            (android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams
                                                            .MATCH_PARENT);
     if (!mSplitActionBar)
     {
         menu.addMenuPresenter(mActionMenuPresenter);
         mMenuView = ([email protected])mActionMenuPresenter.getMenuView
                         (this);
         mMenuView.setBackgroundDrawable(null);
         addView(mMenuView, layoutParams);
     }
     else
     {
         // Allow full screen width in split mode.
         mActionMenuPresenter.setWidthLimit(getContext().getResources().getDisplayMetrics(
                                                ).widthPixels, true);
         // No limit to the item count; use whatever will fit.
         mActionMenuPresenter.setItemLimit(int.MaxValue);
         // Span the whole width
         layoutParams.width  = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
         layoutParams.height = mContentHeight;
         menu.addMenuPresenter(mActionMenuPresenter);
         mMenuView = ([email protected])mActionMenuPresenter.getMenuView
                         (this);
         mMenuView.setBackgroundDrawable(mSplitBackground);
         mSplitView.addView(mMenuView, layoutParams);
     }
     mAnimateInOnLayout = true;
 }
Esempio n. 19
0
		public MenuPopupHelper(android.content.Context context, [email protected]
			 menu, android.view.View anchorView, bool overflowOnly)
		{
			mContext = context;
			mInflater = android.view.LayoutInflater.from(context);
			mMenu = menu;
			mOverflowOnly = overflowOnly;
			android.content.res.Resources res = context.getResources();
			mPopupMaxWidth = System.Math.Max(res.getDisplayMetrics().widthPixels / 2, res.getDimensionPixelSize
				([email protected]_prefDialogWidth));
			mAnchorView = anchorView;
			menu.addMenuPresenter(this);
		}
Esempio n. 20
0
 public MenuPopupHelper(android.content.Context context, [email protected]
                        menu, android.view.View anchorView, bool overflowOnly)
 {
     mContext      = context;
     mInflater     = android.view.LayoutInflater.from(context);
     mMenu         = menu;
     mOverflowOnly = overflowOnly;
     android.content.res.Resources res = context.getResources();
     mPopupMaxWidth = System.Math.Max(res.getDisplayMetrics().widthPixels / 2, res.getDimensionPixelSize
                                          ([email protected]_prefDialogWidth));
     mAnchorView = anchorView;
     menu.addMenuPresenter(this);
 }
Esempio n. 21
0
 public virtual void onCloseMenu([email protected] menu, bool
                                 allMenusAreClosing)
 {
     // Only care about the (sub)menu we're presenting.
     if (menu != mMenu)
     {
         return;
     }
     dismiss();
     if (mPresenterCallback != null)
     {
         mPresenterCallback.onCloseMenu(menu, allMenusAreClosing);
     }
 }
Esempio n. 22
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);
 }
Esempio n. 23
0
        public override void initForMenu(android.content.Context context, [email protected]
                                         menu)
        {
            base.initForMenu(context, menu);
            android.content.res.Resources res = context.getResources();
            if (!mReserveOverflowSet)
            {
                mReserveOverflow = !android.view.ViewConfiguration.get(context).hasPermanentMenuKey
                                       ();
            }
            if (!mWidthLimitSet)
            {
                mWidthLimit = res.getDisplayMetrics().widthPixels / 2;
            }
            // Measure for initial configuration
            if (!mMaxItemsSet)
            {
                mMaxItems = res.getInteger([email protected]_action_buttons);
            }
            int width = mWidthLimit;

            if (mReserveOverflow)
            {
                if (mOverflowButton == null)
                {
                    mOverflowButton = new android.view.@internal.menu.ActionMenuPresenter.OverflowMenuButton
                                          (this, mSystemContext);
                    int spec = android.view.View.MeasureSpec.makeMeasureSpec(0, android.view.View.MeasureSpec
                                                                             .UNSPECIFIED);
                    mOverflowButton.measure(spec, spec);
                }
                width -= mOverflowButton.getMeasuredWidth();
            }
            else
            {
                mOverflowButton = null;
            }
            mActionItemWidthLimit = width;
            mMinCellSize          = (int)([email protected]_CELL_SIZE * res
                                          .getDisplayMetrics().density);
            // Drop a scrap view as it may no longer reflect the proper context/config.
            mScrapActionButtonView = null;
        }
Esempio n. 24
0
 public virtual void initForMenu(android.content.Context context, [email protected]
                                 menu)
 {
     if (mThemeRes != 0)
     {
         mContext  = new android.view.ContextThemeWrapper(context, mThemeRes);
         mInflater = android.view.LayoutInflater.from(mContext);
     }
     else
     {
         if (mContext != null)
         {
             mContext = context;
             if (mInflater == null)
             {
                 mInflater = android.view.LayoutInflater.from(mContext);
             }
         }
     }
     mMenu = menu;
 }
Esempio n. 25
0
		public virtual void initForMenu(android.content.Context context, [email protected]
			 menu)
		{
			if (mThemeRes != 0)
			{
				mContext = new android.view.ContextThemeWrapper(context, mThemeRes);
				mInflater = android.view.LayoutInflater.from(mContext);
			}
			else
			{
				if (mContext != null)
				{
					mContext = context;
					if (mInflater == null)
					{
						mInflater = android.view.LayoutInflater.from(mContext);
					}
				}
			}
			mMenu = menu;
		}
Esempio n. 26
0
 /// <summary>Shows menu as a dialog.</summary>
 /// <remarks>Shows menu as a dialog.</remarks>
 /// <param name="windowToken">Optional token to assign to the window.</param>
 public virtual void show(android.os.IBinder windowToken)
 {
     // Many references to mMenu, create local reference
     [email protected] menu = mMenu;
     // Get the builder for the dialog
     android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(menu
                                                                                   .getContext());
     mPresenter = new [email protected](builder.getContext
                                                                        (), [email protected]_menu_item_layout);
     mPresenter.setCallback(this);
     mMenu.addMenuPresenter(mPresenter);
     builder.setAdapter(mPresenter.getAdapter(), this);
     // Set the title
     android.view.View headerView = menu.getHeaderView();
     if (headerView != null)
     {
         // Menu's client has given a custom header view, use it
         builder.setCustomTitle(headerView);
     }
     else
     {
         // Otherwise use the (text) title and icon
         builder.setIcon(menu.getHeaderIcon()).setTitle(menu.getHeaderTitle());
     }
     // Set the key listener
     builder.setOnKeyListener(this);
     // Show the menu
     mDialog = builder.create();
     mDialog.setOnDismissListener(this);
     android.view.WindowManagerClass.LayoutParams lp = mDialog.getWindow().getAttributes
                                                           ();
     lp.type = android.view.WindowManagerClass.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
     if (windowToken != null)
     {
         lp.token = windowToken;
     }
     lp.flags |= android.view.WindowManagerClass.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
     mDialog.show();
 }
Esempio n. 27
0
 /// <summary>Instantiates this menu item.</summary>
 /// <remarks>Instantiates this menu item.</remarks>
 /// <param name="menu"></param>
 /// <param name="group">
 /// Item ordering grouping control. The item will be added after
 /// all other items whose order is &lt;= this number, and before any
 /// that are larger than it. This can also be used to define
 /// groups of items for batch state changes. Normally use 0.
 /// </param>
 /// <param name="id">Unique item ID. Use 0 if you do not need a unique ID.</param>
 /// <param name="categoryOrder">The ordering for this item.</param>
 /// <param name="title">The text to display for the item.</param>
 internal MenuItemImpl([email protected] menu, int group, int
                       id, int categoryOrder, int ordering, java.lang.CharSequence title, int showAsAction
                       )
 {
     if (sPrependShortcutLabel == null)
     {
         // This is instantiated from the UI thread, so no chance of sync issues
         sPrependShortcutLabel = menu.getContext().getResources().getString([email protected]
                                                                            [email protected]_shortcut_label);
         sEnterShortcutLabel = menu.getContext().getResources().getString([email protected]
                                                                          [email protected]_enter_shortcut_label);
         sDeleteShortcutLabel = menu.getContext().getResources().getString([email protected]
                                                                           [email protected]_delete_shortcut_label);
         sSpaceShortcutLabel = menu.getContext().getResources().getString([email protected]
                                                                          [email protected]_space_shortcut_label);
     }
     mMenu          = menu;
     mId            = id;
     mGroup         = group;
     mCategoryOrder = categoryOrder;
     mOrdering      = ordering;
     mTitle         = title;
     mShowAsAction  = showAsAction;
 }
Esempio n. 28
0
 public virtual void initialize([email protected] menu)
 {
     mMenu = menu;
 }
Esempio n. 29
0
		public MenuDialogHelper([email protected] menu)
		{
			mMenu = menu;
		}
Esempio n. 30
0
		/// <summary>Instantiates this menu item.</summary>
		/// <remarks>Instantiates this menu item.</remarks>
		/// <param name="menu"></param>
		/// <param name="group">
		/// Item ordering grouping control. The item will be added after
		/// all other items whose order is &lt;= this number, and before any
		/// that are larger than it. This can also be used to define
		/// groups of items for batch state changes. Normally use 0.
		/// </param>
		/// <param name="id">Unique item ID. Use 0 if you do not need a unique ID.</param>
		/// <param name="categoryOrder">The ordering for this item.</param>
		/// <param name="title">The text to display for the item.</param>
		internal MenuItemImpl([email protected] menu, int group, int
			 id, int categoryOrder, int ordering, java.lang.CharSequence title, int showAsAction
			)
		{
			if (sPrependShortcutLabel == null)
			{
				// This is instantiated from the UI thread, so no chance of sync issues 
				sPrependShortcutLabel = menu.getContext().getResources().getString([email protected]
					[email protected]_shortcut_label);
				sEnterShortcutLabel = menu.getContext().getResources().getString([email protected]
					[email protected]_enter_shortcut_label);
				sDeleteShortcutLabel = menu.getContext().getResources().getString([email protected]
					[email protected]_delete_shortcut_label);
				sSpaceShortcutLabel = menu.getContext().getResources().getString([email protected]
					[email protected]_space_shortcut_label);
			}
			mMenu = menu;
			mId = id;
			mGroup = group;
			mCategoryOrder = categoryOrder;
			mOrdering = ordering;
			mTitle = title;
			mShowAsAction = showAsAction;
		}
Esempio n. 31
0
			public ActionModeImpl(ActionBarImpl _enclosing, android.view.ActionMode.Callback 
				callback)
			{
				this._enclosing = _enclosing;
				this.mCallback = callback;
				this.mMenu = new [email protected](this._enclosing.getThemedContext
					()).setDefaultShowAsAction(android.view.MenuItemClass.SHOW_AS_ACTION_IF_ROOM);
				this.mMenu.setCallback(this);
			}
Esempio n. 32
0
 public virtual bool collapseItemActionView([email protected]
                                            menu, [email protected] item)
 {
     return(false);
 }
Esempio n. 33
0
 public virtual bool onMenuItemSelected([email protected] menu
                                        , android.view.MenuItem item)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 34
0
 public virtual void onCloseMenu([email protected] menu, bool
                                 allMenusAreClosing)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 35
0
 public virtual void onMenuModeChange([email protected] menu
                                      )
 {
     throw new System.NotImplementedException();
 }
Esempio n. 36
0
		public void initialize([email protected] menu)
		{
			mMenu = menu;
		}
Esempio n. 37
0
		public SubMenuBuilder(android.content.Context context, [email protected]
			 parentMenu, [email protected] item) : base(context)
		{
			mParentMenu = parentMenu;
			mItem = item;
		}
Esempio n. 38
0
 public MenuDialogHelper([email protected] menu)
 {
     mMenu = menu;
 }
Esempio n. 39
0
 public virtual void onMenuModeChange([email protected] menu
                                      )
 {
 }
Esempio n. 40
0
			public MenuAdapter(MenuPopupHelper _enclosing, [email protected]
				 menu)
			{
				this._enclosing = _enclosing;
				mExpandedIndex = -1;
				this.mAdapterMenu = menu;
				this.registerDataSetObserver(new android.view.@internal.menu.MenuPopupHelper.ExpandedIndexObserver
					(this._enclosing));
				this.findExpandedIndex();
			}