#291 enhance focus flow in dialog's using TAB key in hardware keyboards
This commit is contained in:
parent
8d198dafe4
commit
88f17d610f
@ -46,6 +46,11 @@ class ChangePasswordDialog : BaseProgressErrorDialog<ChangePasswordDialog.Callba
|
|||||||
}
|
}
|
||||||
dialog.setCanceledOnTouchOutside(false)
|
dialog.setCanceledOnTouchOutside(false)
|
||||||
et_old_password.requestFocus()
|
et_old_password.requestFocus()
|
||||||
|
et_old_password.nextFocusForwardId = et_new_password.id
|
||||||
|
et_new_password.nextFocusForwardId = et_new_retype_password.id
|
||||||
|
changePasswordButton?.let { button ->
|
||||||
|
et_new_retype_password.nextFocusForwardId = button.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,9 @@ class CloudNodeRenameDialog : BaseProgressErrorDialog<CloudNodeRenameDialog.Call
|
|||||||
}
|
}
|
||||||
dialog.setCanceledOnTouchOutside(false)
|
dialog.setCanceledOnTouchOutside(false)
|
||||||
et_rename.requestFocus()
|
et_rename.requestFocus()
|
||||||
|
renameConfirmButton?.let { button ->
|
||||||
|
et_rename.nextFocusForwardId = button.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,9 @@ class CreateFolderDialog : BaseProgressErrorDialog<CreateFolderDialog.Callback>(
|
|||||||
}
|
}
|
||||||
dialog.setCanceledOnTouchOutside(false)
|
dialog.setCanceledOnTouchOutside(false)
|
||||||
et_folder_name.requestFocus()
|
et_folder_name.requestFocus()
|
||||||
|
createFolderButton?.let { button ->
|
||||||
|
et_folder_name.nextFocusForwardId = button.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,9 @@ class EnterPasswordDialog : BaseProgressErrorDialog<EnterPasswordDialog.Callback
|
|||||||
onWaitForResponse(et_password)
|
onWaitForResponse(et_password)
|
||||||
dialog.getButton(android.app.Dialog.BUTTON_NEGATIVE)?.isEnabled = true
|
dialog.getButton(android.app.Dialog.BUTTON_NEGATIVE)?.isEnabled = true
|
||||||
}
|
}
|
||||||
|
unlockButton?.let { button ->
|
||||||
|
et_password.nextFocusForwardId = button.id
|
||||||
|
}
|
||||||
it.setCanceledOnTouchOutside(false)
|
it.setCanceledOnTouchOutside(false)
|
||||||
et_password.requestFocus()
|
et_password.requestFocus()
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,9 @@ class FileNameDialog : BaseProgressErrorDialog<FileNameDialog.Callback>() {
|
|||||||
}
|
}
|
||||||
dialog.setCanceledOnTouchOutside(false)
|
dialog.setCanceledOnTouchOutside(false)
|
||||||
file_name.requestFocus()
|
file_name.requestFocus()
|
||||||
|
createFileButton?.let { button ->
|
||||||
|
file_name.nextFocusForwardId = button.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,14 +23,17 @@ class UpdateLicenseDialog : BaseProgressErrorDialog<UpdateLicenseDialog.Callback
|
|||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
|
allowClosingDialog(false)
|
||||||
val dialog = dialog as AlertDialog?
|
val dialog = dialog as AlertDialog?
|
||||||
if (dialog != null) {
|
dialog?.let {
|
||||||
checkLicenseButton = dialog.getButton(android.app.Dialog.BUTTON_POSITIVE)
|
checkLicenseButton = dialog.getButton(android.app.Dialog.BUTTON_POSITIVE)
|
||||||
checkLicenseButton?.setOnClickListener {
|
checkLicenseButton?.setOnClickListener {
|
||||||
callback?.checkLicenseClicked(et_license.text.toString())
|
callback?.checkLicenseClicked(et_license.text.toString())
|
||||||
onWaitForResponse(et_license)
|
onWaitForResponse(et_license)
|
||||||
}
|
}
|
||||||
dialog.setCanceledOnTouchOutside(false)
|
checkLicenseButton?.let { button ->
|
||||||
|
et_license.nextFocusForwardId = button.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +42,6 @@ class UpdateLicenseDialog : BaseProgressErrorDialog<UpdateLicenseDialog.Callback
|
|||||||
.setTitle(getString(R.string.dialog_enter_license_title)) //
|
.setTitle(getString(R.string.dialog_enter_license_title)) //
|
||||||
.setPositiveButton(getText(R.string.dialog_enter_license_ok_button)) { _: DialogInterface, _: Int -> } //
|
.setPositiveButton(getText(R.string.dialog_enter_license_ok_button)) { _: DialogInterface, _: Int -> } //
|
||||||
.setNegativeButton(getText(R.string.dialog_enter_license_decline_button)) { _: DialogInterface, _: Int -> callback?.onCheckLicenseCanceled() } //
|
.setNegativeButton(getText(R.string.dialog_enter_license_decline_button)) { _: DialogInterface, _: Int -> callback?.onCheckLicenseCanceled() } //
|
||||||
.setCancelable(false) //
|
|
||||||
.create()
|
.create()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,9 @@ class VaultRenameDialog : BaseProgressErrorDialog<VaultRenameDialog.Callback>()
|
|||||||
}
|
}
|
||||||
dialog.setCanceledOnTouchOutside(false)
|
dialog.setCanceledOnTouchOutside(false)
|
||||||
et_rename.requestFocus()
|
et_rename.requestFocus()
|
||||||
|
renameConfirmButton?.let { button ->
|
||||||
|
et_rename.nextFocusForwardId = button.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
package org.cryptomator.presentation.ui.fragment
|
|
||||||
|
|
||||||
import android.os.Bundle
|
|
||||||
import androidx.preference.PreferenceFragmentCompat
|
|
||||||
import org.cryptomator.presentation.R
|
|
||||||
|
|
||||||
class LicensesFragment : PreferenceFragmentCompat() {
|
|
||||||
|
|
||||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
|
||||||
addPreferencesFromResource(R.xml.licenses)
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user