|
@@ -51,6 +51,8 @@ fun RegisterScreen(navHost: NavHostController){
|
|
|
val email = remember { mutableStateOf("")}
|
|
|
val password = remember { mutableStateOf("")}
|
|
|
|
|
|
+ val passwordVisibility = remember { mutableStateOf(false )}
|
|
|
+
|
|
|
Column(
|
|
|
Modifier
|
|
|
.background(color = BlueBlack)
|
|
@@ -92,15 +94,18 @@ fun RegisterScreen(navHost: NavHostController){
|
|
|
)
|
|
|
TextField(
|
|
|
value = email.value,
|
|
|
- onValueChange = {email.value = it},
|
|
|
+ onValueChange = { email.value = it },
|
|
|
textStyle = TextStyle(fontSize = 14.sp, color = BlueDark),
|
|
|
shape = RoundedCornerShape(5.dp),
|
|
|
modifier = Modifier
|
|
|
.padding(top = 140.dp, start = 30.dp, end = 30.dp)
|
|
|
.height(50.dp),
|
|
|
placeholder = {
|
|
|
- Text("youremail@gmail.com",
|
|
|
- style = TextStyle(fontSize = 14.sp)) }
|
|
|
+ Text(
|
|
|
+ "youremail@gmail.com",
|
|
|
+ style = TextStyle(fontSize = 14.sp)
|
|
|
+ )
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
Text(
|
|
@@ -112,21 +117,37 @@ fun RegisterScreen(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)
|
|
|
.height(50.dp),
|
|
|
placeholder = {
|
|
|
- Text("Введите пароль",
|
|
|
- style = TextStyle(fontSize = 14.sp))
|
|
|
+ Text(
|
|
|
+ "Введите пароль",
|
|
|
+ style = TextStyle(fontSize = 14.sp)
|
|
|
+ )
|
|
|
}
|
|
|
|
|
|
)
|
|
|
|
|
|
- Button(onClick = { viewModel.onSignUpEmail(email.value, password.value) },
|
|
|
+ Box(modifier = Modifier
|
|
|
+ .padding(top = 70.dp, end = 40.dp)
|
|
|
+ .clickable { passwordVisibility.value = !passwordVisibility.value }
|
|
|
+ .align(Alignment.CenterEnd))
|
|
|
+ {
|
|
|
+ Image(
|
|
|
+ painter = painterResource(if (passwordVisibility.value) R.drawable.eyeoff else R.drawable.eye),
|
|
|
+ contentDescription = "Toggle Password Visibility",
|
|
|
+ modifier = Modifier
|
|
|
+ .size(30.dp)
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ Button(
|
|
|
+ onClick = { viewModel.onSignUpEmail(email.value, password.value) },
|
|
|
colors = ButtonDefaults.buttonColors(Pearl),
|
|
|
modifier = Modifier
|
|
|
.padding(top = 245.dp)
|
|
@@ -136,14 +157,18 @@ fun RegisterScreen(navHost: NavHostController){
|
|
|
Text("Зарегестрироваться")
|
|
|
}
|
|
|
|
|
|
- Text(
|
|
|
- text = "Авторизация", fontSize = 12.sp, color = Color(0xFF3A506B),
|
|
|
- modifier = Modifier
|
|
|
- .clickable { navHost.navigate("auth_screen") }
|
|
|
- .padding(top = 400.dp, start = 30.dp)
|
|
|
- )
|
|
|
+ Box(modifier = Modifier
|
|
|
+ .padding(top = 400.dp, start = 30.dp)
|
|
|
+ .clickable {
|
|
|
+ navHost.navigate("auth_screen")
|
|
|
+ }) {
|
|
|
+ Text(
|
|
|
+ text = "Авторизация",
|
|
|
+ fontSize = 12.sp,
|
|
|
+ color = Color(0xFF3A506B),
|
|
|
+ )
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|