public static PropertyValuesHolder glide(Skill skill, float duration, PropertyValuesHolder propertyValuesHolder) { propertyValuesHolder.setEvaluator(skill.getMethod(duration)); return propertyValuesHolder; }
/** * Get the {@link PropertyValuesHolder} for this {@link Skill}. * * @param duration * the duration of the animation * @param propertyValuesHolder * an animator to set the {@link EasingMethod} on. * @return the {@link PropertyValuesHolder} */ public PropertyValuesHolder glide(float duration, PropertyValuesHolder propertyValuesHolder) { propertyValuesHolder.setEvaluator(getMethod(duration)); return propertyValuesHolder; }
private PropertyValuesHolder createSlidePropertyHolder() { PropertyValuesHolder holder = PropertyValuesHolder.ofInt(ANIMATION_COORDINATE, coordinateStart, coordinateEnd); holder.setEvaluator(new IntEvaluator()); return holder; }
private PropertyValuesHolder createColorPropertyHolder(String propertyName, int startValue, int endValue) { PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startValue, endValue); holder.setEvaluator(new IntEvaluator()); return holder; }
@NonNull protected PropertyValuesHolder createScalePropertyHolder(boolean isReverse) { String propertyName; int startRadiusValue; int endRadiusValue; if (isReverse) { propertyName = ANIMATION_SCALE_REVERSE; startRadiusValue = radius; endRadiusValue = (int) (radius * scaleFactor); } else { propertyName = ANIMATION_SCALE; startRadiusValue = (int) (radius * scaleFactor); endRadiusValue = radius; } PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startRadiusValue, endRadiusValue); holder.setEvaluator(new IntEvaluator()); return holder; }
@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; }
@NonNull private PropertyValuesHolder createStrokePropertyHolder(boolean isReverse) { String propertyName; int startStrokeValue; int endStrokeValue; if (isReverse) { propertyName = ANIMATION_STROKE_REVERSE; startStrokeValue = radius; endStrokeValue = 0; } else { propertyName = ANIMATION_STROKE; startStrokeValue = 0; endStrokeValue = radius; } PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startStrokeValue, endStrokeValue); holder.setEvaluator(new IntEvaluator()); return holder; }
@NonNull @Override protected PropertyValuesHolder createScalePropertyHolder(boolean isReverse) { String propertyName; int startRadiusValue; int endRadiusValue; if (isReverse) { propertyName = ANIMATION_SCALE_REVERSE; startRadiusValue = (int) (radius * scaleFactor); endRadiusValue = radius; } else { propertyName = ANIMATION_SCALE; startRadiusValue = radius; endRadiusValue = (int) (radius * scaleFactor); } PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startRadiusValue, endRadiusValue); holder.setEvaluator(new IntEvaluator()); return holder; } }
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; }