viewModels
This commit is contained in:
parent
00e36e16fc
commit
d67c5c7289
@ -0,0 +1,46 @@
|
|||||||
|
package com.example.testktor.ViewModel
|
||||||
|
|
||||||
|
import androidx.compose.foundation.Canvas
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.navigation.NavController
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun ButtonBack(navController: NavController, screen: String){
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(start = 20.dp, top = 20.dp),
|
||||||
|
horizontalArrangement = Arrangement.Start
|
||||||
|
) {
|
||||||
|
IconButton(onClick = { navController.navigate(screen) }) {
|
||||||
|
Box(
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
modifier = Modifier.size(56.dp)
|
||||||
|
) {
|
||||||
|
Canvas(modifier = Modifier.matchParentSize()) {
|
||||||
|
drawCircle(color = Color.LightGray)
|
||||||
|
}
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.ArrowBack,
|
||||||
|
contentDescription = "Назад",
|
||||||
|
modifier = Modifier.size(28.dp),
|
||||||
|
tint = Color.Black
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package com.example.testktor.ViewModel
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.unit.Dp
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.border
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun CircularCheckbox(
|
||||||
|
checked: Boolean,
|
||||||
|
onCheckedChange: (Boolean) -> Unit,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
size: Dp = 12.dp
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = modifier
|
||||||
|
.size(size)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(if (checked) Color.Black else Color.Transparent)
|
||||||
|
.border(
|
||||||
|
width = 2.dp,
|
||||||
|
color = Color.Black,
|
||||||
|
shape = CircleShape
|
||||||
|
)
|
||||||
|
.clickable { onCheckedChange(!checked) }
|
||||||
|
.padding(start = 20.dp)
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.example.testktor.ViewModel
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.text.ClickableText
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.text.SpanStyle
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
import androidx.compose.ui.text.buildAnnotatedString
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
import androidx.compose.ui.text.style.TextDecoration
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.unit.sp
|
||||||
|
import androidx.navigation.NavController
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun ClickableTextAcceptVM(
|
||||||
|
text: String,
|
||||||
|
style: TextStyle
|
||||||
|
){
|
||||||
|
ClickableText(
|
||||||
|
text = buildAnnotatedString {
|
||||||
|
append(text)
|
||||||
|
addStyle(
|
||||||
|
style = SpanStyle(
|
||||||
|
color = Color.Black,
|
||||||
|
textDecoration = TextDecoration.Underline
|
||||||
|
),
|
||||||
|
start = 0,
|
||||||
|
end = this.length
|
||||||
|
)
|
||||||
|
},
|
||||||
|
onClick = { /* */ },
|
||||||
|
modifier = Modifier
|
||||||
|
// .fillMaxWidth()
|
||||||
|
.padding(bottom = 20.dp),
|
||||||
|
style = style
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.example.testktor.ViewModel
|
||||||
|
|
||||||
|
import androidx.compose.foundation.text.ClickableText
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
import androidx.compose.ui.text.buildAnnotatedString
|
||||||
|
import androidx.compose.ui.unit.sp
|
||||||
|
import androidx.navigation.NavController
|
||||||
|
import org.w3c.dom.Text
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun ClickableTextVM(
|
||||||
|
text: String,
|
||||||
|
navController: NavController?,
|
||||||
|
screen: String,
|
||||||
|
style: TextStyle
|
||||||
|
) {
|
||||||
|
ClickableText(
|
||||||
|
text = buildAnnotatedString { append(text) },
|
||||||
|
onClick = {
|
||||||
|
if (navController != null){
|
||||||
|
navController.navigate(screen)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
style = style
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package com.example.testktor.ViewModel
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
|
import androidx.compose.material3.OutlinedTextField
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.material3.TextFieldDefaults
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
|
@Composable
|
||||||
|
fun TextFieldVM(
|
||||||
|
text: String,
|
||||||
|
onTextChange: (String) -> Unit,
|
||||||
|
placeholder: String
|
||||||
|
) {
|
||||||
|
OutlinedTextField(
|
||||||
|
value = text,
|
||||||
|
onValueChange = { onTextChange(it) },
|
||||||
|
placeholder = { Text(text = placeholder, color = Color.Gray) },
|
||||||
|
modifier = Modifier
|
||||||
|
.width(350.dp)
|
||||||
|
.height(70.dp)
|
||||||
|
.padding(bottom = 16.dp),
|
||||||
|
shape = RoundedCornerShape(20.dp),
|
||||||
|
colors = TextFieldDefaults.outlinedTextFieldColors(
|
||||||
|
focusedBorderColor = Color.Transparent,
|
||||||
|
unfocusedBorderColor = Color.Transparent,
|
||||||
|
containerColor = Color(0xFFE0E0E0)
|
||||||
|
),
|
||||||
|
singleLine = true
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.example.testktor.ViewModel
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.Lock
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.OutlinedTextField
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.material3.TextFieldDefaults
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||||
|
import androidx.compose.ui.text.input.VisualTransformation
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
|
@Composable
|
||||||
|
fun TextFieldWithHideVM(
|
||||||
|
text: String,
|
||||||
|
onTextChange: (String) -> Unit,
|
||||||
|
placeholder: String
|
||||||
|
) {
|
||||||
|
var passwordVisible by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
|
OutlinedTextField(
|
||||||
|
value = text,
|
||||||
|
onValueChange = { onTextChange(it) },
|
||||||
|
placeholder = { Text(text = placeholder, color = Color.Gray) },
|
||||||
|
modifier = Modifier
|
||||||
|
.width(350.dp)
|
||||||
|
.height(70.dp)
|
||||||
|
.padding(bottom = 8.dp),
|
||||||
|
shape = RoundedCornerShape(20.dp),
|
||||||
|
colors = TextFieldDefaults.outlinedTextFieldColors(
|
||||||
|
focusedBorderColor = Color.Transparent,
|
||||||
|
unfocusedBorderColor = Color.Transparent,
|
||||||
|
containerColor = Color(0xFFE0E0E0)
|
||||||
|
),
|
||||||
|
singleLine = true,
|
||||||
|
visualTransformation = if (passwordVisible) VisualTransformation.None else PasswordVisualTransformation(),
|
||||||
|
trailingIcon = {
|
||||||
|
IconButton(onClick = { passwordVisible = !passwordVisible }) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Lock,
|
||||||
|
contentDescription = "Lock",
|
||||||
|
tint = Color.Gray
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
@ -4,20 +4,25 @@ import androidx.compose.foundation.Canvas
|
|||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.text.ClickableText
|
import androidx.compose.foundation.text.ClickableText
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.ArrowBack
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.Lock
|
import androidx.compose.material.icons.filled.Lock
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.OutlinedTextField
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.TextField
|
import androidx.compose.material3.TextField
|
||||||
|
import androidx.compose.material3.TextFieldDefaults
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@ -35,33 +40,9 @@ import androidx.compose.ui.text.style.TextAlign
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
|
import com.example.testktor.ViewModel.ClickableTextVM
|
||||||
@Composable
|
import com.example.testktor.ViewModel.TextFieldVM
|
||||||
fun ButtonBack(navController: NavController){
|
import com.example.testktor.ViewModel.TextFieldWithHideVM
|
||||||
Row(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(start = 20.dp, top = 20.dp),
|
|
||||||
horizontalArrangement = Arrangement.Start
|
|
||||||
) {
|
|
||||||
IconButton(onClick = { navController.navigate("slider_screen") }) {
|
|
||||||
Box(
|
|
||||||
contentAlignment = Alignment.Center,
|
|
||||||
modifier = Modifier.size(56.dp)
|
|
||||||
) {
|
|
||||||
Canvas(modifier = Modifier.matchParentSize()) {
|
|
||||||
drawCircle(color = Color.LightGray)
|
|
||||||
}
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Default.ArrowBack,
|
|
||||||
contentDescription = "Назад",
|
|
||||||
modifier = Modifier.size(28.dp),
|
|
||||||
tint = Color.Black
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun TopBar(email: String,
|
fun TopBar(email: String,
|
||||||
@ -69,47 +50,32 @@ fun TopBar(email: String,
|
|||||||
password: String,
|
password: String,
|
||||||
onPasswordChange: (String) -> Unit
|
onPasswordChange: (String) -> Unit
|
||||||
){
|
){
|
||||||
var passwordVisible by remember { mutableStateOf(false) }
|
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "Привет!",
|
text = "Привет!",
|
||||||
style = TextStyle(fontSize = 32.sp, fontWeight = FontWeight.Bold),
|
style = TextStyle(fontSize = 32.sp, fontWeight = FontWeight.Medium),
|
||||||
modifier = Modifier.height(60.dp).padding(bottom = 8.dp)
|
modifier = Modifier.height(60.dp).padding(bottom = 8.dp)
|
||||||
)
|
)
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "Заполните Свои Данные Или Продолжите Через Социальные Медиа",
|
text = "Заполните Свои Данные Или\nПродолжите Через Социальные Медиа",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(bottom = 20.dp),
|
.padding(bottom = 20.dp),
|
||||||
style = TextStyle(fontSize = 16.sp),
|
color = Color.Gray,
|
||||||
|
style = TextStyle(fontSize = 18.sp, fontWeight = FontWeight.Light),
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
|
softWrap = true,
|
||||||
maxLines = 2
|
maxLines = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.padding(top = 20.dp))
|
||||||
|
|
||||||
Text(text = "Email", modifier = Modifier.padding(end = 280.dp))
|
Text(text = "Email", modifier = Modifier.padding(end = 280.dp))
|
||||||
TextField(
|
TextFieldVM(email, {onEmailChange(it)}, "xyz@gmail.com")
|
||||||
modifier = Modifier.width(350.dp).height(70.dp).padding(bottom = 16.dp),
|
Spacer(modifier = Modifier.padding(top = 20.dp))
|
||||||
value = email,
|
|
||||||
onValueChange = { onEmailChange(it)},
|
|
||||||
)
|
|
||||||
|
|
||||||
Text(text = "Password", modifier = Modifier.padding(end = 250.dp))
|
Text(text = "Password", modifier = Modifier.padding(end = 250.dp))
|
||||||
TextField(
|
TextFieldWithHideVM(password, {onPasswordChange(it)}, "******")
|
||||||
modifier = Modifier.width(350.dp).height(70.dp).padding(bottom = 16.dp),
|
|
||||||
value = password,
|
|
||||||
onValueChange = {onPasswordChange(it)},
|
|
||||||
visualTransformation = if (!passwordVisible) PasswordVisualTransformation() else VisualTransformation.None,
|
|
||||||
trailingIcon = {
|
|
||||||
IconButton(onClick = { passwordVisible = !passwordVisible }) {
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Default.Lock,
|
|
||||||
contentDescription = "Lock",
|
|
||||||
tint = Color.Gray
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@ -117,18 +83,14 @@ fun Restore(navController: NavController) {
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(top = 6.dp, bottom = 20.dp, end = 16.dp),
|
.padding(bottom = 20.dp, end = 36.dp),
|
||||||
horizontalArrangement = Arrangement.End
|
horizontalArrangement = Arrangement.End
|
||||||
) {
|
) {
|
||||||
ClickableText(
|
ClickableTextVM(
|
||||||
text = buildAnnotatedString { append("Восстановить") },
|
"Восстановить",
|
||||||
onClick = {
|
navController,
|
||||||
navController.navigate("forgotPassword_screen")
|
"forgotPassword_screen",
|
||||||
},
|
TextStyle(fontSize = 12.sp, color = Color.Gray)
|
||||||
style = TextStyle(
|
|
||||||
fontSize = 16.sp,
|
|
||||||
color = Color.LightGray
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,7 +105,7 @@ fun BotBar(navController: NavController) {
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.BottomCenter)
|
.align(Alignment.BottomCenter)
|
||||||
.padding(bottom = 16.dp),
|
.padding(bottom = 30.dp),
|
||||||
horizontalArrangement = Arrangement.Center
|
horizontalArrangement = Arrangement.Center
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
@ -151,15 +113,11 @@ fun BotBar(navController: NavController) {
|
|||||||
style = TextStyle(fontSize = 16.sp, color = Color.Gray)
|
style = TextStyle(fontSize = 16.sp, color = Color.Gray)
|
||||||
)
|
)
|
||||||
|
|
||||||
ClickableText(
|
ClickableTextVM(
|
||||||
text = buildAnnotatedString { append("Создать пользователя") },
|
"Создать пользователя",
|
||||||
onClick = {
|
navController,
|
||||||
navController.navigate("registration_screen")
|
"registration_screen",
|
||||||
},
|
TextStyle(fontSize = 16.sp, color = Color.Black)
|
||||||
style = TextStyle(
|
|
||||||
fontSize = 16.sp,
|
|
||||||
color = Color.Black
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,26 @@
|
|||||||
package com.example.testktor.method.auth
|
package com.example.testktor.method.auth
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material3.Slider
|
import androidx.compose.material3.Slider
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.text.font.FontStyle
|
import androidx.compose.ui.text.font.FontStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
|
||||||
@ -21,46 +29,63 @@ fun Textik(imageId: Int, textList: List<String>, textList2: List<String>, curren
|
|||||||
Image(
|
Image(
|
||||||
painter = painterResource(id = imageId),
|
painter = painterResource(id = imageId),
|
||||||
contentDescription = "Изображение",
|
contentDescription = "Изображение",
|
||||||
modifier = androidx.compose.ui.Modifier.width(670.dp).height(600.dp).padding(start = 20.dp)
|
modifier = Modifier.width(670.dp).height(600.dp).padding(start = 20.dp)
|
||||||
)
|
)
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
color = Color.White,
|
|
||||||
fontStyle = FontStyle.Italic,
|
|
||||||
text = textList[currentIndex],
|
text = textList[currentIndex],
|
||||||
fontSize = 24.sp,
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
textAlign = TextAlign.Center,
|
|
||||||
modifier = androidx.compose.ui.Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(top = 40.dp)
|
|
||||||
.width(700.dp).height(30.dp)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
color = Color.White,
|
color = Color.White,
|
||||||
fontStyle = FontStyle.Italic,
|
fontStyle = FontStyle.Italic,
|
||||||
text = textList2[currentIndex],
|
fontSize = 38.sp,
|
||||||
fontSize = 18.sp,
|
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
modifier = androidx.compose.ui.Modifier
|
lineHeight = 42.sp,
|
||||||
|
softWrap = true,
|
||||||
|
maxLines = 2,
|
||||||
|
overflow = TextOverflow.Clip,
|
||||||
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(top = 40.dp)
|
.padding(top = 10.dp)
|
||||||
|
.width(700.dp)
|
||||||
|
.height(100.dp)
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = textList2[currentIndex],
|
||||||
|
color = Color.White,
|
||||||
|
fontStyle = FontStyle.Italic,
|
||||||
|
fontSize = 16.sp,
|
||||||
|
fontWeight = FontWeight.Light,
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
lineHeight = 20.sp,
|
||||||
|
maxLines = 2,
|
||||||
|
overflow = TextOverflow.Clip,
|
||||||
|
softWrap = true,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(top = 15.dp)
|
||||||
|
.height(40.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Sliderik(sliderValue: Float, maxIndex: Int, onClick: (Float) -> Unit, ){
|
fun Sliderik(currentIndex: Int, maxIndex: Int, onClick: (Int) -> Unit) {
|
||||||
Slider(
|
Row(
|
||||||
value = sliderValue,
|
modifier = Modifier
|
||||||
onValueChange = onClick,
|
.fillMaxWidth()
|
||||||
valueRange = 0f..maxIndex.toFloat(),
|
.padding(vertical = 16.dp),
|
||||||
steps = maxIndex - 1,
|
horizontalArrangement = Arrangement.Center
|
||||||
colors = androidx.compose.material3.SliderDefaults.colors(
|
) {
|
||||||
thumbColor = Color.White,
|
for (i in 0..maxIndex) {
|
||||||
activeTrackColor = Color(0xFF0076B1),
|
Box(
|
||||||
inactiveTrackColor = Color(0xFFB0B0B0)
|
modifier = Modifier
|
||||||
),
|
.padding(horizontal = 8.dp)
|
||||||
modifier = androidx.compose.ui.Modifier.fillMaxWidth()
|
.height(4.dp)
|
||||||
)
|
.width(if (i == currentIndex) 40.dp else 20.dp)
|
||||||
|
.background(
|
||||||
|
color = if (i == currentIndex) Color.White else Color.Gray,
|
||||||
|
shape = RoundedCornerShape(50)
|
||||||
|
)
|
||||||
|
.clickable { onClick(i) }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.example.testktor.method.auth
|
package com.example.testktor.method.auth
|
||||||
|
|
||||||
|
import android.widget.Space
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
@ -8,35 +10,36 @@ import androidx.compose.material3.Text
|
|||||||
import androidx.compose.material3.TextField
|
import androidx.compose.material3.TextField
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.example.testktor.ViewModel.TextFieldVM
|
||||||
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun BarForgot(emailIn: String, onEmailChane: (String) -> Unit){
|
fun BarForgot(emailIn: String, onEmailChange: (String) -> Unit){
|
||||||
Text(
|
Text(
|
||||||
text = "Забыл Пароль",
|
text = "Забыл Пароль",
|
||||||
style = TextStyle(fontSize = 32.sp, fontWeight = FontWeight.Bold),
|
style = TextStyle(fontSize = 32.sp, fontWeight = FontWeight.Medium),
|
||||||
modifier = Modifier.height(60.dp).padding(bottom = 20.dp)
|
modifier = Modifier.height(60.dp).padding(bottom = 8.dp)
|
||||||
)
|
)
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "Введите свою учетную запись для сброса",
|
text = "Введите Свою Учетную Запись\nДля Сброса",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(bottom = 20.dp),
|
.padding(bottom = 20.dp),
|
||||||
style = TextStyle(fontSize = 16.sp),
|
color = Color.Gray,
|
||||||
|
style = TextStyle(fontSize = 18.sp, fontWeight = FontWeight.Light),
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
|
softWrap = true,
|
||||||
maxLines = 2
|
maxLines = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
Text(text = "Email", modifier = Modifier.padding(end = 255.dp))
|
Spacer(modifier = Modifier.padding(top = 10.dp))
|
||||||
TextField(
|
|
||||||
modifier = Modifier.width(300.dp).height(70.dp).padding(bottom = 16.dp),
|
TextFieldVM(emailIn, {onEmailChange(it)}, "xyz@gmail.com")
|
||||||
value = emailIn,
|
|
||||||
onValueChange = {onEmailChane(it)}
|
|
||||||
)
|
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package com.example.testktor.method.auth
|
package com.example.testktor.method.auth
|
||||||
|
|
||||||
|
import androidx.compose.foundation.Canvas
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
@ -8,9 +9,11 @@ import androidx.compose.foundation.layout.fillMaxSize
|
|||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.text.ClickableText
|
import androidx.compose.foundation.text.ClickableText
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.Lock
|
import androidx.compose.material.icons.filled.Lock
|
||||||
import androidx.compose.material3.Checkbox
|
import androidx.compose.material3.Checkbox
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
@ -36,6 +39,11 @@ import androidx.compose.ui.text.style.TextDecoration
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
|
import com.example.testktor.ViewModel.CircularCheckbox
|
||||||
|
import com.example.testktor.ViewModel.ClickableTextAcceptVM
|
||||||
|
import com.example.testktor.ViewModel.ClickableTextVM
|
||||||
|
import com.example.testktor.ViewModel.TextFieldVM
|
||||||
|
import com.example.testktor.ViewModel.TextFieldWithHideVM
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun TopBarReg(name: String,
|
fun TopBarReg(name: String,
|
||||||
@ -45,55 +53,34 @@ fun TopBarReg(name: String,
|
|||||||
password: String,
|
password: String,
|
||||||
onPasswordChange: (String) -> Unit
|
onPasswordChange: (String) -> Unit
|
||||||
){
|
){
|
||||||
var passwordVisible by remember { mutableStateOf(false) }
|
|
||||||
var isChecked by remember { mutableStateOf(false) }
|
var isChecked by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "Регистрация",
|
text = "Регистрация",
|
||||||
style = TextStyle(fontSize = 32.sp, fontWeight = FontWeight.Bold),
|
style = TextStyle(fontSize = 32.sp, fontWeight = FontWeight.Medium),
|
||||||
modifier = Modifier.height(60.dp).padding(bottom = 20.dp)
|
modifier = Modifier.height(60.dp).padding(bottom = 8.dp)
|
||||||
)
|
)
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "Заполните Свои данные или продолжите через социальные медиа",
|
text = "Заполните Свои данные или\nпродолжите через социальные медиа",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(bottom = 20.dp),
|
.padding(bottom = 20.dp),
|
||||||
style = TextStyle(fontSize = 16.sp),
|
color = Color.Gray,
|
||||||
|
style = TextStyle(fontSize = 18.sp, fontWeight = FontWeight.Light),
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
|
softWrap = true,
|
||||||
maxLines = 2
|
maxLines = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
Text(text = "Ваше имя", modifier = Modifier.padding(end = 270.dp))
|
Text(text = "Ваше имя", modifier = Modifier.padding(end = 270.dp))
|
||||||
TextField(
|
TextFieldVM(name, {onNameChange(it)}, "xxxxxxx")
|
||||||
modifier = Modifier.width(350.dp).height(70.dp).padding(bottom = 16.dp),
|
|
||||||
value = name,
|
|
||||||
onValueChange = {onNameChange(it)}
|
|
||||||
)
|
|
||||||
|
|
||||||
Text(text = "Email", modifier = Modifier.padding(end = 290.dp))
|
Text(text = "Email", modifier = Modifier.padding(end = 290.dp))
|
||||||
TextField(
|
TextFieldVM(email, {onEmailChange(it)}, "xyz@gmail.com")
|
||||||
modifier = Modifier.width(350.dp).height(70.dp).padding(bottom = 16.dp),
|
|
||||||
value = email,
|
|
||||||
onValueChange = {onEmailChange(it)}
|
|
||||||
)
|
|
||||||
|
|
||||||
Text(text = "Password", modifier = Modifier.padding(end = 260.dp))
|
Text(text = "Password", modifier = Modifier.padding(end = 260.dp))
|
||||||
TextField(
|
TextFieldWithHideVM(password, {onPasswordChange(it)}, "******")
|
||||||
modifier = Modifier.width(350.dp).height(70.dp).padding(bottom = 16.dp),
|
|
||||||
value = password,
|
|
||||||
onValueChange = {onPasswordChange(it)},
|
|
||||||
visualTransformation = if (!passwordVisible) PasswordVisualTransformation() else VisualTransformation.None,
|
|
||||||
trailingIcon = {
|
|
||||||
IconButton(onClick = { passwordVisible = !passwordVisible }) {
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Default.Lock,
|
|
||||||
contentDescription = "Lock",
|
|
||||||
tint = Color.Gray
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@ -107,25 +94,9 @@ fun TopBarReg(name: String,
|
|||||||
onCheckedChange = { isChecked = it }
|
onCheckedChange = { isChecked = it }
|
||||||
)
|
)
|
||||||
|
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
ClickableTextAcceptVM(
|
||||||
|
"Даю согласие на обработку\nперсональных данных",
|
||||||
ClickableText(
|
TextStyle(fontSize = 16.sp)
|
||||||
text = buildAnnotatedString {
|
|
||||||
append("Даю согласие на обработку персональных данных")
|
|
||||||
addStyle(
|
|
||||||
style = SpanStyle(
|
|
||||||
color = Color.Black,
|
|
||||||
textDecoration = TextDecoration.Underline
|
|
||||||
),
|
|
||||||
start = 0,
|
|
||||||
end = this.length
|
|
||||||
)
|
|
||||||
},
|
|
||||||
onClick = { /* */ },
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(bottom = 20.dp),
|
|
||||||
style = TextStyle(fontSize = 16.sp, textAlign = TextAlign.Center)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,16 +118,11 @@ fun BotBarReg(navController: NavController) {
|
|||||||
text = "Есть аккаунт? ",
|
text = "Есть аккаунт? ",
|
||||||
style = TextStyle(fontSize = 16.sp, color = Color.Gray)
|
style = TextStyle(fontSize = 16.sp, color = Color.Gray)
|
||||||
)
|
)
|
||||||
|
ClickableTextVM(
|
||||||
ClickableText(
|
"Войти",
|
||||||
text = buildAnnotatedString { append("Войти") },
|
navController,
|
||||||
onClick = {
|
"auth_screen",
|
||||||
navController.navigate("auth_screen")
|
TextStyle(fontSize = 16.sp, color = Color.Black)
|
||||||
},
|
|
||||||
style = TextStyle(
|
|
||||||
fontSize = 16.sp,
|
|
||||||
color = Color.Black
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.example.testktor.method.auth
|
package com.example.testktor.method.auth
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
@ -7,49 +9,83 @@ import androidx.compose.foundation.layout.width
|
|||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.TextField
|
import androidx.compose.material3.TextField
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.example.testktor.ViewModel.ClickableTextVM
|
||||||
|
import com.example.testktor.ViewModel.TextFieldVM
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun TopBarReset(){
|
fun TopBarReset(){
|
||||||
Text(
|
Text(
|
||||||
text = "ОТР Проверка",
|
text = "ОТР Проверка",
|
||||||
style = TextStyle(fontSize = 32.sp, fontWeight = FontWeight.Bold),
|
style = TextStyle(fontSize = 32.sp, fontWeight = FontWeight.Medium),
|
||||||
modifier = Modifier.height(60.dp).padding(bottom = 20.dp)
|
modifier = Modifier.height(60.dp).padding(bottom = 8.dp)
|
||||||
)
|
)
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "Пожалуйста, проверьте свою электронную почту, чтобы увидеть код подтверждения",
|
text = "Пожалуйста, Проверьте Свою, Электронную Почту, Чтобы Увидеть Код Подтверждения",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(bottom = 20.dp),
|
.padding(bottom = 20.dp),
|
||||||
style = TextStyle(fontSize = 16.sp),
|
color = Color.Gray,
|
||||||
|
style = TextStyle(fontSize = 18.sp, fontWeight = FontWeight.Light),
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
|
softWrap = true,
|
||||||
maxLines = 3
|
maxLines = 3
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun TextFieldsReset(codeIn: String,
|
fun TextFieldsReset(
|
||||||
onCodeChange: (String) -> Unit,
|
codeIn: String,
|
||||||
newPassword: String,
|
onCodeChange: (String) -> Unit,
|
||||||
onNewPasswordChange: (String) -> Unit){
|
newPassword: String,
|
||||||
Text(text = "OTP Code", modifier = Modifier.padding(end = 255.dp))
|
onNewPasswordChange: (String) -> Unit
|
||||||
TextField(
|
) {
|
||||||
modifier = Modifier.width(350.dp).height(70.dp).padding(bottom = 16.dp),
|
var timer by remember { mutableStateOf(60) }
|
||||||
value = codeIn,
|
|
||||||
onValueChange = {onCodeChange(it)}
|
|
||||||
)
|
|
||||||
|
|
||||||
Text(text = "New Password", modifier = Modifier.padding(end = 255.dp))
|
LaunchedEffect(key1 = timer) {
|
||||||
TextField(
|
if (timer > 0) {
|
||||||
modifier = Modifier.width(300.dp).height(70.dp).padding(bottom = 16.dp),
|
delay(1000)
|
||||||
value = newPassword,
|
timer--
|
||||||
onValueChange = {onNewPasswordChange(it)}
|
}
|
||||||
)
|
}
|
||||||
|
|
||||||
|
Text(text = "OTP Код", modifier = Modifier.padding(end = 255.dp))
|
||||||
|
TextFieldVM(codeIn, { onCodeChange(it) }, "")
|
||||||
|
|
||||||
|
Text(text = "New Password", modifier = Modifier.padding(end = 205.dp))
|
||||||
|
TextFieldVM(newPassword, { onNewPasswordChange(it) }, "")
|
||||||
|
|
||||||
|
Row(){
|
||||||
|
Spacer(modifier = Modifier.padding(start = 40.dp))
|
||||||
|
ClickableTextVM(
|
||||||
|
"Восстановить",
|
||||||
|
navController = null,
|
||||||
|
"forgotPassword_screen",
|
||||||
|
TextStyle(fontSize = 12.sp, color = Color.Gray)
|
||||||
|
)
|
||||||
|
|
||||||
|
Text(
|
||||||
|
text = "${timer}s",
|
||||||
|
style = TextStyle(fontSize = 12.sp, color = Color.Gray),
|
||||||
|
color = Color.Gray,
|
||||||
|
fontSize = 14.sp,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(end = 40.dp, bottom = 10.dp),
|
||||||
|
textAlign = TextAlign.End
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,9 @@ import androidx.compose.ui.text.font.FontWeight
|
|||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
|
import com.example.testktor.ViewModel.ButtonBack
|
||||||
import com.example.testktor.authUser
|
import com.example.testktor.authUser
|
||||||
import com.example.testktor.method.auth.BotBar
|
import com.example.testktor.method.auth.BotBar
|
||||||
import com.example.testktor.method.auth.ButtonBack
|
|
||||||
import com.example.testktor.method.auth.Restore
|
import com.example.testktor.method.auth.Restore
|
||||||
import com.example.testktor.method.auth.TopBar
|
import com.example.testktor.method.auth.TopBar
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
@ -68,9 +68,9 @@ fun AuthContent(
|
|||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.Center
|
||||||
) {
|
) {
|
||||||
ButtonBack(navController)
|
ButtonBack(navController, "slider_screen")
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(140.dp))
|
Spacer(modifier = Modifier.height(20.dp))
|
||||||
|
|
||||||
if (authSuccess != null){
|
if (authSuccess != null){
|
||||||
if (authSuccess == "Success") {
|
if (authSuccess == "Success") {
|
||||||
|
@ -47,8 +47,8 @@ fun FirstScreen(onNavigateToSliderScreen: () -> Unit) {
|
|||||||
@Composable
|
@Composable
|
||||||
fun SliderScreen(onNavigateToAuthScreen: () -> Unit) {
|
fun SliderScreen(onNavigateToAuthScreen: () -> Unit) {
|
||||||
var sliderValue by remember { mutableStateOf(0f) }
|
var sliderValue by remember { mutableStateOf(0f) }
|
||||||
val textList = listOf("ДОБРО ПОЖАЛОВАТЬ", "Начнем путешествие", "У вас есть сила, чтобы")
|
val textList = listOf("ДОБРО\nПОЖАЛОВАТЬ", "Начнем\nпутешествие", "У Вас Есть Сила,\nЧтобы")
|
||||||
val textList2 = listOf("", "Умная, великолепная и модная коллекция Изучите сейчас", "В вашей комнате много красивых и привлекательных растений")
|
val textList2 = listOf("", "Умная, великолепная и модная\nколлекция Изучите сейчас", "В вашей комнате много красивых и\nпривлекательных растений")
|
||||||
val maxIndex = textList.size - 1
|
val maxIndex = textList.size - 1
|
||||||
|
|
||||||
val currentIndex = sliderValue.toInt()
|
val currentIndex = sliderValue.toInt()
|
||||||
@ -70,7 +70,8 @@ fun SliderScreen(onNavigateToAuthScreen: () -> Unit) {
|
|||||||
|
|
||||||
Spacer(modifier = androidx.compose.ui.Modifier.weight(1f))
|
Spacer(modifier = androidx.compose.ui.Modifier.weight(1f))
|
||||||
|
|
||||||
Sliderik(sliderValue, maxIndex){ newValue -> sliderValue = newValue }
|
// Sliderik(sliderValue, maxIndex){ newValue -> sliderValue = newValue }
|
||||||
|
Sliderik(currentIndex, maxIndex) { newIndex -> sliderValue = newIndex.toFloat() }
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
|
@ -3,6 +3,7 @@ package com.example.testktor.screen.auth
|
|||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
@ -29,6 +30,7 @@ import androidx.compose.ui.text.style.TextAlign
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
|
import com.example.testktor.ViewModel.ButtonBack
|
||||||
import com.example.testktor.forgotPassword
|
import com.example.testktor.forgotPassword
|
||||||
import com.example.testktor.method.auth.BarForgot
|
import com.example.testktor.method.auth.BarForgot
|
||||||
import com.example.testktor.resetPassword
|
import com.example.testktor.resetPassword
|
||||||
@ -66,8 +68,12 @@ fun ForgotPasswordContent(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.Top
|
||||||
) {
|
) {
|
||||||
|
ButtonBack(navController, "auth_screen")
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(20.dp))
|
||||||
|
|
||||||
if (forgotSuccess != null){
|
if (forgotSuccess != null){
|
||||||
if (forgotSuccess == "Success") {
|
if (forgotSuccess == "Success") {
|
||||||
navController.navigate("resetPassword_screen")
|
navController.navigate("resetPassword_screen")
|
||||||
@ -85,6 +91,8 @@ fun ForgotPasswordContent(
|
|||||||
|
|
||||||
BarForgot(emailIn){emailIn = it}
|
BarForgot(emailIn){emailIn = it}
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.padding(10.dp))
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
modifier = Modifier.width(350.dp).height(50.dp),
|
modifier = Modifier.width(350.dp).height(50.dp),
|
||||||
colors = androidx.compose.material3.ButtonDefaults.buttonColors(
|
colors = androidx.compose.material3.ButtonDefaults.buttonColors(
|
||||||
|
@ -23,6 +23,7 @@ import androidx.compose.ui.text.font.FontWeight
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
|
import com.example.testktor.ViewModel.ButtonBack
|
||||||
import com.example.testktor.method.auth.BotBarReg
|
import com.example.testktor.method.auth.BotBarReg
|
||||||
import com.example.testktor.method.auth.TopBarReg
|
import com.example.testktor.method.auth.TopBarReg
|
||||||
import com.example.testktor.regUser
|
import com.example.testktor.regUser
|
||||||
@ -70,6 +71,10 @@ fun RegContent(
|
|||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.Center
|
||||||
) {
|
) {
|
||||||
|
ButtonBack(navController, "auth_screen")
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(20.dp))
|
||||||
|
|
||||||
if (regSuccess != null){
|
if (regSuccess != null){
|
||||||
if (regSuccess == "Success") {
|
if (regSuccess == "Success") {
|
||||||
navController.navigate("auth_screen")
|
navController.navigate("auth_screen")
|
||||||
@ -85,8 +90,6 @@ fun RegContent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(140.dp))
|
|
||||||
|
|
||||||
TopBarReg(nameIn, {nameIn = it}, emailIn, {emailIn = it}, passwordIn, {passwordIn = it})
|
TopBarReg(nameIn, {nameIn = it}, emailIn, {emailIn = it}, passwordIn, {passwordIn = it})
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
|
@ -2,6 +2,7 @@ package com.example.testktor.screen.auth
|
|||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
@ -26,6 +27,7 @@ import androidx.compose.ui.unit.dp
|
|||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
import com.android.identity.cbor.Uint
|
import com.android.identity.cbor.Uint
|
||||||
|
import com.example.testktor.ViewModel.ButtonBack
|
||||||
import com.example.testktor.authUser
|
import com.example.testktor.authUser
|
||||||
import com.example.testktor.method.auth.TextFieldsReset
|
import com.example.testktor.method.auth.TextFieldsReset
|
||||||
import com.example.testktor.method.auth.TopBarReset
|
import com.example.testktor.method.auth.TopBarReset
|
||||||
@ -68,8 +70,12 @@ fun ResetPasswordContent(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.Top
|
||||||
) {
|
) {
|
||||||
|
ButtonBack(navController, "auth_screen")
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(20.dp))
|
||||||
|
|
||||||
if (resetSuccess != null){
|
if (resetSuccess != null){
|
||||||
if (resetSuccess == "Success") {
|
if (resetSuccess == "Success") {
|
||||||
navController.navigate("auth_screen")
|
navController.navigate("auth_screen")
|
||||||
|
Loading…
Reference in New Issue
Block a user