mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Move the cursor to the end of the text in edit text.
Before fix: https://b.corp.google.com/issues/301625831#comment9 After fix: https://b.corp.google.com/issues/301625831#comment10 Bug: 301625831 Test: Manual Flag: NA, Fixing for hardware keyboard. Change-Id: I817836a0a76b8677eb65c65720f436882fe6431f
This commit is contained in:
@@ -153,6 +153,15 @@ public class ExtendedEditText extends EditText {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(CharSequence text, BufferType type) {
|
||||
super.setText(text, type);
|
||||
// With hardware keyboard, there is a possibility that the user types before edit
|
||||
// text is visible during the transition.
|
||||
// So move the cursor to the end of the text.
|
||||
setSelection(getText().length());
|
||||
}
|
||||
|
||||
/**
|
||||
* This method should be preferred to {@link #setOnFocusChangeListener(OnFocusChangeListener)},
|
||||
* as it allows for multiple listeners from different sources.
|
||||
|
||||
Reference in New Issue
Block a user