Browse Source

visualImprovements

x1tosi 1 month ago
parent
commit
0022134864

+ 27 - 9
app/src/main/java/com/example/fitmarcetplacekuzminiv/Screens/authScreen.kt

@@ -5,12 +5,16 @@ import androidx.compose.material3.*
 import androidx.compose.runtime.*
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.TextStyle
 import androidx.compose.ui.text.input.PasswordVisualTransformation
-import androidx.compose.ui.text.input.TextFieldValue
 import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import androidx.compose.ui.text.font.FontWeight
 import androidx.navigation.NavController
 import com.example.fitmarcetplacekuzminiv.MainViewModel
-//Авторизация
+
+// Авторизация
 @Composable
 fun AuthScreen(navController: NavController, mainViewModel: MainViewModel) {
     val email = remember { mutableStateOf("") }
@@ -29,7 +33,8 @@ fun AuthScreen(navController: NavController, mainViewModel: MainViewModel) {
     }
 
     Box(
-        modifier = Modifier.fillMaxSize(),
+        modifier = Modifier
+            .fillMaxSize(),
         contentAlignment = Alignment.Center
     ) {
         Column(
@@ -39,25 +44,38 @@ fun AuthScreen(navController: NavController, mainViewModel: MainViewModel) {
                 .fillMaxWidth()
                 .padding(16.dp)
         ) {
+            // Добавляем заголовок "Авторизация"
+            Text(
+                text = "Авторизация",
+                style = TextStyle(fontSize = 28.sp, fontWeight = FontWeight.Bold),
+                color = Color.Black,
+                modifier = Modifier.padding(bottom = 16.dp)
+            )
+
             OutlinedTextField(
                 value = email.value,
                 onValueChange = { newText -> email.value = newText },
-                label = { Text("Email") },
+                label = { Text("Почта") },
                 modifier = Modifier.fillMaxWidth()
             )
             Spacer(modifier = Modifier.height(16.dp))
             OutlinedTextField(
                 value = password.value,
                 onValueChange = { newText -> password.value = newText },
-                label = { Text("Password") },
+                label = { Text("Пароль") },
                 visualTransformation = PasswordVisualTransformation(),
                 modifier = Modifier.fillMaxWidth()
             )
             Spacer(modifier = Modifier.height(24.dp))
-            Button(onClick = {
-                mainViewModel.onSignInEmailPassword(email.value, password.value)
-            }) {
-                Text("Login")
+            Button(
+                onClick = {
+                    mainViewModel.onSignInEmailPassword(email.value, password.value)
+                },
+                colors = ButtonDefaults.buttonColors(
+                    containerColor = Color(android.graphics.Color.parseColor("#32CD32")) // LimeGreen
+                )
+            ) {
+                Text("Войти")
             }
 
             // Отображаем сообщение об ошибке, если авторизация не удалась

+ 20 - 11
app/src/main/java/com/example/fitmarcetplacekuzminiv/Screens/firstScreen.kt

@@ -23,16 +23,26 @@ import androidx.compose.ui.text.TextStyle
 import androidx.compose.ui.text.font.FontWeight
 import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.unit.sp
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.*
 
 @Composable
 fun FirstScreen(onNavigateToAuthScreen: () -> Unit) {
     Box(
-        modifier = Modifier.fillMaxSize()
-            .background(Brush.verticalGradient(
-                colors = listOf(Color.Gray, Color.Cyan, Color. White)
-            )),
+        modifier = Modifier
+            .fillMaxSize()
+            .background(
+                Brush.verticalGradient(
+                    colors = listOf(
+                        Color(android.graphics.Color.parseColor("#32CD32")),
+                        Color(android.graphics.Color.parseColor("#C0C0C0"))
+                    )
+                )
+            )
+            .clickable { // Переход при нажатии на любой участок экрана
+                onNavigateToAuthScreen()
+            },
         contentAlignment = Alignment.Center
-
     ) {
         Column(
             horizontalAlignment = Alignment.CenterHorizontally,
@@ -42,13 +52,11 @@ fun FirstScreen(onNavigateToAuthScreen: () -> Unit) {
                 .padding(16.dp)
         ) {
             Text(
-                text = "Welcome to the WorkOut",
+                text = "Добро пожаловать в WorkOut!",
                 style = TextStyle(fontSize = 35.sp, fontWeight = FontWeight.Bold),
-                modifier = Modifier.align(Alignment.CenterHorizontally))
-            Spacer(modifier = Modifier.height(38.dp))
-            Button(onClick = onNavigateToAuthScreen) {
-                Text("Go to Auth Screen")
-            }
+                color = Color.White,
+                modifier = Modifier.align(Alignment.CenterHorizontally)
+            )
         }
     }
 }
@@ -58,3 +66,4 @@ fun FirstScreen(onNavigateToAuthScreen: () -> Unit) {
 fun PreviewFirstScreen() {
     FirstScreen {}
 }
+