2 Commits f087957544 ... 4f9565f3a8

Autore SHA1 Messaggio Data
  Иван 4f9565f3a8 Update MainMenuScreen 4 giorni fa
  Иван d191aaa655 update MainMenuScreen 6 giorni fa

+ 105 - 58
Project/app/src/main/java/com/example/mygymapp/view/mainActivity/components/MainMenuScreen.kt

@@ -3,22 +3,35 @@ package com.example.mygymapp.view.mainActivity.components
 import androidx.compose.foundation.Image
 import androidx.compose.foundation.background
 import androidx.compose.foundation.border
+import androidx.compose.foundation.clickable
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxHeight
 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.shape.RoundedCornerShape
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Menu
+import androidx.compose.material3.Icon
+import androidx.compose.material3.IconButton
 import androidx.compose.material3.Text
 import androidx.compose.material3.rememberSwipeToDismissBoxState
 import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.res.painterResource
 import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.navigation.NavHostController
@@ -31,79 +44,113 @@ import com.example.mygymapp.ui.theme.chivoFontFamily
 @Composable
 fun MainMenuScreen()
 {
+    var selectedItem by remember { mutableStateOf("Абонементы") }
+    var drawerState by remember { mutableStateOf(false) }
+    val scope = rememberCoroutineScope()
+
+    val items = listOf("Выйти", "Главное меню", "Абонементы", "Тренеры", "Расписание")
+
     Column(
         Modifier
             .background(color = BlueBlack)
-            .padding(start = 15.dp, end = 15.dp)
-            .border(1.dp, Color.Black),
-        verticalArrangement = Arrangement.Center,
-        horizontalAlignment = Alignment.CenterHorizontally,
-    ){
+    ) {
         Box(modifier = Modifier
-            .size(width = 325.dp, height = 150.dp)
-            .background(color = BlueDark, shape = RoundedCornerShape(25.dp))
-                ) {
-            Image(
-                painter = painterResource(R.drawable.grid),
-                contentDescription = "",
-                modifier = Modifier
-                    .align(alignment = Alignment.Center)
-                    .size(90.dp),
-            )
+            .height(70.dp)
+            .background(color = BlueDark)
+            .fillMaxWidth()
+        ){
+            IconButton(onClick = { drawerState = !drawerState }, modifier = Modifier
+                .align(alignment = Alignment.CenterStart)) {
+                Icon(Icons.Filled.Menu, contentDescription = "Меню", tint = Color.White, modifier = Modifier
+                    .size(35.dp))
+            }
         }
-        Text(
-            text = "Абонементы", fontSize = 24.sp, color = Color(0xFFFefcfb),
-            fontFamily = chivoFontFamily,
-            modifier = Modifier.padding(top = 10.dp)
-        )
 
-        Row(
-            horizontalArrangement = Arrangement.SpaceBetween,
-            verticalAlignment = Alignment.CenterVertically,
+        Column(
+            modifier = Modifier
+            .background(color = BlueBlack)
+            .padding(bottom = 40.dp)
+            .fillMaxWidth()
+            .fillMaxHeight(),
+            verticalArrangement = Arrangement.Center,
+            horizontalAlignment = Alignment.CenterHorizontally,
         ) {
-            Box(){
-                Box(modifier = Modifier
-                    .padding(top = 40.dp)
-                    .size(width = 150.dp, height = 150.dp)
-                    .background(color = BlueDark, shape = RoundedCornerShape(25.dp))
-                ) {
-                    Image(
-                        painter = painterResource(R.drawable.users),
-                        contentDescription = "",
-                        modifier = Modifier
-                            .align(alignment = Alignment.Center)
-                            .size(70.dp))
-                }
-                Text(
-                    text = "Тренеры", fontSize = 24.sp, color = Color(0xFFFefcfb),
-                    fontFamily = chivoFontFamily,
+
+            Box(modifier = Modifier
+                .size(width = 325.dp, height = 150.dp)
+                .background(color = BlueDark, shape = RoundedCornerShape(25.dp)),
+            ) {
+                Image(painter = painterResource(R.drawable.grid),
+                    contentDescription = "",
                     modifier = Modifier
-                        .padding(top = 200.dp)
                         .align(alignment = Alignment.Center)
+                        .size(90.dp),
                 )
             }
+            Text(
+                text = "Абонементы", fontSize = 24.sp, color = Color(0xFFFefcfb),
+                fontFamily = chivoFontFamily,
+                modifier = Modifier.padding(top = 10.dp, bottom = 10.dp)
+            )
 
-            Box(){
+            Row(
+                modifier = Modifier
+                    .size(width = 325.dp, height = 190.dp),
+                horizontalArrangement = Arrangement.SpaceBetween,
+                verticalAlignment = Alignment.CenterVertically,
+            ) {
                 Box(modifier = Modifier
-                    .padding(start = 25.dp,)
-                    .size(width = 150.dp, height = 150.dp)
-                    .background(color = BlueDark, shape = RoundedCornerShape(25.dp))
-                ) {
-                    Image(
-                        painter = painterResource(R.drawable.clock),
-                        contentDescription = "",
+                    .weight(1f)
+                    .size(width = 150.dp, height = 185.dp)
+                ){
+                    Box(modifier = Modifier
+                        .padding()
+                        .size(width = 150.dp, height = 150.dp)
+                        .background(color = BlueDark, shape = RoundedCornerShape(25.dp))
+                    ) {
+                        Image(
+                            painter = painterResource(R.drawable.users),
+                            contentDescription = "",
+                            modifier = Modifier
+                                .align(alignment = Alignment.Center)
+                                .size(70.dp))
+                    }
+                    Text(
+                        text = "Тренеры", fontSize = 24.sp, color = Color(0xFFFefcfb),
+                        fontFamily = chivoFontFamily,
                         modifier = Modifier
-                            .align(alignment = Alignment.Center)
-                            .size(75.dp))
+                            .padding(end = 10.dp)
+                            .align(alignment = Alignment.BottomCenter)
+                    )
+                }
+
+                Box(modifier = Modifier
+                    .weight(1f)
+                    .size(width = 150.dp, height = 185.dp)
+                ){
+                    Box(modifier = Modifier
+                        .padding()
+                        .align(Alignment.TopEnd)
+                        .size(width = 150.dp, height = 150.dp)
+                        .background(color = BlueDark, shape = RoundedCornerShape(25.dp))
+                    ) {
+                        Image(
+                            painter = painterResource(R.drawable.clock),
+                            contentDescription = "",
+                            modifier = Modifier
+                                .align(alignment = Alignment.Center)
+                                .size(75.dp))
+                    }
+                    Text(
+                        text = "Расписание", fontSize = 24.sp, color = Color(0xFFFefcfb),
+                        fontFamily = chivoFontFamily,
+                        modifier = Modifier
+                            .padding(start = 15.dp)
+                            .align(alignment = Alignment.BottomCenter)
+                    )
                 }
-                Text(
-                    text = "Расписание", fontSize = 24.sp, color = Color(0xFFFefcfb),
-                    fontFamily = chivoFontFamily,
-                    modifier = Modifier
-                        .padding(top = 200.dp)
-                        .align(alignment = Alignment.Center)
-                )
             }
         }
     }
-}
+}
+

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

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