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

Commit e1e0dc8e authored by Romain Guy's avatar Romain Guy
Browse files

Make sure we relayout the TextView when the text changes and marquee is enabled.

Bug #2192881.

Change-Id: Iffc2d15947a11974d9dc175740e3a5489cd43d21
parent decc139b
Loading
Loading
Loading
Loading
+18 −16
Original line number Diff line number Diff line
@@ -3964,8 +3964,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    mHighlightPath = new Path();

                if (selStart == selEnd) {
                    if ((SystemClock.uptimeMillis() - mShowCursor) % (2 * BLINK)
                        < BLINK) {
                    if ((SystemClock.uptimeMillis() - mShowCursor) % (2 * BLINK) < BLINK) {
                        if (mHighlightPathBogus) {
                            mHighlightPath.reset();
                            mLayout.getCursorPath(selStart, mHighlightPath, mText);
@@ -5344,8 +5343,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
             * will happen at measure).
             */
            makeNewLayout(want, hintWant, UNKNOWN_BORING, UNKNOWN_BORING,
                          mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight(), false);
                          mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight(),
                          false);

            if (mEllipsize != TextUtils.TruncateAt.MARQUEE) {
                // In a fixed-height view, so use our new text layout.
                if (mLayoutParams.height != LayoutParams.WRAP_CONTENT &&
                    mLayoutParams.height != LayoutParams.FILL_PARENT) {
@@ -5360,6 +5361,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    invalidate();
                    return;
                }
            }

            // We lose: the height has changed and we have a dynamic height.
            // Request a new view layout using our new text layout.