Search in sources :

Example 6 with ObjectAnimator

use of com.nineoldandroids.animation.ObjectAnimator in project UltimateAndroid by cymcsg.

the class SwitchAnimationUtil method runFlipVertialAnimation.

private void runFlipVertialAnimation(View view, long delay) {
    view.setAlpha(0);
    AnimatorSet set = new AnimatorSet();
    ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(view, "rotationX", -180f, 0f);
    ObjectAnimator objectAnimator2 = ObjectAnimator.ofFloat(view, "alpha", 0f, 1f);
    set.setDuration(mDuration);
    set.playTogether(objectAnimator1, objectAnimator2);
    set.setStartDelay(delay);
    set.start();
}
Also used : ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 7 with ObjectAnimator

use of com.nineoldandroids.animation.ObjectAnimator in project UltimateAndroid by cymcsg.

the class SwitchAnimationUtil method runRotateAnimation.

private void runRotateAnimation(View view, long delay) {
    view.setAlpha(0);
    AnimatorSet set = new AnimatorSet();
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "rotation", 0f, 360f);
    ObjectAnimator objectAnimator2 = ObjectAnimator.ofFloat(view, "scaleX", 0f, 1f);
    ObjectAnimator objectAnimator3 = ObjectAnimator.ofFloat(view, "scaleY", 0f, 1f);
    ObjectAnimator objectAnimator4 = ObjectAnimator.ofFloat(view, "alpha", 0f, 1f);
    objectAnimator2.setInterpolator(new AccelerateInterpolator(1.0f));
    objectAnimator3.setInterpolator(new AccelerateInterpolator(1.0f));
    set.setDuration(mDuration);
    set.playTogether(objectAnimator, objectAnimator2, objectAnimator3, objectAnimator4);
    set.setStartDelay(delay);
    set.start();
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 8 with ObjectAnimator

use of com.nineoldandroids.animation.ObjectAnimator in project UltimateAndroid by cymcsg.

the class SwitchAnimationUtil method runHorizonRightAnimation.

private void runHorizonRightAnimation(View view, long delay) {
    view.setAlpha(0);
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "translationX", ViewUtils.getScreenWidth(), 0);
    objectAnimator.setInterpolator(new LinearInterpolator());
    ObjectAnimator objectAnimatorAlpha = ObjectAnimator.ofFloat(view, "alpha", 0f, 1f);
    AnimatorSet set = new AnimatorSet();
    set.setStartDelay(delay);
    set.setDuration(mDuration);
    set.playTogether(objectAnimator, objectAnimatorAlpha);
    set.start();
}
Also used : LinearInterpolator(android.view.animation.LinearInterpolator) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 9 with ObjectAnimator

use of com.nineoldandroids.animation.ObjectAnimator in project HoloEverywhere by Prototik.

the class DateTimePickerUtils method getPulseAnimator.

/**
     * Render an animator to pulsate a view in place.
     *
     * @param labelToAnimate the view to pulsate.
     * @return The animator object. Use .start() to begin.
     */
public static ObjectAnimator getPulseAnimator(View labelToAnimate, float decreaseRatio, float increaseRatio) {
    Keyframe k0 = Keyframe.ofFloat(0f, 1f);
    Keyframe k1 = Keyframe.ofFloat(0.275f, decreaseRatio);
    Keyframe k2 = Keyframe.ofFloat(0.69f, increaseRatio);
    Keyframe k3 = Keyframe.ofFloat(1f, 1f);
    PropertyValuesHolder scaleX = PropertyValuesHolder.ofKeyframe(sPropertyScaleX, k0, k1, k2, k3);
    PropertyValuesHolder scaleY = PropertyValuesHolder.ofKeyframe(sPropertyScaleY, k0, k1, k2, k3);
    ObjectAnimator pulseAnimator = ObjectAnimator.ofPropertyValuesHolder(labelToAnimate, scaleX, scaleY);
    pulseAnimator.setDuration(PULSE_ANIMATOR_DURATION);
    return pulseAnimator;
}
Also used : Keyframe(com.nineoldandroids.animation.Keyframe) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) PropertyValuesHolder(com.nineoldandroids.animation.PropertyValuesHolder)

Example 10 with ObjectAnimator

use of com.nineoldandroids.animation.ObjectAnimator in project HoloEverywhere by Prototik.

the class RadialSelectorView method getDisappearAnimator.

public ObjectAnimator getDisappearAnimator() {
    if (!mIsInitialized || !mDrawValuesReady) {
        Log.e(TAG, "RadialSelectorView was not ready for animation.");
        return null;
    }
    Keyframe kf0, kf1;
    kf0 = Keyframe.ofFloat(0f, 1f);
    kf1 = Keyframe.ofFloat(1f, 0f);
    PropertyValuesHolder fade = PropertyValuesHolder.ofKeyframe("alpha", kf0, kf1);
    ObjectAnimator disappearAnimator = ObjectAnimator.ofPropertyValuesHolder(this, fade).setDuration(300);
    disappearAnimator.addUpdateListener(mInvalidateUpdateListener);
    return disappearAnimator;
}
Also used : Keyframe(com.nineoldandroids.animation.Keyframe) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) PropertyValuesHolder(com.nineoldandroids.animation.PropertyValuesHolder)

Aggregations

ObjectAnimator (com.nineoldandroids.animation.ObjectAnimator)81 AnimatorSet (com.nineoldandroids.animation.AnimatorSet)27 Animator (com.nineoldandroids.animation.Animator)20 View (android.view.View)11 PropertyValuesHolder (com.nineoldandroids.animation.PropertyValuesHolder)10 Keyframe (com.nineoldandroids.animation.Keyframe)9 Paint (android.graphics.Paint)8 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)8 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)6 TextView (android.widget.TextView)5 AdapterView (android.widget.AdapterView)4 AnimatorListenerAdapter (com.nineoldandroids.animation.AnimatorListenerAdapter)4 SuppressLint (android.annotation.SuppressLint)3 TargetApi (android.annotation.TargetApi)3 LinearInterpolator (android.view.animation.LinearInterpolator)3 OvershootInterpolator (android.view.animation.OvershootInterpolator)3 AbsListView (android.widget.AbsListView)3 ListView (android.widget.ListView)3 ValueAnimator (com.nineoldandroids.animation.ValueAnimator)3 SupportAnimator (io.codetail.animation.SupportAnimator)3