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

Commit fb51ab66 authored by Ahaan Ugale's avatar Ahaan Ugale Committed by Android (Google) Code Review
Browse files

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

parents 60cdb18a ed6a3111
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]);