Search in sources :

Example 61 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project PageIndicatorView by romandanylyk.

the class DropAnimation method createAnimator.

@NonNull
@Override
public AnimatorSet createAnimator() {
    AnimatorSet animator = new AnimatorSet();
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    return animator;
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) AnimatorSet(android.animation.AnimatorSet) NonNull(android.support.annotation.NonNull)

Example 62 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project PageIndicatorView by romandanylyk.

the class DropAnimation method createValueAnimation.

private ValueAnimator createValueAnimation(int fromValue, int toValue, long duration, final AnimationType type) {
    ValueAnimator anim = ValueAnimator.ofInt(fromValue, toValue);
    anim.setInterpolator(new AccelerateDecelerateInterpolator());
    anim.setDuration(duration);
    anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            int value = (int) animation.getAnimatedValue();
            onAnimatorUpdate(value, type);
        }
    });
    return anim;
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 63 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project PageIndicatorView by romandanylyk.

the class ThinWormAnimation method createHeightAnimator.

private ValueAnimator createHeightAnimator(int fromHeight, int toHeight, long startDelay) {
    ValueAnimator anim = ValueAnimator.ofInt(fromHeight, toHeight);
    anim.setInterpolator(new AccelerateDecelerateInterpolator());
    anim.setDuration((long) (animationDuration * PERCENTAGE_HEIGHT_DURATION));
    anim.setStartDelay(startDelay);
    anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            height = (int) animation.getAnimatedValue();
            listener.onThinWormAnimationUpdated(rectLeftX, rectRightX, height);
        }
    });
    return anim;
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 64 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project PageIndicatorView by romandanylyk.

the class WormAnimation method createAnimator.

@NonNull
@Override
public AnimatorSet createAnimator() {
    AnimatorSet animator = new AnimatorSet();
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    return animator;
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) AnimatorSet(android.animation.AnimatorSet) NonNull(android.support.annotation.NonNull)

Example 65 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project WaveSwipeRefreshLayout by recruit-lifestyle.

the class WaveView method startDropAnimation.

public void startDropAnimation() {
    // show dropBubble again
    mDisappearCircleAnimator = ValueAnimator.ofFloat(1.f, 1.f);
    mDisappearCircleAnimator.setDuration(1);
    mDisappearCircleAnimator.start();
    mDropCircleAnimator = ValueAnimator.ofFloat(500 * (mWidth / 1440.f), mMaxDropHeight);
    mDropCircleAnimator.setDuration(DROP_CIRCLE_ANIMATOR_DURATION);
    mDropCircleAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            mCurrentCircleCenterY = (float) animation.getAnimatedValue();
            ViewCompat.postInvalidateOnAnimation(WaveView.this);
        }
    });
    mDropCircleAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    mDropCircleAnimator.start();
    mDropVertexAnimator = ValueAnimator.ofFloat(0.f, mMaxDropHeight - mDropCircleRadius);
    mDropVertexAnimator.setDuration(DROP_VERTEX_ANIMATION_DURATION);
    mDropVertexAnimator.addUpdateListener(mAnimatorUpdateListener);
    mDropVertexAnimator.start();
    mDropBounceVerticalAnimator = ValueAnimator.ofFloat(0.f, 1.f);
    mDropBounceVerticalAnimator.setDuration(DROP_BOUNCE_ANIMATOR_DURATION);
    mDropBounceVerticalAnimator.addUpdateListener(mAnimatorUpdateListener);
    mDropBounceVerticalAnimator.setInterpolator(new DropBounceInterpolator());
    mDropBounceVerticalAnimator.setStartDelay(DROP_VERTEX_ANIMATION_DURATION);
    mDropBounceVerticalAnimator.start();
    mDropBounceHorizontalAnimator = ValueAnimator.ofFloat(0.f, 1.f);
    mDropBounceHorizontalAnimator.setDuration(DROP_BOUNCE_ANIMATOR_DURATION);
    mDropBounceHorizontalAnimator.addUpdateListener(mAnimatorUpdateListener);
    mDropBounceHorizontalAnimator.setInterpolator(new DropBounceInterpolator());
    mDropBounceHorizontalAnimator.setStartDelay((long) (DROP_VERTEX_ANIMATION_DURATION + DROP_BOUNCE_ANIMATOR_DURATION * 0.25));
    mDropBounceHorizontalAnimator.start();
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Aggregations

AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)165 ValueAnimator (android.animation.ValueAnimator)38 ObjectAnimator (android.animation.ObjectAnimator)31 Animator (android.animation.Animator)30 View (android.view.View)30 AnimatorSet (android.animation.AnimatorSet)22 Animation (android.view.animation.Animation)19 Handler (android.os.Handler)15 NonNull (android.support.annotation.NonNull)12 TranslateAnimation (android.view.animation.TranslateAnimation)12 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)11 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)10 AlphaAnimation (android.view.animation.AlphaAnimation)10 ImageView (android.widget.ImageView)10 TextView (android.widget.TextView)10 Paint (android.graphics.Paint)9 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)9 LinearInterpolator (android.view.animation.LinearInterpolator)9 ScaleAnimation (android.view.animation.ScaleAnimation)9 PropertyValuesHolder (android.animation.PropertyValuesHolder)8