本文整理匯總了Java中com.nineoldandroids.animation.ValueAnimator.setEvaluator方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueAnimator.setEvaluator方法的具體用法?Java ValueAnimator.setEvaluator怎麽用?Java ValueAnimator.setEvaluator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.nineoldandroids.animation.ValueAnimator
的用法示例。
在下文中一共展示了ValueAnimator.setEvaluator方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parseAnimatorFromTypeArray
import com.nineoldandroids.animation.ValueAnimator; //導入方法依賴的package包/類
/**
* @param anim The animator, must not be null
* @param arrayAnimator Incoming typed array for Animator's attributes.
* @param arrayObjectAnimator Incoming typed array for Object Animator's
* attributes.
*/
private static void parseAnimatorFromTypeArray(ValueAnimator anim,
TypedArray arrayAnimator, TypedArray arrayObjectAnimator) {
long duration = arrayAnimator.getInt(R.styleable.Animator_android_duration, 300);
long startDelay = arrayAnimator.getInt(R.styleable.Animator_android_startOffset, 0);
int valueType = arrayAnimator.getInt(R.styleable.Animator_vc_valueType, 0);
TypeEvaluator evaluator = null;
// Must be a path animator by the time I reach here
if (valueType == VALUE_TYPE_PATH) {
evaluator = setupAnimatorForPath(anim, arrayAnimator);
} else {
throw new IllegalArgumentException("target is not a pathType target");
}
anim.setDuration(duration);
anim.setStartDelay(startDelay);
if (arrayAnimator.hasValue(R.styleable.Animator_android_repeatCount)) {
anim.setRepeatCount(
arrayAnimator.getInt(R.styleable.Animator_android_repeatCount, 0));
}
if (arrayAnimator.hasValue(R.styleable.Animator_android_repeatMode)) {
anim.setRepeatMode(
arrayAnimator.getInt(R.styleable.Animator_android_repeatMode,
ValueAnimator.RESTART));
}
if (evaluator != null) {
anim.setEvaluator(evaluator);
}
if (arrayObjectAnimator != null) {
setupObjectAnimator(anim, arrayObjectAnimator);
}
}
示例2: glide
import com.nineoldandroids.animation.ValueAnimator; //導入方法依賴的package包/類
public static ValueAnimator glide(Skill skill, float duration, ValueAnimator animator, BaseEasingMethod.EasingListener ... listeners){
BaseEasingMethod t = skill.getMethod(duration);
if(listeners!=null)
t.addEasingListeners(listeners);
animator.setEvaluator(t);
return animator;
}
示例3: MyAnimationView
import com.nineoldandroids.animation.ValueAnimator; //導入方法依賴的package包/類
public MyAnimationView(Context context) {
super(context);
// Animate background color
// Note that setting the background color will automatically invalidate the
// view, so that the animated color, and the bouncing balls, get redisplayed on
// every frame of the animation.
ValueAnimator colorAnim = ObjectAnimator.ofInt(this, "backgroundColor", RED, BLUE);
colorAnim.setDuration(3000);
colorAnim.setEvaluator(new ArgbEvaluator());
colorAnim.setRepeatCount(ValueAnimator.INFINITE);
colorAnim.setRepeatMode(ValueAnimator.REVERSE);
colorAnim.start();
}