diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordgenerator/MasterPasswordGeneratorScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordgenerator/MasterPasswordGeneratorScreen.kt index f615be4ba36..f29e42eea37 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordgenerator/MasterPasswordGeneratorScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordgenerator/MasterPasswordGeneratorScreen.kt @@ -141,7 +141,7 @@ private fun MasterPasswordGeneratorContent( ) { Spacer(modifier = Modifier.height(height = 12.dp)) BitwardenTextField( - label = "", + label = null, value = generatedPassword, onValueChange = {}, readOnly = true, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenHiddenPasswordField.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenHiddenPasswordField.kt index 83baf9fb5ba..3c793315428 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenHiddenPasswordField.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenHiddenPasswordField.kt @@ -28,7 +28,7 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme */ @Composable fun BitwardenHiddenPasswordField( - label: String, + label: String?, value: String, modifier: Modifier = Modifier, cardStyle: CardStyle? = null, @@ -39,7 +39,7 @@ fun BitwardenHiddenPasswordField( .cardBackground(cardStyle = cardStyle) .cardPadding(cardStyle = cardStyle, vertical = 6.dp), textStyle = BitwardenTheme.typography.sensitiveInfoSmall, - label = { Text(text = label) }, + label = label?.let { { Text(text = it) } }, value = value, onValueChange = { }, visualTransformation = PasswordVisualTransformation(), diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordField.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordField.kt index 0be8b515fde..84c80a5f9b8 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordField.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordField.kt @@ -76,10 +76,10 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme * @param textToolbarType The type of [TextToolbar] to use on the text field. * @param cardStyle Indicates the type of card style to be applied. */ -@Suppress("LongMethod") +@Suppress("LongMethod", "CyclomaticComplexMethod") @Composable fun BitwardenPasswordField( - label: String, + label: String?, value: String, showPassword: Boolean, showPasswordChange: (Boolean) -> Unit, @@ -129,7 +129,7 @@ fun BitwardenPasswordField( TextField( colors = bitwardenTextFieldColors(), textStyle = BitwardenTheme.typography.sensitiveInfoSmall, - label = { Text(text = label) }, + label = label?.let { { Text(text = it) } }, value = textFieldValue, onValueChange = { textFieldValueState = it @@ -215,7 +215,7 @@ fun BitwardenPasswordField( */ @Composable fun BitwardenPasswordField( - label: String, + label: String?, value: String, showPassword: Boolean, showPasswordChange: (Boolean) -> Unit, @@ -289,7 +289,7 @@ fun BitwardenPasswordField( */ @Composable fun BitwardenPasswordField( - label: String, + label: String?, value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, @@ -351,7 +351,7 @@ fun BitwardenPasswordField( */ @Composable fun BitwardenPasswordField( - label: String, + label: String?, value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordFieldWithActions.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordFieldWithActions.kt index 32fa99bea13..dd7fff7db80 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordFieldWithActions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordFieldWithActions.kt @@ -59,7 +59,7 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme */ @Composable fun BitwardenPasswordFieldWithActions( - label: String, + label: String?, value: String, showPassword: Boolean, showPasswordChange: (Boolean) -> Unit, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/stepper/BitwardenStepper.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/stepper/BitwardenStepper.kt index 9c103f1616a..2f1d8d1ea14 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/stepper/BitwardenStepper.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/stepper/BitwardenStepper.kt @@ -44,7 +44,7 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme */ @Composable fun BitwardenStepper( - label: String, + label: String?, value: Int?, onValueChange: (Int) -> Unit, modifier: Modifier = Modifier, @@ -101,7 +101,7 @@ fun BitwardenStepper( @Suppress("LongMethod", "CyclomaticComplexMethod") @Composable fun BitwardenStepper( - label: String, + label: String?, value: Int?, onValueChange: (Int) -> Unit, modifier: Modifier = Modifier, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorScreen.kt index 08293c8fd69..656d7d55ae2 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorScreen.kt @@ -1017,7 +1017,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent( null -> { var obfuscatedTextField by remember { mutableStateOf("") } BitwardenPasswordField( - label = "", + label = null, value = obfuscatedTextField, onValueChange = { obfuscatedTextField = it }, showPasswordTestTag = "ShowForwardedEmailApiSecretButton",