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