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

Commit 453f2a60 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Move cursor to end of text when autofilling." into oc-mr1-dev

am: de499f46

Change-Id: Ic1ededd2eb3ba4827d8efcd170a3f20ffb9f6aa3
parents be2a20c4 de499f46
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -10320,7 +10320,16 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            return;
        }

        setText(value.getTextValue(), mBufferType, true, 0);
        final CharSequence autofilledValue = value.getTextValue();

        // First autofill it...
        setText(autofilledValue, mBufferType, true, 0);

        // ...then move cursor to the end.
        final CharSequence text = getText();
        if ((text instanceof Spannable)) {
            Selection.setSelection((Spannable) text, text.length());
        }
    }

    @Override