From 31186607de69f2a0418b27fe5c2c29d2ebcf9bed Mon Sep 17 00:00:00 2001 From: Artem Chepurnoy Date: Sat, 22 Jun 2024 13:37:33 +0300 Subject: [PATCH] fix: Do not dynamically change between ime actions #434 --- .../artemchep/keyguard/android/PasskeyGetActivity.kt | 5 +---- .../keyguard/feature/apppicker/AppPickerScreen.kt | 1 - .../keyguard/feature/auth/login/LoginScreen.kt | 6 ++---- .../feature/auth/login/otp/LoginTwofaScreen.kt | 10 ++-------- .../elevatedaccess/ElevatedAccessScreen.kt | 5 +---- .../feature/filter/list/CipherFiltersListScreen.kt | 1 - .../generator/wordlist/view/WordlistViewScreen.kt | 1 - .../home/settings/search/SearchSettingsScreen.kt | 1 - .../feature/home/vault/component/SearchTextField.kt | 8 +------- .../directory/JustDeleteMeServiceListScreen.kt | 1 - .../justgetdata/directory/JustGetMyDataListScreen.kt | 1 - .../keyguard/feature/keyguard/setup/SetupScreen.kt | 5 +---- .../keyguard/feature/keyguard/unlock/UnlockScreen.kt | 5 +---- .../passkeys/directory/PasskeysServiceListScreen.kt | 1 - .../feature/tfa/directory/TwoFaServiceListScreen.kt | 1 - .../keyguard/ui/toolbar/content/ContentSearchbar.kt | 1 - 16 files changed, 9 insertions(+), 44 deletions(-) diff --git a/common/src/androidMain/kotlin/com/artemchep/keyguard/android/PasskeyGetActivity.kt b/common/src/androidMain/kotlin/com/artemchep/keyguard/android/PasskeyGetActivity.kt index c33ebbae..830b7302 100644 --- a/common/src/androidMain/kotlin/com/artemchep/keyguard/android/PasskeyGetActivity.kt +++ b/common/src/androidMain/kotlin/com/artemchep/keyguard/android/PasskeyGetActivity.kt @@ -446,10 +446,7 @@ fun UserVerificationScreen( testTag = "field:password", value = content.password, keyboardOptions = KeyboardOptions( - imeAction = when { - keyboardOnGo != null -> ImeAction.Go - else -> ImeAction.Default - }, + imeAction = ImeAction.Go, ), keyboardActions = KeyboardActions( onGo = keyboardOnGo, diff --git a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerScreen.kt b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerScreen.kt index c0f009d5..06f2a03e 100644 --- a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerScreen.kt +++ b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerScreen.kt @@ -175,7 +175,6 @@ fun ChangePasswordScreen( leading = {}, trailing = {}, onTextChange = query?.onChange, - onGoClick = null, ) } } diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/auth/login/LoginScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/auth/login/LoginScreen.kt index c87f83aa..5c442375 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/auth/login/LoginScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/auth/login/LoginScreen.kt @@ -332,8 +332,7 @@ fun LoginContent( keyboardOptions = KeyboardOptions( imeAction = when { !passwordIsLastField -> ImeAction.Next - keyboardOnGo != null -> ImeAction.Go - else -> ImeAction.Default + else -> ImeAction.Go }, ), keyboardActions = KeyboardActions( @@ -363,8 +362,7 @@ fun LoginContent( keyboardOptions = KeyboardOptions( imeAction = when { !clientSecretIsLastField -> ImeAction.Next - keyboardOnGo != null -> ImeAction.Go - else -> ImeAction.Default + else -> ImeAction.Go }, ), keyboardActions = KeyboardActions( diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/auth/login/otp/LoginTwofaScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/auth/login/otp/LoginTwofaScreen.kt index d6db14ea..1c187bfc 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/auth/login/otp/LoginTwofaScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/auth/login/otp/LoginTwofaScreen.kt @@ -418,10 +418,7 @@ private fun ColumnScope.LoginOtpScreenContentAuthenticator( keyboardOptions = KeyboardOptions( autoCorrect = false, keyboardType = KeyboardType.Number, - imeAction = when { - keyboardOnGo != null -> ImeAction.Go - else -> ImeAction.Default - }, + imeAction = ImeAction.Go, ), keyboardActions = KeyboardActions( onGo = keyboardOnGo, @@ -493,10 +490,7 @@ private fun ColumnScope.LoginOtpScreenContentEmail( keyboardOptions = KeyboardOptions( autoCorrect = false, keyboardType = KeyboardType.Number, - imeAction = when { - keyboardOnGo != null -> ImeAction.Go - else -> ImeAction.Default - }, + imeAction = ImeAction.Go, ), keyboardActions = KeyboardActions( onGo = keyboardOnGo, diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/confirmation/elevatedaccess/ElevatedAccessScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/confirmation/elevatedaccess/ElevatedAccessScreen.kt index 7cbf75d7..a4de1bb2 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/confirmation/elevatedaccess/ElevatedAccessScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/confirmation/elevatedaccess/ElevatedAccessScreen.kt @@ -162,10 +162,7 @@ private fun ColumnScope.ElevatedAccessContent( testTag = "field:password", value = content.password, keyboardOptions = KeyboardOptions( - imeAction = when { - keyboardOnGo != null -> ImeAction.Go - else -> ImeAction.Default - }, + imeAction = ImeAction.Go, ), keyboardActions = KeyboardActions( onGo = keyboardOnGo, diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/filter/list/CipherFiltersListScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/filter/list/CipherFiltersListScreen.kt index ef1da139..57cfc480 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/filter/list/CipherFiltersListScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/filter/list/CipherFiltersListScreen.kt @@ -175,7 +175,6 @@ fun CipherFiltersListScreen( leading = {}, trailing = {}, onTextChange = query?.onChange, - onGoClick = null, ) } } diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/generator/wordlist/view/WordlistViewScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/generator/wordlist/view/WordlistViewScreen.kt index 2451f697..0d62da89 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/generator/wordlist/view/WordlistViewScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/generator/wordlist/view/WordlistViewScreen.kt @@ -199,7 +199,6 @@ fun WordlistViewScreen( leading = {}, trailing = {}, onTextChange = query?.onChange, - onGoClick = null, ) } } diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/search/SearchSettingsScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/search/SearchSettingsScreen.kt index a42e8066..ec9d3a90 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/search/SearchSettingsScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/search/SearchSettingsScreen.kt @@ -121,7 +121,6 @@ fun SearchSettingsScreenContent( leading = {}, trailing = {}, onTextChange = state.query.onChange, - onGoClick = null, ) } } diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/vault/component/SearchTextField.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/vault/component/SearchTextField.kt index ba542bbe..c7617324 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/vault/component/SearchTextField.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/vault/component/SearchTextField.kt @@ -62,7 +62,6 @@ fun SearchTextField( leading: @Composable () -> Unit, trailing: @Composable () -> Unit, onTextChange: ((String) -> Unit)?, - onGoClick: (() -> Unit)?, ) { val interactionSource = remember { MutableInteractionSource() @@ -143,14 +142,9 @@ fun SearchTextField( }, keyboardOptions = KeyboardOptions( keyboardType = KeyboardType.Text, - imeAction = if (onGoClick != null) ImeAction.Go else ImeAction.Done, + imeAction = ImeAction.Done, autoCorrect = false, ), - keyboardActions = KeyboardActions( - onGo = { - onGoClick?.invoke() - }, - ), singleLine = true, ) if (count != null) { diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/justdeleteme/directory/JustDeleteMeServiceListScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/justdeleteme/directory/JustDeleteMeServiceListScreen.kt index 247d9bc1..7bf2d8a4 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/justdeleteme/directory/JustDeleteMeServiceListScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/justdeleteme/directory/JustDeleteMeServiceListScreen.kt @@ -173,7 +173,6 @@ fun JustDeleteMeListScreen( leading = {}, trailing = {}, onTextChange = query?.onChange, - onGoClick = null, ) } } diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/justgetdata/directory/JustGetMyDataListScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/justgetdata/directory/JustGetMyDataListScreen.kt index f3cee381..14259aaa 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/justgetdata/directory/JustGetMyDataListScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/justgetdata/directory/JustGetMyDataListScreen.kt @@ -174,7 +174,6 @@ fun JustGetMyDataListScreen( leading = {}, trailing = {}, onTextChange = query?.onChange, - onGoClick = null, ) } } diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/keyguard/setup/SetupScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/keyguard/setup/SetupScreen.kt index 3c716a6c..907cf6b2 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/keyguard/setup/SetupScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/keyguard/setup/SetupScreen.kt @@ -186,10 +186,7 @@ fun ColumnScope.SetupContent( label = stringResource(Res.string.setup_field_app_password_label), value = setupState.password, keyboardOptions = KeyboardOptions( - imeAction = when { - keyboardOnGo != null -> ImeAction.Go - else -> ImeAction.Default - }, + imeAction = ImeAction.Go, ), keyboardActions = KeyboardActions( onGo = keyboardOnGo, diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/keyguard/unlock/UnlockScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/keyguard/unlock/UnlockScreen.kt index 20d3c325..6ca3ea1a 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/keyguard/unlock/UnlockScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/keyguard/unlock/UnlockScreen.kt @@ -176,10 +176,7 @@ private fun UnlockScreen( testTag = "field:password", value = unlockState.password, keyboardOptions = KeyboardOptions( - imeAction = when { - keyboardOnGo != null -> ImeAction.Go - else -> ImeAction.Default - }, + imeAction = ImeAction.Go, ), keyboardActions = KeyboardActions( onGo = keyboardOnGo, diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/passkeys/directory/PasskeysServiceListScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/passkeys/directory/PasskeysServiceListScreen.kt index 663afef7..2a914ace 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/passkeys/directory/PasskeysServiceListScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/passkeys/directory/PasskeysServiceListScreen.kt @@ -171,7 +171,6 @@ fun PasskeysListScreen( leading = {}, trailing = {}, onTextChange = query?.onChange, - onGoClick = null, ) } } diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/tfa/directory/TwoFaServiceListScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/tfa/directory/TwoFaServiceListScreen.kt index fad7e0a3..2f34fb12 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/tfa/directory/TwoFaServiceListScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/tfa/directory/TwoFaServiceListScreen.kt @@ -171,7 +171,6 @@ fun TwoFaServiceListScreen( leading = {}, trailing = {}, onTextChange = query?.onChange, - onGoClick = null, ) } } diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/ui/toolbar/content/ContentSearchbar.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/ui/toolbar/content/ContentSearchbar.kt index c9953fb3..47b8271e 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/ui/toolbar/content/ContentSearchbar.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/ui/toolbar/content/ContentSearchbar.kt @@ -49,7 +49,6 @@ fun CustomSearchbarContent( } }, onTextChange = searchFieldModel.onChange, - onGoClick = null, ) } }