Exemple #1
0
 void hide() {
   if (mUseQuickControls) {
     mParent.removeView(this);
   } else {
     if (!mSkipTitleBarAnimations) {
       cancelTitleBarAnimation(false);
       int visibleHeight = getVisibleTitleHeight();
       mTitleBarAnimator =
           ObjectAnimator.ofFloat(
               this, "translationY", getTranslationY(), (-getEmbeddedHeight() + visibleHeight));
       mTitleBarAnimator.addListener(mHideTileBarAnimatorListener);
       setupTitleBarAnimator(mTitleBarAnimator);
       mTitleBarAnimator.start();
     } else {
       mBaseUi.setTitleGravity(Gravity.NO_GRAVITY);
     }
   }
   mShowing = false;
 }
Exemple #2
0
 void show() {
   if (mUseQuickControls) {
     mParent.addView(this);
   } else {
     if (!mSkipTitleBarAnimations) {
       cancelTitleBarAnimation(false);
       int visibleHeight = getVisibleTitleHeight();
       float startPos = (-getEmbeddedHeight() + visibleHeight);
       if (getTranslationY() != 0) {
         startPos = Math.max(startPos, getTranslationY());
       }
       mTitleBarAnimator = ObjectAnimator.ofFloat(this, "translationY", startPos, 0);
       setupTitleBarAnimator(mTitleBarAnimator);
       mTitleBarAnimator.start();
     }
     mBaseUi.setTitleGravity(Gravity.TOP);
   }
   mShowing = true;
 }