浏览代码

Update MainMenuScreen

Иван 4 天之前
父节点
当前提交
4f9565f3a8
共有 1 个文件被更改,包括 104 次插入65 次删除
  1. 104 65
      Project/app/src/main/java/com/example/mygymapp/view/mainActivity/components/MainMenuScreen.kt

+ 104 - 65
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,87 +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),
-        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, bottom = 10.dp)
-        )
 
-        Row(
+        Column(
             modifier = Modifier
-                .size(width = 325.dp, height = 190.dp),
-            horizontalArrangement = Arrangement.SpaceBetween,
-            verticalAlignment = Alignment.CenterVertically,
+            .background(color = BlueBlack)
+            .padding(bottom = 40.dp)
+            .fillMaxWidth()
+            .fillMaxHeight(),
+            verticalArrangement = Arrangement.Center,
+            horizontalAlignment = Alignment.CenterHorizontally,
         ) {
+
             Box(modifier = Modifier
-                .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,
+                .size(width = 325.dp, height = 150.dp)
+                .background(color = BlueDark, shape = RoundedCornerShape(25.dp)),
+            ) {
+                Image(painter = painterResource(R.drawable.grid),
+                    contentDescription = "",
                     modifier = Modifier
-                        .padding(end = 10.dp)
-                        .align(alignment = Alignment.BottomCenter)
+                        .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(modifier = Modifier
-                .weight(1f)
-                .size(width = 150.dp, height = 185.dp)
-            ){
+            Row(
+                modifier = Modifier
+                    .size(width = 325.dp, height = 190.dp),
+                horizontalArrangement = Arrangement.SpaceBetween,
+                verticalAlignment = Alignment.CenterVertically,
+            ) {
                 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 = "",
+                    .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(start = 15.dp)
-                        .align(alignment = Alignment.BottomCenter)
-                )
             }
         }
     }
-}
+}
+