ferdialif02
10/28/2024, 10:36 PMAndrei Salavei
10/29/2024, 8:41 AMferdialif02
11/04/2024, 10:57 AMBasicSecureTextField(
state = password,
modifier = Modifier
.fillMaxWidth(loginConfiguration.basicTextFieldWidth)
.height(30.dp)
.offset {
loginConfiguration.basicTextFieldOffset
}
.clip(CircleShape)
.border(
0.3.dp,
Color.White.copy(0.4F),
shape = CircleShape
),
cursorBrush = SolidColor(Color.White),
decorator = {
Box(modifier = Modifier.fillMaxWidth()) {
Row(modifier = Modifier.fillMaxWidth(0.9F)) {
Card(
modifier = Modifier
.fillMaxHeight()
.width(40.dp),
colors = CardDefaults.cardColors(
containerColor = passwordCardColor
),
shape = CircleShape
) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Icon(
imageVector = Icons.Outlined.Lock,
contentDescription = null,
tint = Color.White
)
}
}
TextFieldDefaults.DecorationBox(
value = password.toString(),
innerTextField = it,
enabled = true,
singleLine = true,
visualTransformation = PasswordVisualTransformation(),
interactionSource = remember {
MutableInteractionSource()
},
contentPadding = PaddingValues(horizontal = 12.dp),
colors = TextFieldDefaults.colors(
unfocusedIndicatorColor = Color.Transparent,
focusedIndicatorColor = Color.Transparent,
focusedContainerColor = Color.Transparent,
unfocusedContainerColor = Color.Transparent,
)
)
}
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 6.dp, vertical = 4.dp),
horizontalArrangement = Arrangement.End
) {
IconButton(onClick = {
viewModel.togglePasswordVisibility()
}) {
Icon(
imageVector = if (viewModel.shouldShowPassword)
Icons.Outlined.Visibility
else Icons.Outlined.VisibilityOff,
contentDescription = "",
tint = Color.White
)
}
}
}
},
textStyle = TextStyle(color = Color.White),
textObfuscationMode = if (viewModel.shouldShowPassword)
TextObfuscationMode.Visible else TextObfuscationMode.RevealLastTyped
)
Andrei Salavei
11/04/2024, 11:14 AMferdialif02
11/05/2024, 5:21 AMferdialif02
01/09/2025, 7:47 AMAndrei Salavei
01/09/2025, 8:57 AMJohn O'Reilly
02/20/2025, 6:26 PMAndrei Salavei
02/20/2025, 6:31 PMJohn O'Reilly
02/20/2025, 6:34 PMJohn O'Reilly
02/20/2025, 6:36 PMJohn O'Reilly
02/20/2025, 6:40 PMferdialif02
02/21/2025, 3:15 AM