Skip to content

Commit

Permalink
feat: passcode not focusable to keep the same behaviour between custo…
Browse files Browse the repository at this point in the history
…m keyboard and external keyboard
  • Loading branch information
Aitorbp committed Sep 18, 2024
1 parent 4d14f3a commit cfb5229
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
3 changes: 2 additions & 1 deletion owncloudApp/src/main/res/layout/passcode_edit_text.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
style="@style/PassCodeStyle"
android:cursorVisible="true"
android:layout_width="32dp"
android:imeOptions="flagNoExtractUi"/>
android:imeOptions="flagNoExtractUi"
android:focusable="false"/>

0 comments on commit cfb5229

Please sign in to comment.