use of android.animation.PropertyValuesHolder in project PageIndicatorView by romandanylyk.
the class FillAnimation method with.
@NonNull
public FillAnimation with(int colorStartValue, int colorEndValue, int radiusValue, int strokeValue) {
if (animator != null && hasChanges(colorStartValue, colorEndValue, radiusValue, strokeValue)) {
startColor = colorStartValue;
endColor = colorEndValue;
radiusPx = radiusValue;
strokePx = strokeValue;
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;
}
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 = 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.PropertyValuesHolder 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.PropertyValuesHolder in project PageIndicatorView by romandanylyk.
the class ScaleAnimation method with.
@NonNull
public ScaleAnimation with(int colorStartValue, int colorEndValue, int radiusValue, float scaleFactorValue) {
if (animator != null && hasChanges(colorStartValue, colorEndValue, radiusValue, scaleFactorValue)) {
startColor = colorStartValue;
endColor = colorEndValue;
radiusPx = radiusValue;
scaleFactor = scaleFactorValue;
PropertyValuesHolder colorHolder = createColorPropertyHolder(false);
PropertyValuesHolder reverseColorHolder = createColorPropertyHolder(true);
PropertyValuesHolder scaleHolder = createScalePropertyHolder(false);
PropertyValuesHolder scaleReverseHolder = createScalePropertyHolder(true);
animator.setValues(colorHolder, reverseColorHolder, scaleHolder, scaleReverseHolder);
}
return this;
}
use of android.animation.PropertyValuesHolder 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;
}
Aggregations