Forráskód Böngészése

update AuthScreen

КурносовИН 1 hete
szülő
commit
5088508d42

+ 59 - 10
Project/app/src/main/java/com/example/mygymapp/view/mainActivity/components/AuthScreen.kt

@@ -6,30 +6,40 @@ import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.layout.size
 import androidx.compose.foundation.shape.CornerSize
 import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material3.Button
 import androidx.compose.material3.MaterialTheme
 import androidx.compose.material3.Text
 import androidx.compose.material3.TextField
 import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
 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.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import com.example.mygymapp.R
 import com.example.mygymapp.ui.theme.BlueBlack
 import com.example.mygymapp.ui.theme.BlueDark
+import com.example.mygymapp.ui.theme.Pearl
 import com.example.mygymapp.ui.theme.chivoFontFamily
+import com.example.mygymapp.view.mainActivity.MainViewModel
 
 @Preview
 @Composable
 fun AuthScreen(){
+    val viewModel = MainViewModel()
+    val email = remember { mutableStateOf("")}
+    val password = remember { mutableStateOf("")}
     Column(
         Modifier
             .background(color = BlueBlack)
@@ -53,20 +63,59 @@ fun AuthScreen(){
             modifier = Modifier
                 .size(width = 300.dp, height = 400.dp)
                 .padding(top = 50.dp)
-                .background(color = BlueDark, shape = RoundedCornerShape(25.dp)),
-            content = {
-                Text(
-                    text = "Авторизация", fontSize = 24.sp, color = Color(0xFFFefcfb),
-                    fontFamily = chivoFontFamily,
-                    modifier = Modifier
-                        .padding(top = 25.dp)
-                        .align(alignment = Alignment.TopCenter),
-                )
+                .background(color = BlueDark, shape = RoundedCornerShape(25.dp))
+        ) {
+            Text(
+                text = "Авторизация", fontSize = 24.sp, color = Color(0xFFFefcfb),
+                fontFamily = chivoFontFamily,
+                modifier = Modifier
+                    .padding(top = 25.dp)
+                    .align(alignment = Alignment.TopCenter),
+            )
+            Text(
+                text = "Логин", fontSize = 14.sp, color = Color(0xFFFefcfb),
+                fontFamily = chivoFontFamily,
+                modifier = Modifier
+                    .padding(top = 110.dp, start = 30.dp)
+
+            )
+            TextField(
+                value = email.value,
+                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(40.dp),
+                placeholder = { Text("Введите логин") }
+            )
 
+            Text(
+                text = "Пароль", fontSize = 14.sp, color = Color(0xFFFefcfb),
+                fontFamily = chivoFontFamily,
+                modifier = Modifier
+                    .padding(top = 195.dp, start = 30.dp)
 
+            )
+            TextField(
+                value = password.value,
+                onValueChange = {password.value = it},
+                textStyle = TextStyle(fontSize = 14.sp, color = BlueDark),
+                shape = RoundedCornerShape(5.dp),
+                modifier = Modifier
+                    .padding(top = 220.dp, start = 30.dp, end = 30.dp)
+                    .height(40.dp),
+                placeholder = { Text("Введите пароль") }
 
+            )
+
+            Button(onClick = { /*TODO*/ }) {
+                Text("Войти")
             }
-        )
+
+
+
+        }
     }
 
 }

+ 1 - 1
Project/gradle/libs.versions.toml

@@ -1,5 +1,5 @@
 [versions]
-agp = "8.6.1"
+agp = "8.5.1"
 authKt = "3.0.1"
 bom = "2.6.1"
 kotlin = "2.0.0"