Exemplo n.º 1
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.º 2
0
 internal virtual void show(bool markHiddenBeforeMode)
 {
     if (mCurrentShowAnim != null)
     {
         mCurrentShowAnim.end();
     }
     if (mContainerView.getVisibility() == android.view.View.VISIBLE)
     {
         if (markHiddenBeforeMode)
         {
             mWasHiddenBeforeMode = false;
         }
         return;
     }
     mContainerView.setVisibility(android.view.View.VISIBLE);
     if (mShowHideAnimationEnabled)
     {
         mContainerView.setAlpha(0);
         android.animation.AnimatorSet         anim = new android.animation.AnimatorSet();
         android.animation.AnimatorSet.Builder b    = anim.play(android.animation.ObjectAnimator
                                                                .ofFloat(mContainerView, "alpha", 1));
         if (mContentView != null)
         {
             b.with(android.animation.ObjectAnimator.ofFloat(mContentView, "translationY", -mContainerView
                                                             .getHeight(), 0));
             mContainerView.setTranslationY(-mContainerView.getHeight());
             b.with(android.animation.ObjectAnimator.ofFloat(mContainerView, "translationY", 0
                                                             ));
         }
         if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT)
         {
             mSplitView.setAlpha(0);
             mSplitView.setVisibility(android.view.View.VISIBLE);
             b.with(android.animation.ObjectAnimator.ofFloat(mSplitView, "alpha", 1));
         }
         anim.addListener(mShowListener);
         mCurrentShowAnim = anim;
         anim.start();
     }
     else
     {
         mContainerView.setAlpha(1);
         mContainerView.setTranslationY(0);
         mShowListener.onAnimationEnd(null);
     }
 }