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;
}
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;
}
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;
}
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();
}
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();
}
Aggregations