From 8960210bb07fcfc86036c22c0ed470e3d49d6b40 Mon Sep 17 00:00:00 2001 From: Caleb Derosier <125901828+caleb-livefront@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:02:45 -0600 Subject: [PATCH] BIT-2103: Sync show/hide file password fields on Vault Export screen (#1205) --- .../feature/settings/exportvault/ExportVaultScreen.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/exportvault/ExportVaultScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/exportvault/ExportVaultScreen.kt index 0c45742f8..dd8e486d3 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/exportvault/ExportVaultScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/exportvault/ExportVaultScreen.kt @@ -20,6 +20,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -236,10 +237,13 @@ private fun ExportVaultScreenContent( Spacer(modifier = Modifier.height(8.dp)) if (state.exportFormat == ExportVaultFormat.JSON_ENCRYPTED) { + var showPassword by rememberSaveable { mutableStateOf(false) } BitwardenPasswordField( label = stringResource(id = R.string.file_password), value = state.filePasswordInput, onValueChange = onFilePasswordInputChanged, + showPassword = showPassword, + showPasswordChange = { showPassword = it }, hint = stringResource(id = R.string.password_used_to_export), modifier = Modifier .semantics { testTag = "FilePasswordEntry" } @@ -258,6 +262,8 @@ private fun ExportVaultScreenContent( label = stringResource(id = R.string.confirm_file_password), value = state.confirmFilePasswordInput, onValueChange = onConfirmFilePasswordInputChanged, + showPassword = showPassword, + showPasswordChange = { showPassword = it }, modifier = Modifier .semantics { testTag = "ConfirmFilePasswordEntry" } .padding(horizontal = 16.dp)