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

Commit bc96f7fd authored by Ahaan Ugale's avatar Ahaan Ugale Committed by Automerger Merge Worker
Browse files

Merge "Fix DynamicLayout init to use transformed text length." into sc-dev am: fb51ab66

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13439179

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ieb00160a7611cd593bd95f04c6078160bb76940f
parents 055c55a2 fb51ab66
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -475,9 +475,8 @@ public class DynamicLayout extends Layout {

        mObjects.insertAt(0, dirs);

        final int baseLength = mBase.length();
        // Update from 0 characters to whatever the real text is
        reflow(mBase, 0, 0, baseLength);
        // Update from 0 characters to whatever the displayed text is
        reflow(mBase, 0, 0, mDisplay.length());

        if (mBase instanceof Spannable) {
            if (mWatcher == null)
@@ -485,6 +484,7 @@ public class DynamicLayout extends Layout {

            // Strip out any watchers for other DynamicLayouts.
            final Spannable sp = (Spannable) mBase;
            final int baseLength = mBase.length();
            final ChangeWatcher[] spans = sp.getSpans(0, baseLength, ChangeWatcher.class);
            for (int i = 0; i < spans.length; i++) {
                sp.removeSpan(spans[i]);