@Override public void finish() { if (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 (mWasHiddenBeforeMode) { mDeferredDestroyActionMode = this; mDeferredModeDestroyCallback = mCallback; } else { mCallback.onDestroyActionMode(this); } mCallback = null; animateToMode(false); // Clear out the context mode views after the animation finishes mContextView.closeMode(); mActionView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); mActionMode = null; if (mWasHiddenBeforeMode) { hide(); } }
@Override public void finish() { if (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 (mWasHiddenBeforeMode) { mDeferredDestroyActionMode = this; mDeferredModeDestroyCallback = mCallback; } else { mCallback.onDestroyActionMode(this); } mCallback = null; animateToMode(false); // Clear out the context mode views after the animation finishes mContextView.closeMode(); mActionView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); mActionMode = null; if (mWasHiddenBeforeMode) { hide(); } }