Merge "Fix blue channel gets updated incorrectly in ChangeText transition"

This commit is contained in:
Doris Liu
2016-05-24 23:39:40 +00:00
committed by Android (Google) Code Review

View File

@@ -210,13 +210,12 @@ public class ChangeText extends Transition {
ValueAnimator outAnim = null, inAnim = null;
if (mChangeBehavior == CHANGE_BEHAVIOR_OUT_IN ||
mChangeBehavior == CHANGE_BEHAVIOR_OUT) {
outAnim = ValueAnimator.ofInt(255, 0);
outAnim = ValueAnimator.ofInt(Color.alpha(startColor), 0);
outAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int currAlpha = (Integer) animation.getAnimatedValue();
view.setTextColor(currAlpha << 24 | startColor & 0xff0000 |
startColor & 0xff00 | startColor & 0xff);
view.setTextColor(currAlpha << 24 | startColor & 0xffffff);
}
});
outAnim.addListener(new AnimatorListenerAdapter() {
@@ -237,13 +236,12 @@ public class ChangeText extends Transition {
}
if (mChangeBehavior == CHANGE_BEHAVIOR_OUT_IN ||
mChangeBehavior == CHANGE_BEHAVIOR_IN) {
inAnim = ValueAnimator.ofInt(0, 255);
inAnim = ValueAnimator.ofInt(0, Color.alpha(endColor));
inAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int currAlpha = (Integer) animation.getAnimatedValue();
view.setTextColor(currAlpha << 24 | Color.red(endColor) << 16 |
Color.green(endColor) << 8 | Color.red(endColor));
view.setTextColor(currAlpha << 24 | endColor & 0xffffff);
}
});
inAnim.addListener(new AnimatorListenerAdapter() {