diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/security/passcode/NumberKeyboard.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/security/passcode/NumberKeyboard.kt index 2eccf141b29..2bc3f26a1f4 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/security/passcode/NumberKeyboard.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/security/passcode/NumberKeyboard.kt @@ -2,7 +2,9 @@ * ownCloud Android client application * * @author David Crespo Ríos - * Copyright (C) 2022 ownCloud GmbH. + * @author Aitor Ballesteros Pavón + * + * Copyright (C) 2024 ownCloud GmbH. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -71,6 +73,12 @@ class NumberKeyboard(context: Context, attrs: AttributeSet) : ConstraintLayout(c setupListeners() } + fun setFocusOnKey(number: Int) { + if (number in 0..9) { + numericKeys[number].requestFocus() + } + } + /** * Setup on click listeners. */ diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/security/passcode/PassCodeActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/security/passcode/PassCodeActivity.kt index af283a0baff..4283ad96823 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/security/passcode/PassCodeActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/security/passcode/PassCodeActivity.kt @@ -478,6 +478,7 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom in KeyEvent.KEYCODE_0..KeyEvent.KEYCODE_9 -> { val number = keyCode - KeyEvent.KEYCODE_0 passCodeViewModel.onNumberClicked(number) + binding.numberKeyboard.setFocusOnKey(number) true } diff --git a/owncloudApp/src/main/res/layout/passcode_edit_text.xml b/owncloudApp/src/main/res/layout/passcode_edit_text.xml index 5c32371030a..d8b0c04b784 100644 --- a/owncloudApp/src/main/res/layout/passcode_edit_text.xml +++ b/owncloudApp/src/main/res/layout/passcode_edit_text.xml @@ -5,4 +5,5 @@ style="@style/PassCodeStyle" android:cursorVisible="true" android:layout_width="32dp" - android:imeOptions="flagNoExtractUi"/> \ No newline at end of file + android:imeOptions="flagNoExtractUi" + android:focusable="false"/> \ No newline at end of file