From f5be53d08a913954f9cb8de1825c0770aeb17b6e Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 20 Jul 2019 12:14:33 +0200 Subject: [PATCH] jump into last field after re-enable pin entry --- .../siacs/conversations/ui/util/PinEntryWrapper.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/quicksy/java/eu/siacs/conversations/ui/util/PinEntryWrapper.java b/src/quicksy/java/eu/siacs/conversations/ui/util/PinEntryWrapper.java index 17da72798..8e91f659d 100644 --- a/src/quicksy/java/eu/siacs/conversations/ui/util/PinEntryWrapper.java +++ b/src/quicksy/java/eu/siacs/conversations/ui/util/PinEntryWrapper.java @@ -119,13 +119,19 @@ public class PinEntryWrapper { } } - public void setEnabled(boolean enabled) { - for(EditText digit : digits) { + public void setEnabled(final boolean enabled) { + for (EditText digit : digits) { digit.setEnabled(enabled); digit.setCursorVisible(enabled); digit.setFocusable(enabled); digit.setFocusableInTouchMode(enabled); } + if (enabled) { + final EditText last = digits.get(digits.size() - 1); + if (last.getEditableText().length() > 0) { + last.requestFocus(); + } + } } public boolean isEmpty() {