Search in sources :

Example 86 with LinearInterpolator

use of android.view.animation.LinearInterpolator in project android_packages_apps_DUI by DirtyUnicorns.

the class FlingLogoController method getSpinAnimation.

public static AnimationSet getSpinAnimation(int mode) {
    final boolean makeHidden = mode == LOGO_ANIMATE_HIDE;
    final float from = makeHidden ? 1.0f : 0.0f;
    final float to = makeHidden ? 0.0f : 1.0f;
    final float fromDeg = makeHidden ? 0.0f : 360.0f;
    final float toDeg = makeHidden ? 360.0f : 0.0f;
    Animation scale = new ScaleAnimation(from, to, from, to, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    RotateAnimation rotate = new RotateAnimation(fromDeg, toDeg, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    AnimationSet animSet = new AnimationSet(true);
    animSet.setInterpolator(new LinearInterpolator());
    animSet.setDuration(150);
    animSet.setFillAfter(true);
    animSet.addAnimation(scale);
    animSet.addAnimation(rotate);
    return animSet;
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) ScaleAnimation(android.view.animation.ScaleAnimation) Animation(android.view.animation.Animation) RotateAnimation(android.view.animation.RotateAnimation) AnimationSet(android.view.animation.AnimationSet) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 87 with LinearInterpolator

use of android.view.animation.LinearInterpolator in project Ushahidi_Android by ushahidi.

the class IcsProgressBar method startAnimation.

/**
     * <p>Start the indeterminate progress animation.</p>
     */
void startAnimation() {
    if (getVisibility() != VISIBLE) {
        return;
    }
    if (mIndeterminateDrawable instanceof Animatable) {
        mShouldStartAnimationDrawable = true;
        mAnimation = null;
    } else {
        if (mInterpolator == null) {
            mInterpolator = new LinearInterpolator();
        }
        mTransformation = new Transformation();
        mAnimation = new AlphaAnimation(0.0f, 1.0f);
        mAnimation.setRepeatMode(mBehavior);
        mAnimation.setRepeatCount(Animation.INFINITE);
        mAnimation.setDuration(mDuration);
        mAnimation.setInterpolator(mInterpolator);
        mAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
    }
    postInvalidate();
}
Also used : Transformation(android.view.animation.Transformation) LinearInterpolator(android.view.animation.LinearInterpolator) Animatable(android.graphics.drawable.Animatable) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 88 with LinearInterpolator

use of android.view.animation.LinearInterpolator in project welcome-coordinator by txusballesteros.

the class AnimationLaunch method onCreate.

@Override
protected void onCreate(WelcomeCoordinatorLayout coordinator) {
    objectAnimatorY = ObjectAnimator.ofFloat(getTargetView(), View.TRANSLATION_Y, 0, -getTargetView().getTop() - getTargetView().getHeight());
    objectAnimatorY.setDuration(DURATION);
    objectAnimatorY.setInterpolator(new LinearInterpolator());
    objectAnimatorX = ObjectAnimator.ofFloat(getTargetView(), View.TRANSLATION_X, 0, coordinatorLayout.getWidth());
    objectAnimatorX.setDuration(DURATION);
    objectAnimatorX.setInterpolator(new LinearInterpolator());
}
Also used : LinearInterpolator(android.view.animation.LinearInterpolator)

Example 89 with LinearInterpolator

use of android.view.animation.LinearInterpolator in project welcome-coordinator by txusballesteros.

the class ParallaxTitleBehaviour method onCreate.

@Override
protected void onCreate(WelcomeCoordinatorLayout coordinator) {
    final FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) getPage().getLayoutParams();
    long startDelay;
    long duration;
    float rightTranslation;
    float leftTranslation;
    if (params.leftMargin == 0) {
        startDelay = 0;
        duration = getPage().getMeasuredWidth();
        rightTranslation = 0;
        leftTranslation = -(duration / PARALLAX_FACTOR);
    } else {
        startDelay = (params.leftMargin - coordinator.getMeasuredWidth());
        duration = (getPage().getMeasuredWidth() * 2);
        rightTranslation = (duration / PARALLAX_FACTOR);
        leftTranslation = -(duration / PARALLAX_FACTOR);
    }
    parallaxAnimator = ObjectAnimator.ofFloat(getTargetView(), View.TRANSLATION_X, rightTranslation, leftTranslation);
    parallaxAnimator.setInterpolator(new LinearInterpolator());
    parallaxAnimator.setTarget(getTargetView());
    parallaxAnimator.setStartDelay(startDelay);
    parallaxAnimator.setDuration(duration);
}
Also used : LinearInterpolator(android.view.animation.LinearInterpolator) FrameLayout(android.widget.FrameLayout)

Example 90 with LinearInterpolator

use of android.view.animation.LinearInterpolator in project welcome-coordinator by txusballesteros.

the class InSyncAnimator method initializeAnimator.

private void initializeAnimator() {
    final View avatarView = rootView.findViewById(R.id.avatar5);
    final View arrowChartMaskView = rootView.findViewById(R.id.arrow_chart_mask);
    final ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(avatarView, View.SCALE_X, 0f, 1f);
    scaleXAnimator.setDuration(300);
    scaleXAnimator.setInterpolator(new OvershootInterpolator());
    final ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(avatarView, View.SCALE_Y, 0f, 1f);
    scaleYAnimator.setDuration(300);
    scaleYAnimator.setInterpolator(new OvershootInterpolator());
    final ObjectAnimator maskScaleXAnimator = ObjectAnimator.ofFloat(arrowChartMaskView, View.SCALE_X, 1f, 0f);
    maskScaleXAnimator.setDuration(500);
    maskScaleXAnimator.setInterpolator(new LinearInterpolator());
    animator = new AnimatorSet();
    animator.play(scaleXAnimator).with(scaleYAnimator).before(maskScaleXAnimator);
}
Also used : OvershootInterpolator(android.view.animation.OvershootInterpolator) LinearInterpolator(android.view.animation.LinearInterpolator) ObjectAnimator(android.animation.ObjectAnimator) AnimatorSet(android.animation.AnimatorSet) View(android.view.View)

Aggregations

LinearInterpolator (android.view.animation.LinearInterpolator)217 ValueAnimator (android.animation.ValueAnimator)65 Animator (android.animation.Animator)42 ObjectAnimator (android.animation.ObjectAnimator)39 Paint (android.graphics.Paint)30 ArrayList (java.util.ArrayList)28 AlphaAnimation (android.view.animation.AlphaAnimation)27 RotateAnimation (android.view.animation.RotateAnimation)24 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)22 PropertyValuesHolder (android.animation.PropertyValuesHolder)18 Animatable (android.graphics.drawable.Animatable)17 View (android.view.View)17 Animation (android.view.animation.Animation)17 Transformation (android.view.animation.Transformation)17 AnimatorSet (android.animation.AnimatorSet)14 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)14 TranslateAnimation (android.view.animation.TranslateAnimation)12 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)11 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)9 AnimationListener (android.view.animation.Animation.AnimationListener)8