Created
March 3, 2014 19:02
-
-
Save jromero/9332165 to your computer and use it in GitHub Desktop.
Android: TextColorAnimator, animates the color of a given TextView.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TextColorAnimator extends ValueAnimator implements AnimatorUpdateListener { | |
private TextView mTextView; | |
private TextColorAnimator(TextView textView, int startColor, int endColor) { | |
mTextView = textView; | |
setObjectValues(startColor, endColor); | |
setEvaluator(new ArgbEvaluator()); | |
addUpdateListener(this); | |
} | |
@Override | |
public void onAnimationUpdate(ValueAnimator animator) { | |
mTextView.setTextColor((Integer) animator.getAnimatedValue()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment