|
@@ -0,0 +1,137 @@
|
|
|
+package com.example.neurea.views.screens
|
|
|
+
|
|
|
+import androidx.compose.foundation.background
|
|
|
+import androidx.compose.foundation.border
|
|
|
+import androidx.compose.foundation.layout.Arrangement
|
|
|
+import androidx.compose.foundation.layout.Box
|
|
|
+import androidx.compose.foundation.layout.Column
|
|
|
+import androidx.compose.foundation.layout.PaddingValues
|
|
|
+import androidx.compose.foundation.layout.Row
|
|
|
+import androidx.compose.foundation.layout.fillMaxSize
|
|
|
+import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
+import androidx.compose.foundation.layout.height
|
|
|
+import androidx.compose.foundation.layout.padding
|
|
|
+import androidx.compose.foundation.layout.size
|
|
|
+import androidx.compose.foundation.layout.width
|
|
|
+import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
+import androidx.compose.foundation.text.KeyboardOptions
|
|
|
+import androidx.compose.material3.Button
|
|
|
+import androidx.compose.material3.ButtonDefaults
|
|
|
+import androidx.compose.material3.ExperimentalMaterial3Api
|
|
|
+import androidx.compose.material3.HorizontalDivider
|
|
|
+import androidx.compose.material3.Icon
|
|
|
+import androidx.compose.material3.IconButton
|
|
|
+import androidx.compose.material3.MaterialTheme
|
|
|
+import androidx.compose.material3.Text
|
|
|
+import androidx.compose.material3.TextButton
|
|
|
+import androidx.compose.material3.TextField
|
|
|
+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.Alignment
|
|
|
+import androidx.compose.ui.Modifier
|
|
|
+import androidx.compose.ui.draw.clip
|
|
|
+import androidx.compose.ui.graphics.Color
|
|
|
+import androidx.compose.ui.res.painterResource
|
|
|
+import androidx.compose.ui.text.TextStyle
|
|
|
+import androidx.compose.ui.text.font.FontWeight
|
|
|
+import androidx.compose.ui.text.input.KeyboardType
|
|
|
+import androidx.compose.ui.text.input.PasswordVisualTransformation
|
|
|
+import androidx.compose.ui.text.input.VisualTransformation
|
|
|
+import androidx.compose.ui.text.style.TextAlign
|
|
|
+import androidx.compose.ui.tooling.preview.Preview
|
|
|
+import androidx.compose.ui.unit.dp
|
|
|
+import androidx.compose.ui.unit.sp
|
|
|
+import com.example.neurea.R
|
|
|
+import com.example.neurea.views.ui.theme.NeureaTheme
|
|
|
+
|
|
|
+@Preview()
|
|
|
+@OptIn(ExperimentalMaterial3Api::class)
|
|
|
+@Composable
|
|
|
+fun HomeScreen() { // navController: NavController
|
|
|
+ var email = remember { mutableStateOf("") }
|
|
|
+ var password = remember { mutableStateOf("") }
|
|
|
+ val maxLength = 20
|
|
|
+ val emailPattern = Regex("[^@ \\t\\r\\n]+@[^@ \\t\\r\\n]+\\.[^@ \\t\\r\\n]+")
|
|
|
+ var passwordVisibility: Boolean by remember { mutableStateOf(false) }
|
|
|
+
|
|
|
+ NeureaTheme {
|
|
|
+ Column(
|
|
|
+ modifier = Modifier
|
|
|
+ .fillMaxSize()
|
|
|
+ .background(color = MaterialTheme.colorScheme.secondary)
|
|
|
+ ) {
|
|
|
+ TextField(
|
|
|
+ modifier = Modifier
|
|
|
+ .fillMaxWidth()
|
|
|
+ .padding(start = 20.dp, end = 20.dp, top = 45.dp, bottom = 25.dp)
|
|
|
+ .clip(shape = RoundedCornerShape(54.dp))
|
|
|
+ ,
|
|
|
+ value = password.value,
|
|
|
+ colors = TextFieldDefaults.textFieldColors(
|
|
|
+ containerColor = MaterialTheme.colorScheme.surface,
|
|
|
+ focusedIndicatorColor = MaterialTheme.colorScheme.secondary,
|
|
|
+ focusedTextColor = MaterialTheme.colorScheme.onPrimary,
|
|
|
+ unfocusedTextColor = MaterialTheme.colorScheme.secondary,
|
|
|
+ disabledIndicatorColor = Color.Transparent,
|
|
|
+ unfocusedIndicatorColor = Color.Transparent,
|
|
|
+ cursorColor = MaterialTheme.colorScheme.primary,
|
|
|
+ disabledPlaceholderColor = MaterialTheme.colorScheme.onSecondary,
|
|
|
+ focusedPlaceholderColor = MaterialTheme.colorScheme.onSecondary,
|
|
|
+ unfocusedPlaceholderColor = MaterialTheme.colorScheme.onSecondary
|
|
|
+ ),
|
|
|
+ visualTransformation = if (passwordVisibility) VisualTransformation.None else PasswordVisualTransformation(),
|
|
|
+ trailingIcon = {
|
|
|
+ Icon(
|
|
|
+ painter = painterResource(id = R.drawable.baseline_search_24),
|
|
|
+ contentDescription = "",
|
|
|
+ tint = MaterialTheme.colorScheme.primary
|
|
|
+ )
|
|
|
+ },
|
|
|
+ onValueChange = {
|
|
|
+ if (it.length <= maxLength) password.value = it
|
|
|
+ },
|
|
|
+ placeholder = { Text("Поиск") },
|
|
|
+ singleLine = true
|
|
|
+ )
|
|
|
+ Text("Ваши рекомендации", fontWeight = FontWeight.Bold, fontSize = 18.sp, modifier = Modifier.padding(start = 25.dp) )
|
|
|
+ // Тут скорее всего будет LazyRow
|
|
|
+ Row(modifier = Modifier.padding(top = 22.dp, bottom = 22.dp, start = 24.dp))
|
|
|
+ {
|
|
|
+ Column(modifier = Modifier
|
|
|
+
|
|
|
+ .height(216.dp)
|
|
|
+ .width(150.dp)
|
|
|
+
|
|
|
+ .clip(RoundedCornerShape(15.dp))
|
|
|
+
|
|
|
+ .background(MaterialTheme.colorScheme.surface)
|
|
|
+ ) {
|
|
|
+ Column(modifier = Modifier.padding(horizontal = 10.dp)) {
|
|
|
+ Column(modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.End) {
|
|
|
+ Box(modifier = Modifier
|
|
|
+ .padding(top=5.dp)
|
|
|
+ .size(7.dp)
|
|
|
+ .clip(RoundedCornerShape(8.dp))
|
|
|
+ .background(Color(0xFFD9D9D9),))
|
|
|
+ }
|
|
|
+
|
|
|
+ Column(modifier = Modifier
|
|
|
+ .height(130.dp)
|
|
|
+ .fillMaxWidth(),
|
|
|
+ horizontalAlignment = Alignment.CenterHorizontally){
|
|
|
+ Box(modifier = Modifier.background(Color.Gray).height(130.dp).width(80.dp), )
|
|
|
+
|
|
|
+ }
|
|
|
+ Text("Человек в высоком замке", fontSize = 15.sp, fontWeight = FontWeight.SemiBold)
|
|
|
+ Text("Филип Дик", fontSize = 15.sp)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|