List of usage examples for android.animation ObjectAnimator getPropertyName
@Nullable
public String getPropertyName()
From source file:android.support.graphics.drawable.AnimatedVectorDrawableCompat.java
/** * Utility function to fix color interpolation prior to Lollipop. Without this fix, colors * are evaluated as raw integers instead of as colors, which leads to artifacts during * fillColor animations.//from www .j ava2 s . co m */ private void setupColorAnimator(Animator animator) { if (animator instanceof AnimatorSet) { List<Animator> childAnimators = ((AnimatorSet) animator).getChildAnimations(); if (childAnimators != null) { for (int i = 0; i < childAnimators.size(); ++i) { setupColorAnimator(childAnimators.get(i)); } } } if (animator instanceof ObjectAnimator) { ObjectAnimator objectAnim = (ObjectAnimator) animator; final String propertyName = objectAnim.getPropertyName(); if ("fillColor".equals(propertyName) || "strokeColor".equals(propertyName)) { if (mArgbEvaluator == null) { mArgbEvaluator = new ArgbEvaluator(); } objectAnim.setEvaluator(mArgbEvaluator); } } }