Search in sources :

Example 86 with PropertyValuesHolder

use of android.animation.PropertyValuesHolder in project android_frameworks_base by DirtyUnicorns.

the class FastScroller method animateBounds.

/**
     * Returns an animator for the view's bounds.
     */
private static Animator animateBounds(View v, Rect bounds) {
    final PropertyValuesHolder left = PropertyValuesHolder.ofInt(LEFT, bounds.left);
    final PropertyValuesHolder top = PropertyValuesHolder.ofInt(TOP, bounds.top);
    final PropertyValuesHolder right = PropertyValuesHolder.ofInt(RIGHT, bounds.right);
    final PropertyValuesHolder bottom = PropertyValuesHolder.ofInt(BOTTOM, bounds.bottom);
    return ObjectAnimator.ofPropertyValuesHolder(v, left, top, right, bottom);
}
Also used : PropertyValuesHolder(android.animation.PropertyValuesHolder)

Example 87 with PropertyValuesHolder

use of android.animation.PropertyValuesHolder in project PageIndicatorView by romandanylyk.

the class ColorAnimation method with.

@NonNull
public ColorAnimation with(int colorStart, int colorEnd) {
    if (animator != null && hasChanges(colorStart, colorEnd)) {
        this.colorStart = colorStart;
        this.colorEnd = colorEnd;
        PropertyValuesHolder colorHolder = createColorPropertyHolder(false);
        PropertyValuesHolder reverseColorHolder = createColorPropertyHolder(true);
        animator.setValues(colorHolder, reverseColorHolder);
    }
    return this;
}
Also used : PropertyValuesHolder(android.animation.PropertyValuesHolder) NonNull(android.support.annotation.NonNull)

Example 88 with PropertyValuesHolder

use of android.animation.PropertyValuesHolder in project PageIndicatorView by romandanylyk.

the class ColorAnimation method createColorPropertyHolder.

PropertyValuesHolder createColorPropertyHolder(boolean isReverse) {
    String propertyName;
    int colorStart;
    int colorEnd;
    if (isReverse) {
        propertyName = ANIMATION_COLOR_REVERSE;
        colorStart = this.colorEnd;
        colorEnd = this.colorStart;
    } else {
        propertyName = ANIMATION_COLOR;
        colorStart = this.colorStart;
        colorEnd = this.colorEnd;
    }
    PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, colorStart, colorEnd);
    holder.setEvaluator(new ArgbEvaluator());
    return holder;
}
Also used : ArgbEvaluator(android.animation.ArgbEvaluator) PropertyValuesHolder(android.animation.PropertyValuesHolder)

Example 89 with PropertyValuesHolder

use of android.animation.PropertyValuesHolder in project PageIndicatorView by romandanylyk.

the class FillAnimation method with.

@NonNull
public FillAnimation with(int colorStart, int colorEnd, int radius, int stroke) {
    if (animator != null && hasChanges(colorStart, colorEnd, radius, stroke)) {
        this.colorStart = colorStart;
        this.colorEnd = colorEnd;
        this.radius = radius;
        this.stroke = stroke;
        PropertyValuesHolder colorHolder = createColorPropertyHolder(false);
        PropertyValuesHolder reverseColorHolder = createColorPropertyHolder(true);
        PropertyValuesHolder radiusHolder = createRadiusPropertyHolder(false);
        PropertyValuesHolder radiusReverseHolder = createRadiusPropertyHolder(true);
        PropertyValuesHolder strokeHolder = createStrokePropertyHolder(false);
        PropertyValuesHolder strokeReverseHolder = createStrokePropertyHolder(true);
        animator.setValues(colorHolder, reverseColorHolder, radiusHolder, radiusReverseHolder, strokeHolder, strokeReverseHolder);
    }
    return this;
}
Also used : PropertyValuesHolder(android.animation.PropertyValuesHolder) NonNull(android.support.annotation.NonNull)

Example 90 with PropertyValuesHolder

use of android.animation.PropertyValuesHolder in project PageIndicatorView by romandanylyk.

the class FillAnimation method createRadiusPropertyHolder.

@NonNull
private PropertyValuesHolder createRadiusPropertyHolder(boolean isReverse) {
    String propertyName;
    int startRadiusValue;
    int endRadiusValue;
    if (isReverse) {
        propertyName = ANIMATION_RADIUS_REVERSE;
        startRadiusValue = radius / 2;
        endRadiusValue = radius;
    } else {
        propertyName = ANIMATION_RADIUS;
        startRadiusValue = radius;
        endRadiusValue = radius / 2;
    }
    PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startRadiusValue, endRadiusValue);
    holder.setEvaluator(new IntEvaluator());
    return holder;
}
Also used : IntEvaluator(android.animation.IntEvaluator) PropertyValuesHolder(android.animation.PropertyValuesHolder) NonNull(android.support.annotation.NonNull)

Aggregations

PropertyValuesHolder (android.animation.PropertyValuesHolder)210 ObjectAnimator (android.animation.ObjectAnimator)144 Animator (android.animation.Animator)96 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)70 ValueAnimator (android.animation.ValueAnimator)64 Paint (android.graphics.Paint)33 AnimatorSet (android.animation.AnimatorSet)25 NonNull (android.support.annotation.NonNull)18 LinearInterpolator (android.view.animation.LinearInterpolator)18 Interpolator (android.view.animation.Interpolator)16 ArrayList (java.util.ArrayList)16 ViewGroup (android.view.ViewGroup)14 View (android.view.View)12 IntEvaluator (android.animation.IntEvaluator)11 Point (android.graphics.Point)11 Keyframe (android.animation.Keyframe)10 TimeAnimator (android.animation.TimeAnimator)10 Path (android.graphics.Path)10 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)8 Rect (android.graphics.Rect)7