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); }
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(); } }
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(); } } }
/// <summary>Adds the given animation to the list of animations for this object.</summary> /// <remarks>Adds the given animation to the list of animations for this object.</remarks> /// <param name="anim"></param> /// <param name="overwrite"></param> /// <returns></returns> private [email protected] addAnimation(android.animation.ObjectAnimator anim, bool overwrite) { if (anim != null) { mAnimators.add(anim); } mNeedToStart.add(anim); return(this); }
/// <exception cref="android.content.res.Resources.NotFoundException"></exception> private static android.animation.ObjectAnimator loadObjectAnimator(android.content.Context context, android.util.AttributeSet attrs) { android.animation.ObjectAnimator anim = new android.animation.ObjectAnimator(); loadAnimator(context, attrs, anim); android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.PropertyAnimator); string propertyName = a.getString([email protected]_propertyName ); anim.setPropertyName(propertyName); a.recycle(); return(anim); }
/// <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(); }
/// <summary> /// Adds an animation that interpolates given property from its current value /// to the given value. /// </summary> /// <remarks> /// Adds an animation that interpolates given property from its current value /// to the given value. /// </remarks> /// <param name="duration">the duration, in ms.</param> /// <param name="delay">the delay to start the animation, in ms.</param> /// <param name="property">the property to animate</param> /// <param name="toValue">the target value</param> /// <param name="replace">if true, replace the current animation with this one.</param> public virtual android.animation.ObjectAnimator addAnimTo(long duration, long delay , string property, float toValue, bool replace) { if (replace) { removeAnimationFor(property); } android.animation.ObjectAnimator anim = android.animation.ObjectAnimator.ofFloat( this, property, toValue); anim.setDuration(duration); anim.setStartDelay(delay); anim.setInterpolator(EASE_OUT_INTERPOLATOR); this.addAnimation(anim, replace); return(anim); }
/// <summary> /// @brief /// </summary> /// <param name="view"> </param> /// <param name="duration"> </param> /// <param name="dx"> </param> /// <param name="dy"> /// @return </param> public virtual Animator createScaleAnimator(View view, long duration, float dx, float dy) { Animator scaleX = ObjectAnimator.ofFloat(view, View.SCALE_X, 1.0f, 1.0f - dx); Animator scaleY = ObjectAnimator.ofFloat(view, View.SCALE_Y, 1.0f, 1.0f - dy); scaleX.Interpolator = new CycleInterpolator(1.0f); scaleY.Interpolator = new CycleInterpolator(1.0f); AnimatorSet animator = new AnimatorSet(); animator.Duration = duration; animator.playTogether(scaleX, scaleY); return(animator); }
/// <summary> /// @brief /// </summary> /// <param name="toHide"> </param> /// <param name="duration"> /// @return </param> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public android.animation.Animator createCollapseActionsAnimator(final android.view.View toHide, long duration) public virtual Animator createCollapseActionsAnimator(View toHide, long duration) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final float baseAlpha = toHide.getAlpha(); float baseAlpha = toHide.Alpha; Animator fadeOutAnimator = ObjectAnimator.ofFloat(toHide, View.ALPHA, baseAlpha, 0.0f); fadeOutAnimator.Duration = FcConstants.DEFAULT_FADE_ANIM_DURATION; AnimatorSet animator = new AnimatorSet(); animator.playSequentially(fadeOutAnimator, createCollapseAnimator(toHide, duration - FcConstants.DEFAULT_FADE_ANIM_DURATION)); return(animator); }
/// <summary> /// @brief /// </summary> /// <param name="toShow"> </param> /// <param name="duration"> /// @return </param> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public android.animation.Animator createExpandActionsAnimator(final android.view.View toShow, long duration) public virtual Animator createExpandActionsAnimator(View toShow, long duration) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final float baseAlpha = toShow.getAlpha(); float baseAlpha = toShow.Alpha; Animator fadeInAnimator = ObjectAnimator.ofFloat(toShow, View.ALPHA, baseAlpha, 1.0f); fadeInAnimator.Duration = FcConstants.DEFAULT_FADE_ANIM_DURATION; AnimatorSet animator = new AnimatorSet(); animator.playSequentially(createExpandAnimator(toShow, duration - FcConstants.DEFAULT_FADE_ANIM_DURATION), fadeInAnimator); animator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper4(this, toShow)); return(animator); }
/// <exception cref="android.content.res.Resources.NotFoundException"></exception> private static android.animation.ObjectAnimator loadObjectAnimator(android.content.Context context, android.util.AttributeSet attrs) { android.animation.ObjectAnimator anim = new android.animation.ObjectAnimator(); loadAnimator(context, attrs, anim); android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.PropertyAnimator); string propertyName = a.getString([email protected]_propertyName ); anim.setPropertyName(propertyName); a.recycle(); return anim; }
public virtual void setOutAnimation(android.animation.ObjectAnimator outAnimation ) { throw new System.NotImplementedException(); }
public Tweener(android.animation.ObjectAnimator anim) { throw new System.NotImplementedException(); }