use of android.animation.PropertyValuesHolder in project PageIndicatorView by romandanylyk.
the class ScaleAnimation method createScalePropertyHolder.
@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;
}
use of android.animation.PropertyValuesHolder in project PageIndicatorView by romandanylyk.
the class SlideAnimation method createSlidePropertyHolder.
private PropertyValuesHolder createSlidePropertyHolder() {
PropertyValuesHolder holder = PropertyValuesHolder.ofInt(ANIMATION_COORDINATE, coordinateStart, coordinateEnd);
holder.setEvaluator(new IntEvaluator());
return holder;
}
use of android.animation.PropertyValuesHolder in project Android-SpinKit by ybq.
the class SpriteAnimatorBuilder method build.
public ObjectAnimator build() {
PropertyValuesHolder[] holders = new PropertyValuesHolder[fds.size()];
int i = 0;
for (Map.Entry<String, FrameData> fd : fds.entrySet()) {
FrameData data = fd.getValue();
Keyframe[] keyframes = new Keyframe[data.fractions.length];
float[] fractions = data.fractions;
float startF = fractions[startFrame];
for (int j = startFrame; j < (startFrame + data.values.length); j++) {
int key = j - startFrame;
int vk = j % data.values.length;
float fraction = fractions[vk] - startF;
if (fraction < 0) {
fraction = fractions[fractions.length - 1] + fraction;
}
if (data instanceof IntFrameData) {
keyframes[key] = Keyframe.ofInt(fraction, (Integer) data.values[vk]);
} else if (data instanceof FloatFrameData) {
keyframes[key] = Keyframe.ofFloat(fraction, (Float) data.values[vk]);
} else {
keyframes[key] = Keyframe.ofObject(fraction, data.values[vk]);
}
}
holders[i] = PropertyValuesHolder.ofKeyframe(data.property, keyframes);
i++;
}
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(sprite, holders);
animator.setDuration(duration);
animator.setRepeatCount(repeatCount);
animator.setInterpolator(interpolator);
return animator;
}
use of android.animation.PropertyValuesHolder in project SmartCampus by Vegen.
the class AnimationUtils method showFromBottom.
public static void showFromBottom(View view) {
PropertyValuesHolder p1 = PropertyValuesHolder.ofFloat("translationY", 0F);
PropertyValuesHolder p2 = PropertyValuesHolder.ofFloat("alpha", 1f);
ObjectAnimator.ofPropertyValuesHolder(view, p1, p2).setDuration(500).start();
}
use of android.animation.PropertyValuesHolder in project SmartCampus by Vegen.
the class AnimationUtils method hideToBottom.
public static void hideToBottom(View view) {
PropertyValuesHolder p1 = PropertyValuesHolder.ofFloat("translationY", view.getHeight());
PropertyValuesHolder p2 = PropertyValuesHolder.ofFloat("alpha", 0f);
ObjectAnimator.ofPropertyValuesHolder(view, p1, p2).setDuration(500).start();
}
Aggregations