@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; }
@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; }
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; }
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; }
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(); }
@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; } } }
@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(); } }
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; }
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());
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());
public void startColorChangeAnim() { ObjectAnimator animator = ObjectAnimator.ofInt(mLayout, "backgroundColor", mColors); animator.setDuration(3000); animator.setEvaluator(new ArgbEvaluator()); animator.start(); } }
ObjectAnimator objAnim = (ObjectAnimator)AnimatorInflater.loadAnimator(getActivity(), R.animator.animator_bkg); objAnim.setTarget(view); objAnim.setEvaluator(new ArgbEvaluator()); objAnim.start();
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();
@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; } } }
strokeColorAnimation.setEvaluator(new ArgbEvaluator()); bgColorAnimation.setEvaluator(new ArgbEvaluator());
fadeToBlack.setEvaluator(mColorEvaluator); if (runningInfo != null) { fadeFromBlack.setEvaluator(mColorEvaluator); if (runningInfo != null && !firstHalf) {
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(); } }
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(); }
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();
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; }