diff --git a/CHANGELOG.md b/CHANGELOG.md index fbec3fac663..6c07627831e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ ownCloud admins and users. * Enhancement - Changed the color of some elements to improve accessibility: [#4364](https://github.com/owncloud/android/issues/4364) * Enhancement - Improved SearchView accessibility: [#4365](https://github.com/owncloud/android/issues/4365) * Enhancement - Hardware keyboard support: [#4438](https://github.com/owncloud/android/pull/4438) +* Enhancement - Hardware keyboard support for passcode view: [#4447](https://github.com/owncloud/android/issues/4447) ## Details @@ -99,6 +100,13 @@ ownCloud admins and users. https://github.com/owncloud/android/issues/4368 https://github.com/owncloud/android/pull/4438 +* Enhancement - Hardware keyboard support for passcode view: [#4447](https://github.com/owncloud/android/issues/4447) + + Navigation via hardware keyboard has been added to the passcode view. + + https://github.com/owncloud/android/issues/4447 + https://github.com/owncloud/android/pull/4455 + # Changelog for ownCloud Android Client [4.3.1] (2024-07-22) The following sections list the changes in ownCloud Android Client 4.3.1 relevant to diff --git a/changelog/unreleased/4455 b/changelog/unreleased/4455 new file mode 100644 index 00000000000..397188ea260 --- /dev/null +++ b/changelog/unreleased/4455 @@ -0,0 +1,6 @@ +Enhancement: Hardware keyboard support for passcode view + +Navigation via hardware keyboard has been added to the passcode view. + +https://github.com/owncloud/android/issues/4447 +https://github.com/owncloud/android/pull/4455 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 8e9a37c4632..01d3a1ce634 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 @@ -9,8 +9,10 @@ * @author Abel García de Prada * @author Juan Carlos Garrote Gascón * @author David Crespo Ríos + * @author Aitor Ballesteros Pavón + * * Copyright (C) 2011 Bartek Przybylski - * Copyright (C) 2021 ownCloud GmbH. + * 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,
@@ -118,6 +120,7 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
binding.explanation.visibility = View.INVISIBLE
supportActionBar?.setDisplayHomeAsUpEnabled(false) //Don´t show the back arrow
}
+
ACTION_CREATE -> { //Create a new password
if (confirmingPassCode) {
//the app was in the passcode confirmation
@@ -136,15 +139,18 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
intent.extras?.getBoolean(EXTRAS_MIGRATION) == true -> {
supportActionBar?.setDisplayHomeAsUpEnabled(false)
}
+
intent.extras?.getBoolean(EXTRAS_LOCK_ENFORCED) == true -> {
supportActionBar?.setDisplayHomeAsUpEnabled(false)
}
+
else -> {
supportActionBar?.setDisplayHomeAsUpEnabled(true)
}
}
}
}
+
ACTION_REMOVE -> { // Remove password
// pass code preference has just been disabled in Preferences;
// will confirm user knows pass code, then remove it
@@ -152,6 +158,7 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
binding.explanation.visibility = View.INVISIBLE
supportActionBar?.setDisplayHomeAsUpEnabled(true)
}
+
else -> {
throw IllegalArgumentException(R.string.illegal_argument_exception_message.toString() + " ")
}
@@ -231,12 +238,14 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
else -> actionCheckError()
}
}
+
PasscodeAction.REMOVE -> {
when (status.type) {
PasscodeType.OK -> actionRemoveOk()
else -> actionRemoveError()
}
}
+
PasscodeAction.CREATE -> {
when (status.type) {
PasscodeType.NO_CONFIRM -> actionCreateNoConfirm()
@@ -421,6 +430,7 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
BiometricStatus.ENABLED_BY_USER -> {
passCodeViewModel.setBiometricsState(enabled = true)
}
+
BiometricStatus.DISABLED_BY_USER -> {
passCodeViewModel.setBiometricsState(enabled = false)
}
@@ -434,15 +444,52 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
ACTION_REMOVE -> {
return PasscodeAction.REMOVE
}
+
ACTION_CREATE -> {
return PasscodeAction.CREATE
}
+
else -> {
return PasscodeAction.CHECK
}
}
}
+ override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean {
+ return when (keyCode) {
+ KeyEvent.KEYCODE_TAB -> {
+ findViewById