Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbeafd11 authored by Doris Liu's avatar Doris Liu
Browse files

Fix blue channel gets updated incorrectly in ChangeText transition

Also fixed text's alpha channel gets incorrectly reset to fully
opaque.

Bug: 28919053
Bug: 28932357
Change-Id: Ib0ae6fe56ba4e09dea69534868e764e65e888e62
parent 2a86e67c
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -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() {