Search in sources :

Example 1 with IntEvaluator

use of android.animation.IntEvaluator 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 = radiusPx / 2;
        endRadiusValue = radiusPx;
    } else {
        propertyName = ANIMATION_RADIUS;
        startRadiusValue = radiusPx;
        endRadiusValue = radiusPx / 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)

Example 2 with IntEvaluator

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

the class ScaleAnimation method createScalePropertyHolder.

@NonNull
private PropertyValuesHolder createScalePropertyHolder(boolean isReverse) {
    String propertyName;
    int startRadiusValue;
    int endRadiusValue;
    if (isReverse) {
        propertyName = ANIMATION_SCALE_REVERSE;
        startRadiusValue = radiusPx;
        endRadiusValue = (int) (radiusPx * scaleFactor);
    } else {
        propertyName = ANIMATION_SCALE;
        startRadiusValue = (int) (radiusPx * scaleFactor);
        endRadiusValue = radiusPx;
    }
    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)

Example 3 with IntEvaluator

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

the class SlideAnimation method createColorPropertyHolder.

private PropertyValuesHolder createColorPropertyHolder() {
    PropertyValuesHolder holder = PropertyValuesHolder.ofInt(ANIMATION_X_COORDINATE, xStartCoordinate, xEndCoordinate);
    holder.setEvaluator(new IntEvaluator());
    return holder;
}
Also used : IntEvaluator(android.animation.IntEvaluator) PropertyValuesHolder(android.animation.PropertyValuesHolder)

Example 4 with IntEvaluator

use of android.animation.IntEvaluator in project Notes by Elder-Wu.

the class ExpandableTextView method startCollapseAnimator.

private void startCollapseAnimator() {
    int begin = mTvContent.getHeight();
    int end = mTvContent.getLineHeight() * mMaxLineCount;
    ValueAnimator valueAnimator = ValueAnimator.ofObject(new IntEvaluator(), begin, end);
    valueAnimator.setDuration(mTvContent.getLineCount() * (mHasAnimation ? 20 : 1));
    valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    valueAnimator.addListener(mAnimatorListener);
    valueAnimator.addUpdateListener(mAnimatorUpdateListener);
    valueAnimator.start();
}
Also used : IntEvaluator(android.animation.IntEvaluator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 5 with IntEvaluator

use of android.animation.IntEvaluator in project Notes by Elder-Wu.

the class ExpandableTextView method startExpandAnimator.

private void startExpandAnimator() {
    int begin = mTvContent.getHeight();
    int end = mTvContent.getLineHeight() * mTvContent.getLineCount();
    ValueAnimator valueAnimator = ValueAnimator.ofObject(new IntEvaluator(), begin, end);
    valueAnimator.setDuration(mTvContent.getLineCount() * (mHasAnimation ? 20 : 1));
    valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    valueAnimator.addListener(mAnimatorListener);
    valueAnimator.addUpdateListener(mAnimatorUpdateListener);
    valueAnimator.start();
}
Also used : IntEvaluator(android.animation.IntEvaluator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Aggregations

IntEvaluator (android.animation.IntEvaluator)7 PropertyValuesHolder (android.animation.PropertyValuesHolder)5 NonNull (android.support.annotation.NonNull)3 ValueAnimator (android.animation.ValueAnimator)2 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)2