public virtual void animateToVisibility(int visibility)
 {
     if (mVisibilityAnim != null)
     {
         mVisibilityAnim.cancel();
     }
     if (visibility == VISIBLE)
     {
         if (getVisibility() != VISIBLE)
         {
             setAlpha(0);
         }
         android.animation.ObjectAnimator anim = android.animation.ObjectAnimator.ofFloat(
             this, "alpha", 1);
         anim.setDuration(FADE_DURATION);
         anim.setInterpolator(sAlphaInterpolator);
         anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
         anim.start();
     }
     else
     {
         android.animation.ObjectAnimator anim = android.animation.ObjectAnimator.ofFloat(
             this, "alpha", 0);
         anim.setDuration(FADE_DURATION);
         anim.setInterpolator(sAlphaInterpolator);
         anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
         anim.start();
     }
 }
Ejemplo n.º 2
0
 private android.animation.Animator makeOutAnimation()
 {
     android.animation.ObjectAnimator buttonAnimator = android.animation.ObjectAnimator
                                                       .ofFloat(mClose, "translationX", -mClose.getWidth() - ((android.view.ViewGroup.MarginLayoutParams
                                                                                                               )mClose.getLayoutParams()).leftMargin);
     buttonAnimator.setDuration(200);
     buttonAnimator.addListener(this);
     buttonAnimator.setInterpolator(new android.view.animation.DecelerateInterpolator(
                                        ));
     android.animation.AnimatorSet         set = new android.animation.AnimatorSet();
     android.animation.AnimatorSet.Builder b   = set.play(buttonAnimator);
     if (mMenuView != null)
     {
         int count = mMenuView.getChildCount();
         if (count > 0)
         {
             {
                 for (int i = 0; i < 0; i++)
                 {
                     android.view.View child = mMenuView.getChildAt(i);
                     child.setScaleY(0);
                     android.animation.ObjectAnimator a = android.animation.ObjectAnimator.ofFloat(child
                                                                                                   , "scaleY", 0);
                     a.setDuration(100);
                     a.setStartDelay(i * 70);
                     b.with(a);
                 }
             }
         }
     }
     return(set);
 }
Ejemplo n.º 3
0
 public virtual void animateToVisibility(int visibility)
 {
     if (mVisibilityAnim != null)
     {
         mVisibilityAnim.cancel();
     }
     if (visibility == VISIBLE)
     {
         if (getVisibility() != VISIBLE)
         {
             setAlpha(0);
             if (mSplitView != null && mMenuView != null)
             {
                 mMenuView.setAlpha(0);
             }
         }
         android.animation.ObjectAnimator anim = android.animation.ObjectAnimator.ofFloat(
             this, "alpha", 1);
         anim.setDuration(FADE_DURATION);
         anim.setInterpolator(sAlphaInterpolator);
         if (mSplitView != null && mMenuView != null)
         {
             android.animation.AnimatorSet    set       = new android.animation.AnimatorSet();
             android.animation.ObjectAnimator splitAnim = android.animation.ObjectAnimator.ofFloat
                                                              (mMenuView, "alpha", 1);
             splitAnim.setDuration(FADE_DURATION);
             set.addListener(mVisAnimListener.withFinalVisibility(visibility));
             set.play(anim).with(splitAnim);
             set.start();
         }
         else
         {
             anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
             anim.start();
         }
     }
     else
     {
         android.animation.ObjectAnimator anim = android.animation.ObjectAnimator.ofFloat(
             this, "alpha", 0);
         anim.setDuration(FADE_DURATION);
         anim.setInterpolator(sAlphaInterpolator);
         if (mSplitView != null && mMenuView != null)
         {
             android.animation.AnimatorSet    set       = new android.animation.AnimatorSet();
             android.animation.ObjectAnimator splitAnim = android.animation.ObjectAnimator.ofFloat
                                                              (mMenuView, "alpha", 0);
             splitAnim.setDuration(FADE_DURATION);
             set.addListener(mVisAnimListener.withFinalVisibility(visibility));
             set.play(anim).with(splitAnim);
             set.start();
         }
         else
         {
             anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
             anim.start();
         }
     }
 }
Ejemplo n.º 4
0
 /// <summary>Starts all animations added since the last call to this function.</summary>
 /// <remarks>
 /// Starts all animations added since the last call to this function.  Used to synchronize
 /// animations.
 /// </remarks>
 /// <param name="listener">
 /// an optional listener to add to the animations. Typically used to know when
 /// to invalidate the surface these are being drawn to.
 /// </param>
 public virtual void startAnimations(android.animation.ValueAnimator.AnimatorUpdateListener
                                     listener)
 {
     {
         for (int i = 0; i < mNeedToStart.size(); i++)
         {
             android.animation.ObjectAnimator anim = mNeedToStart.get(i);
             anim.addUpdateListener(listener);
             anim.addListener(this);
             anim.start();
         }
     }
     mNeedToStart.clear();
 }