Exemplo n.º 1
0
 public override void finish()
 {
     if (this._enclosing.mActionMode != this)
     {
         // Not the active action mode - no-op
         return;
     }
     // If we were hidden before the mode was shown, defer the onDestroy
     // callback until the animation is finished and associated relayout
     // is about to happen. This lets apps better anticipate visibility
     // and layout behavior.
     if (this._enclosing.mWasHiddenBeforeMode)
     {
         this._enclosing.mDeferredDestroyActionMode   = this;
         this._enclosing.mDeferredModeDestroyCallback = this.mCallback;
     }
     else
     {
         this.mCallback.onDestroyActionMode(this);
     }
     this.mCallback = null;
     this._enclosing.animateToMode(false);
     // Clear out the context mode views after the animation finishes
     this._enclosing.mContextView.closeMode();
     this._enclosing.mActionView.sendAccessibilityEvent(android.view.accessibility.AccessibilityEvent
                                                        .TYPE_WINDOW_STATE_CHANGED);
     this._enclosing.mActionMode = null;
     if (this._enclosing.mWasHiddenBeforeMode)
     {
         this._enclosing.hide();
     }
 }
Exemplo n.º 2
0
        public virtual android.view.ActionMode startActionMode(android.view.ActionMode.Callback
                                                               callback)
        {
            bool wasHidden = false;

            if (mActionMode != null)
            {
                wasHidden = mWasHiddenBeforeMode;
                mActionMode.finish();
            }
            mContextView.killMode();
            [email protected] mode = new [email protected]
                                                                      .ActionModeImpl(this, callback);
            if (mode.dispatchOnCreate())
            {
                mWasHiddenBeforeMode = !isShowing() || wasHidden;
                mode.invalidate();
                mContextView.initForMode(mode);
                animateToMode(true);
                if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT)
                {
                    // TODO animate this
                    mSplitView.setVisibility(android.view.View.VISIBLE);
                }
                mContextView.sendAccessibilityEvent(android.view.accessibility.AccessibilityEvent
                                                    .TYPE_WINDOW_STATE_CHANGED);
                mActionMode = mode;
                return(mode);
            }
            return(null);
        }
Exemplo n.º 3
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);
 }
Exemplo n.º 4
0
 internal virtual void completeDeferredDestroyActionMode()
 {
     if (mDeferredModeDestroyCallback != null)
     {
         mDeferredModeDestroyCallback.onDestroyActionMode(mDeferredDestroyActionMode);
         mDeferredDestroyActionMode   = null;
         mDeferredModeDestroyCallback = null;
     }
 }
Exemplo n.º 5
0
 public virtual android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode
                                                                   .Callback callback)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 6
0
 public override android.view.ActionMode startActionModeForChild(android.view.View
                                                                 child, android.view.ActionMode.Callback callback)
 {
     // No starting an action mode for an action bar child! (Where would it go?)
     return(null);
 }
Exemplo n.º 7
0
 public override android.view.ActionMode startActionModeForChild(android.view.View
                                                                 child, android.view.ActionMode.Callback callback)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 8
0
 public StandaloneActionMode(android.content.Context context, [email protected]
                             view, android.view.ActionMode.Callback callback, bool isFocusable)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 9
0
			public override void finish()
			{
				if (this._enclosing.mActionMode != this)
				{
					// Not the active action mode - no-op
					return;
				}
				// If we were hidden before the mode was shown, defer the onDestroy
				// callback until the animation is finished and associated relayout
				// is about to happen. This lets apps better anticipate visibility
				// and layout behavior.
				if (this._enclosing.mWasHiddenBeforeMode)
				{
					this._enclosing.mDeferredDestroyActionMode = this;
					this._enclosing.mDeferredModeDestroyCallback = this.mCallback;
				}
				else
				{
					this.mCallback.onDestroyActionMode(this);
				}
				this.mCallback = null;
				this._enclosing.animateToMode(false);
				// Clear out the context mode views after the animation finishes
				this._enclosing.mContextView.closeMode();
				this._enclosing.mActionView.sendAccessibilityEvent(android.view.accessibility.AccessibilityEvent
					.TYPE_WINDOW_STATE_CHANGED);
				this._enclosing.mActionMode = null;
				if (this._enclosing.mWasHiddenBeforeMode)
				{
					this._enclosing.hide();
				}
			}
Exemplo n.º 10
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);
			}
Exemplo n.º 11
0
		internal virtual void completeDeferredDestroyActionMode()
		{
			if (mDeferredModeDestroyCallback != null)
			{
				mDeferredModeDestroyCallback.onDestroyActionMode(mDeferredDestroyActionMode);
				mDeferredDestroyActionMode = null;
				mDeferredModeDestroyCallback = null;
			}
		}
Exemplo n.º 12
0
 public ExtractActionMode(ExtractEditLayout _enclosing, android.view.ActionMode.Callback
                          cb)
 {
     throw new System.NotImplementedException();
 }