本文整理了Java中android.animation.ObjectAnimator.setEvaluator()
方法的一些代码示例,展示了ObjectAnimator.setEvaluator()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectAnimator.setEvaluator()
方法的具体详情如下:
包路径:android.animation.ObjectAnimator
类名称:ObjectAnimator
方法名:setEvaluator
暂无
代码示例来源:origin: DreaminginCodeZH/MaterialProgressBar
@NonNull
public static ObjectAnimator ofArgb(@Nullable Object target, @NonNull String propertyName,
int... values) {
ObjectAnimator animator = ObjectAnimator.ofInt(target, propertyName, values);
animator.setEvaluator(new ArgbEvaluator());
return animator;
}
代码示例来源:origin: DreaminginCodeZH/MaterialProgressBar
@NonNull
public static <T> ObjectAnimator ofArgb(@Nullable T target,
@NonNull Property<T, Integer> property, int... values) {
ObjectAnimator animator = ObjectAnimator.ofInt(target, property, values);
animator.setEvaluator(new ArgbEvaluator());
return animator;
}
代码示例来源:origin: florent37/ViewAnimator
public AnimationBuilder backgroundColor(int... colors) {
for (View view : views) {
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "backgroundColor", colors);
objectAnimator.setEvaluator(new ArgbEvaluator());
this.animatorList.add(objectAnimator);
}
return this;
}
代码示例来源:origin: florent37/ViewAnimator
public AnimationBuilder textColor(int... colors) {
for (View view : views) {
if (view instanceof TextView) {
TextView textView = (TextView) view;
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(textView, "textColor", colors);
objectAnimator.setEvaluator(new ArgbEvaluator());
this.animatorList.add(objectAnimator);
}
}
return this;
}
代码示例来源:origin: hitherejoe/animate
private void animateForegroundColor(@ColorInt final int targetColor) {
ObjectAnimator animator = ObjectAnimator.ofInt(this, FOREGROUND_COLOR,
Color.TRANSPARENT, targetColor);
animator.setEvaluator(new ArgbEvaluator());
animator.setStartDelay(DELAY_COLOR_CHANGE);
animator.start();
}
代码示例来源:origin: florent37/ExpectAnim
@Override
public Animator getAnimator(View viewToMove) {
if (viewToMove instanceof TextView) {
final ObjectAnimator objectAnimator = ObjectAnimator.ofInt(viewToMove, "textColor", ((TextView) viewToMove).getCurrentTextColor(), textColor);
objectAnimator.setEvaluator(new ArgbEvaluator());
return objectAnimator;
} else {
return null;
}
}
}
代码示例来源:origin: ImmortalZ/TransitionHelper
@Override
public void translate(InfoBean bean, ExposeView parent, View child) {
if (startColor != 0) {
startColor = parent.getResources().getColor(startColor);
} else {
startColor = parent.getResources().getColor(R.color.transitionhelper_showmethod_start_color);
}
if (endColor != 0) {
endColor = parent.getResources().getColor(endColor);
} else {
endColor = parent.getResources().getColor(R.color.transitionhelper_showmethod_end_color);
}
ObjectAnimator colorAnimator = ObjectAnimator.ofInt(parent, "backgroundColor", startColor, endColor);
colorAnimator.setEvaluator(new ArgbEvaluator());
set.playTogether(
ObjectAnimator.ofFloat(child, "translationX", 0, -bean.translationX),
ObjectAnimator.ofFloat(child, "translationY", 0, -bean.translationY),
ObjectAnimator.ofFloat(child, "scaleX", 1 / bean.scale),
ObjectAnimator.ofFloat(child, "scaleY", 1 / bean.scale),
colorAnimator
);
set.setInterpolator(new AccelerateInterpolator());
set.setDuration(showDuration).start();
}
}
代码示例来源:origin: tarek360/RichPath
private AnimationBuilder color(String propertyName, int... colors) {
for (final RichPath path : paths) {
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(path, propertyName, colors);
objectAnimator.setEvaluator(new ArgbEvaluator());
applyAnimatorProperties(objectAnimator, path);
}
return this;
}
代码示例来源:origin: andkulikov/Transitions-Everywhere
endColor.setColor(startColor.getColor());
bgAnimator = ObjectAnimator.ofInt(endColor, COLORDRAWABLE_COLOR, startColor.getColor(), finalColor);
bgAnimator.setEvaluator(new ArgbEvaluator());
textView.setTextColor(end);
textColorAnimator = ObjectAnimator.ofInt(textView, TEXTVIEW_TEXT_COLOR, start, end);
textColorAnimator.setEvaluator(new ArgbEvaluator());
代码示例来源:origin: andkulikov/Transitions-Everywhere
endColor.setColor(startColor.getColor());
bgAnimator = ObjectAnimator.ofInt(endColor, COLORDRAWABLE_COLOR, startColor.getColor(), finalColor);
bgAnimator.setEvaluator(new ArgbEvaluator());
textView.setTextColor(end);
textColorAnimator = ObjectAnimator.ofInt(textView, TEXTVIEW_TEXT_COLOR, start, end);
textColorAnimator.setEvaluator(new ArgbEvaluator());
代码示例来源:origin: HotBitmapGG/CreditSesameRingView
public void startColorChangeAnim() {
ObjectAnimator animator = ObjectAnimator.ofInt(mLayout, "backgroundColor", mColors);
animator.setDuration(3000);
animator.setEvaluator(new ArgbEvaluator());
animator.start();
}
}
代码示例来源:origin: stackoverflow.com
ObjectAnimator objAnim = (ObjectAnimator)AnimatorInflater.loadAnimator(getActivity(), R.animator.animator_bkg);
objAnim.setTarget(view);
objAnim.setEvaluator(new ArgbEvaluator());
objAnim.start();
代码示例来源:origin: stackoverflow.com
ObjectAnimator colorAnim = ObjectAnimator.ofInt(myButton, "textColor", Color.RED, Color.TRANSPARENT);
colorAnim.setDuration(1000);
colorAnim.setEvaluator(new ArgbEvaluator());
colorAnim.setRepeatCount(ValueAnimator.INFINITE);
colorAnim.setRepeatMode(ValueAnimator.REVERSE);
colorAnim.start();
代码示例来源:origin: GcsSloop/diycode
@Override
public Animator getAnimator(View viewToMove) {
if (viewToMove instanceof TextView) {
final ObjectAnimator objectAnimator = ObjectAnimator.ofInt(viewToMove, "textColor", ((TextView) viewToMove).getCurrentTextColor(), textColor);
objectAnimator.setEvaluator(new ArgbEvaluator());
return objectAnimator;
} else {
return null;
}
}
}
代码示例来源:origin: dmytrodanylyk/android-morphing-button
strokeColorAnimation.setEvaluator(new ArgbEvaluator());
bgColorAnimation.setEvaluator(new ArgbEvaluator());
代码示例来源:origin: google/android-ui-toolkit-demos
fadeToBlack.setEvaluator(mColorEvaluator);
if (runningInfo != null) {
fadeFromBlack.setEvaluator(mColorEvaluator);
if (runningInfo != null && !firstHalf) {
代码示例来源:origin: hujiaweibujidao/yava
private void startAnimator1() {
ObjectAnimator animator1 = new ObjectAnimator();
animator1.setTarget(textView1);
animator1.setPropertyName("translationY");
animator1.setFloatValues(0f, -100f);
animator1.setDuration(1000);
animator1.setInterpolator(new LinearInterpolator());
animator1.setEvaluator(EasingFunction.BOUNCE_OUT);
animator1.start();
}
}
代码示例来源:origin: googlecodelabs/android-topeka
private void animateForegroundColor(@ColorInt final int targetColor) {
ObjectAnimator animator = ObjectAnimator.ofInt(this, ViewUtils.FOREGROUND_COLOR,
Color.TRANSPARENT, targetColor);
animator.setEvaluator(new ArgbEvaluator());
animator.setStartDelay(FOREGROUND_COLOR_CHANGE_DELAY);
animator.start();
}
代码示例来源:origin: stackoverflow.com
View v = findViewById(R.id.mask2);
ObjectAnimator anim = ObjectAnimator.ofInt(v, "backgroundColor", Color.RED, Color.BLUE);
anim.setDuration(3000);
anim.setEvaluator(new ArgbEvaluator());
anim.setRepeatCount(ValueAnimator.INFINITE);
anim.setRepeatMode(ValueAnimator.REVERSE);
anim.start();
代码示例来源:origin: tajchert/WaitingDots
private ObjectAnimator createDotJumpAnimator(JumpingSpan jumpingSpan, long delay) {
ObjectAnimator jumpAnimator = ObjectAnimator.ofFloat(jumpingSpan, "translationY", 0, -jumpHeight);
jumpAnimator.setEvaluator(new SinTypeEvaluator());
jumpAnimator.setDuration(period);
jumpAnimator.setStartDelay(delay);
jumpAnimator.setRepeatCount(ValueAnimator.INFINITE);
jumpAnimator.setRepeatMode(ValueAnimator.RESTART);
return jumpAnimator;
}
内容来源于网络,如有侵权,请联系作者删除!