Add autofill support to tracker login dialog and update processing text (#2069)

(cherry picked from commit 7deeabe844d41d2b5e918ad747ddd548163c9fe3)

# Conflicts:
#	CHANGELOG.md
This commit is contained in:
AntsyLich 2025-05-05 01:36:37 +06:00 committed by Jobobby04
parent b6e5943e15
commit 211d090a2d
2 changed files with 11 additions and 3 deletions

View File

@ -30,8 +30,11 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.autofill.ContentType
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.semantics.contentType
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
@ -228,7 +231,9 @@ object SettingsTrackingScreen : SearchableSettings {
text = {
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
OutlinedTextField(
modifier = Modifier.fillMaxWidth(),
modifier = Modifier
.fillMaxWidth()
.semantics { contentType = ContentType.Username + ContentType.EmailAddress },
value = username,
onValueChange = { username = it },
label = { Text(text = stringResource(uNameStringRes)) },
@ -239,7 +244,9 @@ object SettingsTrackingScreen : SearchableSettings {
var hidePassword by remember { mutableStateOf(true) }
OutlinedTextField(
modifier = Modifier.fillMaxWidth(),
modifier = Modifier
.fillMaxWidth()
.semantics { contentType = ContentType.Password },
value = password,
onValueChange = { password = it },
label = { Text(text = stringResource(MR.strings.password)) },
@ -288,7 +295,7 @@ object SettingsTrackingScreen : SearchableSettings {
}
},
) {
val id = if (processing) MR.strings.loading else MR.strings.login
val id = if (processing) MR.strings.logging_in else MR.strings.login
Text(text = stringResource(id))
}
},

View File

@ -658,6 +658,7 @@
<string name="email">Email address</string>
<string name="password">Password</string>
<string name="login">Login</string>
<string name="logging_in">Logging in…</string>
<string name="login_success">Logged in</string>
<string name="logout_title">Log out from %1$s?</string>
<string name="logout">Log out</string>