|
@@ -51,6 +51,8 @@ fun AuthScreen(navHost: NavHostController){
|
|
|
val email = remember { mutableStateOf("")}
|
|
|
val password = remember { mutableStateOf("")}
|
|
|
|
|
|
+ val passwordVisibility = remember { mutableStateOf(false) }
|
|
|
+
|
|
|
Column(
|
|
|
Modifier
|
|
|
.background(color = BlueBlack)
|
|
@@ -112,20 +114,31 @@ fun AuthScreen(navHost: NavHostController){
|
|
|
)
|
|
|
TextField(
|
|
|
value = password.value,
|
|
|
- onValueChange = {password.value = it},
|
|
|
- visualTransformation = PasswordVisualTransformation(),
|
|
|
+ onValueChange = { password.value = it },
|
|
|
+ visualTransformation = if (passwordVisibility.value) VisualTransformation.None else PasswordVisualTransformation(),
|
|
|
textStyle = TextStyle(fontSize = 14.sp, color = BlueDark),
|
|
|
shape = RoundedCornerShape(5.dp),
|
|
|
modifier = Modifier
|
|
|
- .padding(top = 235.dp, start = 30.dp, end = 30.dp)
|
|
|
+ .padding(top = 235.dp, start = 30.dp, end = if (passwordVisibility.value) 90.dp else 30.dp) // Рассчитать отступ для текстового поля в зависимости от видимости пароля
|
|
|
.height(50.dp),
|
|
|
placeholder = {
|
|
|
- Text("Введите пароль",
|
|
|
- style = TextStyle(fontSize = 14.sp))
|
|
|
+ Text("Введите пароль", style = TextStyle(fontSize = 14.sp))
|
|
|
}
|
|
|
+ )
|
|
|
|
|
|
+ Image(
|
|
|
+ painter = painterResource(if (passwordVisibility.value) R.drawable.eyeoff else R.drawable.eye),
|
|
|
+ contentDescription = "Toggle Password Visibility",
|
|
|
+ modifier = Modifier
|
|
|
+ .clickable { passwordVisibility.value = !passwordVisibility.value }
|
|
|
+ .align(Alignment.CenterEnd)
|
|
|
+ .padding(top = 100.dp)
|
|
|
+ .size(48.dp)
|
|
|
)
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
Button(onClick = { viewModel.onSignInEmailPassword(email.value, password.value) },
|
|
|
colors = ButtonDefaults.buttonColors(Pearl),
|
|
|
modifier = Modifier
|