jump into last field after re-enable pin entry

This commit is contained in:
Daniel Gultsch 2019-07-20 12:14:33 +02:00
parent 3837ec8122
commit f5be53d08a
1 changed files with 8 additions and 2 deletions

View File

@ -119,13 +119,19 @@ public class PinEntryWrapper {
} }
} }
public void setEnabled(boolean enabled) { public void setEnabled(final boolean enabled) {
for (EditText digit : digits) { for (EditText digit : digits) {
digit.setEnabled(enabled); digit.setEnabled(enabled);
digit.setCursorVisible(enabled); digit.setCursorVisible(enabled);
digit.setFocusable(enabled); digit.setFocusable(enabled);
digit.setFocusableInTouchMode(enabled); digit.setFocusableInTouchMode(enabled);
} }
if (enabled) {
final EditText last = digits.get(digits.size() - 1);
if (last.getEditableText().length() > 0) {
last.requestFocus();
}
}
} }
public boolean isEmpty() { public boolean isEmpty() {