Sfoglia il codice sorgente

feat: create navigation, add search, create, update user functions

chirikh 1 settimana fa
parent
commit
fd85bd55aa

+ 16 - 0
Development/.idea/inspectionProfiles/Project_Default.xml

@@ -37,6 +37,10 @@
       <option name="composableFile" value="true" />
       <option name="composableFile" value="true" />
       <option name="previewFile" value="true" />
       <option name="previewFile" value="true" />
     </inspection_tool>
     </inspection_tool>
+    <inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+      <option name="previewFile" value="true" />
+    </inspection_tool>
     <inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
     <inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
       <option name="composableFile" value="true" />
       <option name="composableFile" value="true" />
       <option name="previewFile" value="true" />
       <option name="previewFile" value="true" />
@@ -45,6 +49,18 @@
       <option name="composableFile" value="true" />
       <option name="composableFile" value="true" />
       <option name="previewFile" value="true" />
       <option name="previewFile" value="true" />
     </inspection_tool>
     </inspection_tool>
+    <inspection_tool class="PreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+      <option name="previewFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="PreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+      <option name="previewFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="PreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+      <option name="previewFile" value="true" />
+    </inspection_tool>
     <inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
     <inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
       <option name="composableFile" value="true" />
       <option name="composableFile" value="true" />
       <option name="previewFile" value="true" />
       <option name="previewFile" value="true" />

+ 1 - 1
Development/.idea/other.xml

@@ -262,7 +262,7 @@
           <option name="codename" value="q6q" />
           <option name="codename" value="q6q" />
           <option name="id" value="q6q" />
           <option name="id" value="q6q" />
           <option name="manufacturer" value="Samsung" />
           <option name="manufacturer" value="Samsung" />
-          <option name="name" value="SM-F956B" />
+          <option name="name" value="Galaxy Z Fold6" />
           <option name="screenDensity" value="420" />
           <option name="screenDensity" value="420" />
           <option name="screenX" value="1856" />
           <option name="screenX" value="1856" />
           <option name="screenY" value="2160" />
           <option name="screenY" value="2160" />

+ 27 - 7
Development/app/src/main/java/com/example/development/MainActivity.kt

@@ -4,23 +4,43 @@ import android.os.Bundle
 import androidx.activity.ComponentActivity
 import androidx.activity.ComponentActivity
 import androidx.activity.compose.setContent
 import androidx.activity.compose.setContent
 import androidx.activity.enableEdgeToEdge
 import androidx.activity.enableEdgeToEdge
-import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.foundation.layout.padding
-import androidx.compose.material3.Scaffold
-import androidx.compose.material3.Text
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Surface
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.Composable
-import androidx.compose.ui.Modifier
 import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.tooling.preview.Preview
 import com.example.development.mainActivity.components.RegistrationScreen
 import com.example.development.mainActivity.components.RegistrationScreen
 import com.example.development.ui.theme.DevelopmentTheme
 import com.example.development.ui.theme.DevelopmentTheme
 import com.example.development.mainActivity.MainViewModel
 import com.example.development.mainActivity.MainViewModel
+import androidx.navigation.compose.NavHost
+import androidx.navigation.compose.composable
+import androidx.navigation.compose.rememberNavController
 import com.example.development.mainActivity.components.AuthorizationScreen
 import com.example.development.mainActivity.components.AuthorizationScreen
+import com.example.development.mainActivity.components.UserProfileForUnauthorizedUser
 
 
 class MainActivity : ComponentActivity() {
 class MainActivity : ComponentActivity() {
     override fun onCreate(savedInstanceState: Bundle?) {
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         super.onCreate(savedInstanceState)
         enableEdgeToEdge()
         enableEdgeToEdge()
-        setContent {
+        setContent { val viewModel = MainViewModel()
+            DevelopmentTheme {
+                Surface(color = MaterialTheme.colorScheme.background) {
+                    val navController = rememberNavController()
+
+                    NavHost(
+                        navController = navController,
+                        startDestination = "SplashScreen"
+                    ){
+                        composable("RegistrationScreen")
+                        {
+                            RegistrationScreen(navController, viewModel)
+                        }
+                        composable("AuthorizationScreen")
+                        {
+                            AuthorizationScreen(navController, viewModel)
+                        }
+                    }
+                }
+            }
         }
         }
     }
     }
 }
 }
@@ -29,6 +49,6 @@ class MainActivity : ComponentActivity() {
 @Composable
 @Composable
 fun GreetingPreview() {
 fun GreetingPreview() {
     DevelopmentTheme {
     DevelopmentTheme {
-        RegistrationScreen()
+        UserProfileForUnauthorizedUser()
     }
     }
 }
 }

+ 57 - 0
Development/app/src/main/java/com/example/development/mainActivity/MainViewModel.kt

@@ -86,4 +86,61 @@ class MainViewModel():ViewModel() {
             }
             }
         }
         }
     }
     }
+
+    fun CreateUser(firstName: String,
+                   secondName: String,
+                   email: String,
+                   phoneNumber: Int
+                   )
+    {
+        viewModelScope.launch {
+            try{
+                Constants.supabase.from("users").insert(
+                    User(
+                        role = 1,
+                        firstName = firstName,
+                        secondName = secondName,
+                        email = email,
+                        phoneNumber = phoneNumber,
+                        image = "",
+                        UID = Constants.supabase.auth.currentUserOrNull()!!.id
+                    )
+                )
+                println("Success")
+            }
+            catch (e: Exception)
+            {
+                println("Error")
+                println(e.message.toString())
+            }
+        }
+    }
+
+    fun ChangePersonalData(firstName: String,
+                           secondName: String,
+                           email: String,
+                           phoneNumber: Int)
+    {
+        viewModelScope.launch {
+            try{
+                Constants.supabase.from("users").update(
+                    User(
+                        role = 1,
+                        firstName = firstName,
+                        secondName = secondName,
+                        email = email,
+                        phoneNumber = phoneNumber,
+                        image = "",
+                        UID = Constants.supabase.auth.currentUserOrNull()!!.id
+                    )
+                )
+                println("Success")
+            }
+            catch (e: Exception)
+            {
+                println("Error")
+                println(e.message.toString())
+            }
+        }
+    }
 }
 }

+ 11 - 2
Development/app/src/main/java/com/example/development/mainActivity/components/AuthorizationPage.kt

@@ -37,12 +37,17 @@ import androidx.compose.ui.text.input.PasswordVisualTransformation
 import androidx.compose.ui.text.input.VisualTransformation
 import androidx.compose.ui.text.input.VisualTransformation
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.compose.ui.unit.sp
+import androidx.navigation.NavHostController
 import com.example.development.R
 import com.example.development.R
 import com.example.development.ui.theme.OldStandart
 import com.example.development.ui.theme.OldStandart
 import com.example.development.mainActivity.MainViewModel
 import com.example.development.mainActivity.MainViewModel
 
 
 @Composable
 @Composable
-fun AuthorizationScreen(){
+fun AuthorizationScreen(navController: NavHostController, viewModel: MainViewModel){
+    val users by viewModel.users
+    val email = remember { mutableStateOf("") }
+    val password = remember { mutableStateOf("") }
+    val flag = remember { mutableStateOf(false) }
     Box(contentAlignment = Alignment.TopCenter,
     Box(contentAlignment = Alignment.TopCenter,
         modifier = Modifier
         modifier = Modifier
             .fillMaxSize()
             .fillMaxSize()
@@ -116,7 +121,11 @@ fun AuthorizationScreen(){
                     }
                     }
                     Button(
                     Button(
                         modifier = Modifier.padding(top = 15.dp).height(50.dp).width(280.dp),
                         modifier = Modifier.padding(top = 15.dp).height(50.dp).width(280.dp),
-                        onClick = {},
+                        onClick = {
+                            viewModel.onSignInEmailPassword(email.value,password.value)
+                            viewModel.FindUser()
+                            flag.value = true
+                        },
                         shape = RoundedCornerShape(23.dp),
                         shape = RoundedCornerShape(23.dp),
                         border = BorderStroke(1.dp, Color(255,215,0)),
                         border = BorderStroke(1.dp, Color(255,215,0)),
                         colors = ButtonDefaults.buttonColors(
                         colors = ButtonDefaults.buttonColors(

+ 3 - 1
Development/app/src/main/java/com/example/development/mainActivity/components/MainPage.kt

@@ -45,11 +45,13 @@ import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.compose.ui.unit.sp
+import androidx.navigation.NavHostController
 import com.example.development.R
 import com.example.development.R
+import com.example.development.mainActivity.MainViewModel
 import com.example.development.ui.theme.OldStandart
 import com.example.development.ui.theme.OldStandart
 
 
 @Composable
 @Composable
-fun MainPage()
+fun MainPage(navController: NavHostController, viewModel: MainViewModel)
 {
 {
     Box(
     Box(
         contentAlignment = Alignment.TopCenter,
         contentAlignment = Alignment.TopCenter,

+ 39 - 12
Development/app/src/main/java/com/example/development/mainActivity/components/MenuPage.kt

@@ -46,12 +46,14 @@ import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.compose.ui.unit.sp
+import androidx.navigation.NavHostController
 import coil.compose.AsyncImagePainter
 import coil.compose.AsyncImagePainter
 import coil.compose.rememberAsyncImagePainter
 import coil.compose.rememberAsyncImagePainter
 import coil.request.ImageRequest
 import coil.request.ImageRequest
 import coil.size.Size
 import coil.size.Size
 import com.example.development.R
 import com.example.development.R
 import com.example.development.domain.utils.Constants
 import com.example.development.domain.utils.Constants
+import com.example.development.mainActivity.MainViewModel
 import io.github.jan.supabase.storage.BucketItem
 import io.github.jan.supabase.storage.BucketItem
 import com.example.development.model.Menu
 import com.example.development.model.Menu
 import com.example.development.ui.theme.OldStandart
 import com.example.development.ui.theme.OldStandart
@@ -60,7 +62,7 @@ import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.withContext
 import kotlinx.coroutines.withContext
 
 
 @Composable
 @Composable
-fun MenuPage()
+fun MenuPage(navController: NavHostController, viewModel: MainViewModel)
 {
 {
     var menu by remember { mutableStateOf<List<Menu>>(listOf()) }
     var menu by remember { mutableStateOf<List<Menu>>(listOf()) }
     var bucket: ByteArray? = null
     var bucket: ByteArray? = null
@@ -91,26 +93,51 @@ fun MenuPage()
         )
         )
         Column(
         Column(
             modifier = Modifier.fillMaxSize(),
             modifier = Modifier.fillMaxSize(),
-            verticalArrangement = Arrangement.Center,
+            verticalArrangement = Arrangement.Top,
             horizontalAlignment = Alignment.CenterHorizontally
             horizontalAlignment = Alignment.CenterHorizontally
         )
         )
         {
         {
-            Text("МЕНЮ",
-                color = Color(255, 215, 0),
-                modifier = Modifier.padding(top = 100.dp),
-                fontSize = 30.sp,
-                fontWeight = FontWeight.Bold,
-                fontFamily = OldStandart
-            )
+            Row(modifier = Modifier.padding(5.dp).fillMaxWidth(),
+                horizontalArrangement = Arrangement.End
+                ){
+                Text("МЕНЮ",
+                    color = Color(255, 215, 0),
+                    modifier = Modifier.padding(30.dp),
+                    fontSize = 30.sp,
+                    fontWeight = FontWeight.Bold,
+                    fontFamily = OldStandart
+                )
+                Button(
+                    modifier = Modifier
+                        .padding(0.dp),
+                    onClick = {},
+                    colors = ButtonDefaults.buttonColors(
+                        containerColor = Color(255, 215, 0, 0),
+                        contentColor = Color.Gray
+                    ),
+                    border = BorderStroke(0.dp, color = Color(255, 215, 0, 0))
+                )
+                {
+                    Image(
+                        painter = painterResource(id = R.drawable.home),
+                        contentDescription = "",
+                        contentScale = ContentScale.FillWidth,
+                        modifier = Modifier.width(60.dp).height(60.dp)
+                    )
+                }
+            }
+
             LazyColumn {
             LazyColumn {
                 items(
                 items(
                     menu,
                     menu,
                     key = { menu -> menu.id },
                     key = { menu -> menu.id },
                 ){
                 ){
                     menu ->
                     menu ->
-                    Row(Modifier.fillMaxWidth()
-                        .clip(RoundedCornerShape(15.dp))
-                        .background(color = Color.White)) {
+                    Row(
+                        Modifier
+                            .fillMaxWidth()
+                            .clip(RoundedCornerShape(15.dp))
+                            .background(color = Color.White)) {
                         Column(modifier = Modifier.padding(1.dp))
                         Column(modifier = Modifier.padding(1.dp))
                         {
                         {
                             val imageState = rememberAsyncImagePainter(
                             val imageState = rememberAsyncImagePainter(

+ 4 - 2
Development/app/src/main/java/com/example/development/mainActivity/components/PasswordRecovery.kt

@@ -39,11 +39,13 @@ import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.compose.ui.unit.sp
+import androidx.navigation.NavHostController
 import com.example.development.R
 import com.example.development.R
+import com.example.development.mainActivity.MainViewModel
 import com.example.development.ui.theme.OldStandart
 import com.example.development.ui.theme.OldStandart
 
 
 @Composable
 @Composable
-fun PasswordRecovery()
+fun PasswordRecovery(navController: NavHostController, viewModel: MainViewModel)
 {
 {
     Box(
     Box(
         contentAlignment = Alignment.TopCenter,
         contentAlignment = Alignment.TopCenter,
@@ -97,7 +99,7 @@ fun PasswordRecovery()
 }
 }
 
 
 @Composable
 @Composable
-fun PasswordRecovery2()
+fun PasswordRecovery2(navController: NavHostController, viewModel: MainViewModel)
 {
 {
     Box(
     Box(
         contentAlignment = Alignment.TopCenter,
         contentAlignment = Alignment.TopCenter,

+ 68 - 7
Development/app/src/main/java/com/example/development/mainActivity/components/RegistrationScreen.kt

@@ -2,7 +2,6 @@ package com.example.development.mainActivity.components
 
 
 import androidx.compose.foundation.BorderStroke
 import androidx.compose.foundation.BorderStroke
 import androidx.compose.foundation.Image
 import androidx.compose.foundation.Image
-import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Column
@@ -26,24 +25,24 @@ import androidx.compose.runtime.remember
 import androidx.compose.runtime.setValue
 import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.Modifier
-import androidx.compose.ui.draw.clip
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.layout.ContentScale
 import androidx.compose.ui.layout.ContentScale
 import androidx.compose.ui.res.painterResource
 import androidx.compose.ui.res.painterResource
-import androidx.compose.ui.text.font.FontFamily
-import androidx.compose.ui.text.font.FontStyle
 import androidx.compose.ui.text.font.FontWeight
 import androidx.compose.ui.text.font.FontWeight
 import androidx.compose.ui.text.input.PasswordVisualTransformation
 import androidx.compose.ui.text.input.PasswordVisualTransformation
 import androidx.compose.ui.text.input.VisualTransformation
 import androidx.compose.ui.text.input.VisualTransformation
-import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.compose.ui.unit.sp
+import androidx.navigation.NavHostController
 import com.example.development.R
 import com.example.development.R
 import com.example.development.ui.theme.OldStandart
 import com.example.development.ui.theme.OldStandart
 import com.example.development.mainActivity.MainViewModel
 import com.example.development.mainActivity.MainViewModel
 
 
 @Composable
 @Composable
-fun RegistrationScreen(){
+fun RegistrationScreen(navController: NavHostController, viewModel: MainViewModel) {
+    val viewModel = MainViewModel()
+    val email = remember { mutableStateOf("") }
+    val password = remember { mutableStateOf("") }
     Box(contentAlignment = Alignment.TopCenter,
     Box(contentAlignment = Alignment.TopCenter,
         modifier = Modifier
         modifier = Modifier
             .fillMaxSize()
             .fillMaxSize()
@@ -145,7 +144,9 @@ fun RegistrationScreen(){
                     }
                     }
                     Button(
                     Button(
                         modifier = Modifier.padding(top = 15.dp).height(50.dp),
                         modifier = Modifier.padding(top = 15.dp).height(50.dp),
-                        onClick = {},
+                        onClick = {
+                            viewModel.onSignUpEmail(email.value,password.value)
+                        },
                         shape = RoundedCornerShape(23.dp),
                         shape = RoundedCornerShape(23.dp),
                         border = BorderStroke(1.dp, Color(255,215,0)),
                         border = BorderStroke(1.dp, Color(255,215,0)),
                         colors = ButtonDefaults.buttonColors(
                         colors = ButtonDefaults.buttonColors(
@@ -232,4 +233,64 @@ fun RegistrationScreen(){
             }
             }
         }
         }
     }
     }
+}
+
+@Composable
+fun RegistarationScreen2(navController: NavHostController, viewModel: MainViewModel) {
+    Box(
+        contentAlignment = Alignment.TopCenter,
+        modifier = Modifier
+            .fillMaxSize()
+    )
+    {
+        Image(
+            painter = painterResource(id = R.drawable.fone),
+            contentDescription = "",
+            contentScale = ContentScale.FillWidth,
+            modifier = Modifier.fillMaxWidth().fillMaxHeight()
+        )
+        Column(modifier = Modifier.fillMaxHeight(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center)
+        {
+            Text("Для завершения регистрации введите следующие данные:",
+                color = Color.White,
+                modifier = Modifier.padding(bottom = 100.dp),
+                fontSize = 20.sp,
+                fontWeight = FontWeight.Bold,
+                fontFamily = OldStandart
+            )
+            TextField(
+                value = "Фамилия",
+                onValueChange = {},
+                Modifier.padding(bottom = 10.dp).width(280.dp)
+            )
+            TextField(
+                value = "Имя",
+                onValueChange = {},
+                Modifier.padding(bottom = 10.dp).width(280.dp)
+            )
+            TextField(
+                value = "Номер телефона",
+                onValueChange = {},
+                Modifier.padding(bottom = 30.dp).width(280.dp)
+            )
+            Button(modifier = Modifier
+                .width(width = 270.dp)
+                .height(height = 40.dp)
+                .padding(),
+                onClick = {},
+                shape = RoundedCornerShape(23.dp),
+                border = BorderStroke(0.dp, Color(0xFFEBEBEB)),
+                colors = ButtonDefaults.buttonColors(
+                    containerColor = Color(255,215,0),
+                    contentColor = Color.White)
+            )
+            {
+                Text("СОХРАНИТЬ", color = Color.White,
+                    modifier = Modifier.padding(),
+                    fontSize = 22.sp,
+                    fontWeight = FontWeight.Bold,
+                    fontFamily = OldStandart)
+            }
+        }
+    }
 }
 }

+ 63 - 10
Development/app/src/main/java/com/example/development/mainActivity/components/Reviews.kt

@@ -20,6 +20,9 @@ import androidx.compose.foundation.lazy.LazyColumn
 import androidx.compose.foundation.rememberScrollState
 import androidx.compose.foundation.rememberScrollState
 import androidx.compose.foundation.shape.RoundedCornerShape
 import androidx.compose.foundation.shape.RoundedCornerShape
 import androidx.compose.foundation.verticalScroll
 import androidx.compose.foundation.verticalScroll
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Star
+import androidx.compose.material.icons.outlined.Star
 import androidx.compose.material3.Button
 import androidx.compose.material3.Button
 import androidx.compose.material3.ButtonDefaults
 import androidx.compose.material3.ButtonDefaults
 import androidx.compose.material3.Icon
 import androidx.compose.material3.Icon
@@ -46,12 +49,14 @@ import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.compose.ui.unit.sp
+import androidx.navigation.NavHostController
 import com.example.development.R
 import com.example.development.R
+import com.example.development.mainActivity.MainViewModel
 import com.example.development.ui.theme.OldStandart
 import com.example.development.ui.theme.OldStandart
 
 
 
 
 @Composable
 @Composable
-fun Reviews()
+fun Reviews(navController: NavHostController, viewModel: MainViewModel)
 {
 {
 
 
     Box(contentAlignment = Alignment.TopCenter,
     Box(contentAlignment = Alignment.TopCenter,
@@ -69,20 +74,64 @@ fun Reviews()
         )
         )
         Column(modifier = Modifier.fillMaxSize(), verticalArrangement = Arrangement.Top, horizontalAlignment = Alignment.CenterHorizontally)
         Column(modifier = Modifier.fillMaxSize(), verticalArrangement = Arrangement.Top, horizontalAlignment = Alignment.CenterHorizontally)
         {
         {
-            Text("ОТЗЫВЫ",
-                color = Color.White,
-                modifier = Modifier.padding(top = 100.dp),
-                fontSize = 30.sp,
-                fontWeight = FontWeight.Bold,
-                fontFamily = FontFamily.Cursive
-            )
+            Row(modifier = Modifier
+                .padding(5.dp)
+                .fillMaxWidth(),
+                horizontalArrangement = Arrangement.End
+            ){
+                Text("ОТЗЫВЫ",
+                    color = Color(255, 215, 0),
+                    modifier = Modifier.padding(30.dp),
+                    fontSize = 30.sp,
+                    fontWeight = FontWeight.Bold,
+                    fontFamily = OldStandart
+                )
+                Button(
+                    modifier = Modifier
+                        .padding(0.dp),
+                    onClick = {},
+                    colors = ButtonDefaults.buttonColors(
+                        containerColor = Color(255, 215, 0, 0),
+                        contentColor = Color.Gray
+                    ),
+                    border = BorderStroke(0.dp, color = Color(255, 215, 0, 0))
+                )
+                {
+                    Image(
+                        painter = painterResource(id = R.drawable.home),
+                        contentDescription = "",
+                        contentScale = ContentScale.FillWidth,
+                        modifier = Modifier
+                            .width(60.dp)
+                            .height(60.dp)
+                    )
+                }
+            }
+        }
+    }
+}
+
+@Composable
+fun RatingBar(rating: Float, onRatingChanged: (Float) -> Unit)
+{
+    val stars = 5
+    Row{
+        for (i in 1..stars)
+        {
+            val starRating = i.toFloat()
+            IconButton(onClick = { onRatingChanged(starRating) }) {
+                Icon(
+                    imageVector = if (starRating <= rating) Icons.Filled.Star else Icons.Outlined.Star, contentDescription = "Star $starRating"
+                )
+            }
         }
         }
     }
     }
 }
 }
 
 
 @Composable
 @Composable
-fun CreateReviews()
+fun CreateReviews(navController: NavHostController, viewModel: MainViewModel)
 {
 {
+    var rating by remember { mutableStateOf(0f) }
     Box(contentAlignment = Alignment.TopCenter,
     Box(contentAlignment = Alignment.TopCenter,
         modifier = Modifier
         modifier = Modifier
             .fillMaxSize()
             .fillMaxSize()
@@ -106,10 +155,14 @@ fun CreateReviews()
                 fontFamily = OldStandart,
                 fontFamily = OldStandart,
                 textAlign = TextAlign.Center
                 textAlign = TextAlign.Center
             )
             )
+            RatingBar(rating) {newRating -> rating = newRating}
             TextField(
             TextField(
                 value = "",
                 value = "",
                 onValueChange = {},
                 onValueChange = {},
-                Modifier.padding(20.dp).fillMaxWidth().height(400.dp)
+                Modifier
+                    .padding(20.dp)
+                    .fillMaxWidth()
+                    .height(400.dp)
             )
             )
             Button(modifier = Modifier,
             Button(modifier = Modifier,
                 onClick = {},
                 onClick = {},

+ 3 - 1
Development/app/src/main/java/com/example/development/mainActivity/components/SplashScreen.kt

@@ -16,10 +16,12 @@ import androidx.compose.ui.Modifier
 import androidx.compose.ui.layout.ContentScale
 import androidx.compose.ui.layout.ContentScale
 import androidx.compose.ui.res.painterResource
 import androidx.compose.ui.res.painterResource
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.dp
+import androidx.navigation.NavHostController
 import com.example.development.R
 import com.example.development.R
+import com.example.development.mainActivity.MainViewModel
 
 
 @Composable
 @Composable
-fun SplashScreen() {
+fun SplashScreen(navController: NavHostController, viewModel: MainViewModel) {
     Box(
     Box(
         contentAlignment = Alignment.Center,
         contentAlignment = Alignment.Center,
         modifier = Modifier
         modifier = Modifier

+ 101 - 20
Development/app/src/main/java/com/example/development/mainActivity/components/TableReserve.kt

@@ -45,34 +45,93 @@ import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.compose.ui.unit.sp
+import androidx.navigation.NavHostController
 import com.example.development.R
 import com.example.development.R
+import com.example.development.mainActivity.MainViewModel
 import com.example.development.ui.theme.OldStandart
 import com.example.development.ui.theme.OldStandart
 
 
 @Composable
 @Composable
-fun TableReserve2()
-{
-    Box(contentAlignment = Alignment.TopCenter,
+fun TableReserve(navController: NavHostController, viewModel: MainViewModel) {
+    Box(
+        contentAlignment = Alignment.TopCenter,
         modifier = Modifier
         modifier = Modifier
             .fillMaxSize()
             .fillMaxSize()
     )
     )
     {
     {
-        Image(painter = painterResource(id = R.drawable.fone), contentDescription = "", contentScale = ContentScale.FillWidth, modifier = Modifier.fillMaxWidth().fillMaxHeight())
-        Column(modifier = Modifier, verticalArrangement = Arrangement.Top, horizontalAlignment = Alignment.End)
+        Image(
+            painter = painterResource(id = R.drawable.fone),
+            contentDescription = "",
+            contentScale = ContentScale.FillWidth,
+            modifier = Modifier.fillMaxWidth().fillMaxHeight()
+        )
+        Column(
+            modifier = Modifier
+                .padding(),
+            verticalArrangement = Arrangement.Center,
+            horizontalAlignment = Alignment.CenterHorizontally
+        )
         {
         {
-            Button(modifier = Modifier,
+            Row(modifier = Modifier.padding(5.dp).fillMaxWidth(),
+                horizontalArrangement = Arrangement.End, verticalAlignment = Alignment.CenterVertically
+            ){
+                Text("СХЕМА ЗАЛА",
+                    color = Color(255, 215, 0),
+                    modifier = Modifier,
+                    fontSize = 24.sp,
+                    fontWeight = FontWeight.Bold,
+                    fontFamily = OldStandart
+                )
+                Button(
+                    modifier = Modifier
+                        .padding(0.dp),
+                    onClick = {},
+                    colors = ButtonDefaults.buttonColors(
+                        containerColor = Color(255, 215, 0, 0),
+                        contentColor = Color.Gray
+                    ),
+                    border = BorderStroke(0.dp, color = Color(255, 215, 0, 0))
+                )
+                {
+                    Image(
+                        painter = painterResource(id = R.drawable.home),
+                        contentDescription = "",
+                        contentScale = ContentScale.FillWidth,
+                        modifier = Modifier.width(60.dp).height(60.dp)
+                    )
+                }
+            }
+            Image(
+                painter = painterResource(id = R.drawable.schema),
+                contentDescription = "",
+                contentScale = ContentScale.FillWidth,
+                modifier = Modifier
+            )
+            Button(modifier = Modifier
+                .width(width = 270.dp)
+                .height(height = 40.dp),
                 onClick = {},
                 onClick = {},
                 shape = RoundedCornerShape(23.dp),
                 shape = RoundedCornerShape(23.dp),
-                border = BorderStroke(0.dp, Color(255,215,0,0)),
+                border = BorderStroke(0.dp, Color(0xFFEBEBEB)),
                 colors = ButtonDefaults.buttonColors(
                 colors = ButtonDefaults.buttonColors(
-                    containerColor = Color(255,215,0,0),
+                    containerColor = Color(255,215,0),
                     contentColor = Color.White)
                     contentColor = Color.White)
-            ){
-                Image(painter = painterResource(id = R.drawable.home),
-                    contentDescription = "",
-                    contentScale = ContentScale.FillWidth,
-                    modifier = Modifier.width(70.dp).height(70.dp))
+            )
+            {
+                Text("ЗАБРОНИРОВАТЬ СТОЛ", fontFamily = OldStandart)
             }
             }
         }
         }
+    }
+}
+
+@Composable
+fun TableReserve2(navController: NavHostController, viewModel: MainViewModel)
+{
+    Box(contentAlignment = Alignment.TopCenter,
+        modifier = Modifier
+            .fillMaxSize()
+    )
+    {
+        Image(painter = painterResource(id = R.drawable.fone), contentDescription = "", contentScale = ContentScale.FillWidth, modifier = Modifier.fillMaxWidth().fillMaxHeight())
         Column(
         Column(
             modifier = Modifier
             modifier = Modifier
                 .padding(),
                 .padding(),
@@ -80,13 +139,35 @@ fun TableReserve2()
             horizontalAlignment = Alignment.CenterHorizontally
             horizontalAlignment = Alignment.CenterHorizontally
         )
         )
         {
         {
-            Text("РЕЗЕРВ СТОЛА",
-            color = Color.White,
-            modifier = Modifier.padding(top = 100.dp),
-            fontSize = 30.sp,
-            fontWeight = FontWeight.Bold,
-                fontFamily = OldStandart
-        )
+            Row(modifier = Modifier.padding(5.dp).fillMaxWidth(),
+                horizontalArrangement = Arrangement.End, verticalAlignment = Alignment.CenterVertically
+            ){
+                Text("РЕЗЕРВ СТОЛА",
+                    color = Color(255, 215, 0),
+                    modifier = Modifier,
+                    fontSize = 24.sp,
+                    fontWeight = FontWeight.Bold,
+                    fontFamily = OldStandart
+                )
+                Button(
+                    modifier = Modifier
+                        .padding(0.dp),
+                    onClick = {},
+                    colors = ButtonDefaults.buttonColors(
+                        containerColor = Color(255, 215, 0, 0),
+                        contentColor = Color.Gray
+                    ),
+                    border = BorderStroke(0.dp, color = Color(255, 215, 0, 0))
+                )
+                {
+                    Image(
+                        painter = painterResource(id = R.drawable.home),
+                        contentDescription = "",
+                        contentScale = ContentScale.FillWidth,
+                        modifier = Modifier.width(60.dp).height(60.dp)
+                    )
+                }
+            }
             Text(
             Text(
                 "Имя *",
                 "Имя *",
                 fontSize = 16.sp,
                 fontSize = 16.sp,

+ 76 - 2
Development/app/src/main/java/com/example/development/mainActivity/components/UserProfile.kt

@@ -45,11 +45,13 @@ import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.TextUnit
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.compose.ui.unit.sp
+import androidx.navigation.NavHostController
 import com.example.development.R
 import com.example.development.R
+import com.example.development.mainActivity.MainViewModel
 import com.example.development.ui.theme.OldStandart
 import com.example.development.ui.theme.OldStandart
 
 
 @Composable
 @Composable
-fun UserProfile(){
+fun UserProfile(navController: NavHostController, viewModel: MainViewModel){
     Box(contentAlignment = Alignment.TopCenter,
     Box(contentAlignment = Alignment.TopCenter,
         modifier = Modifier
         modifier = Modifier
             .fillMaxSize()
             .fillMaxSize()
@@ -225,7 +227,7 @@ fun UserProfile(){
 
 
 
 
 @Composable
 @Composable
-fun UserProfile2()
+fun UserProfile2(navController: NavHostController, viewModel: MainViewModel)
 {
 {
     Box(contentAlignment = Alignment.TopCenter,
     Box(contentAlignment = Alignment.TopCenter,
         modifier = Modifier
         modifier = Modifier
@@ -318,4 +320,76 @@ fun UserProfile2()
             }
             }
         }
         }
     }
     }
+}
+
+@Composable
+fun UserProfileForUnauthorizedUser()
+{
+    Box(contentAlignment = Alignment.TopCenter,
+        modifier = Modifier
+            .fillMaxSize()
+    )
+    {
+        Image(
+            painter = painterResource(id = R.drawable.fone),
+            contentDescription = "",
+            contentScale = ContentScale.FillWidth,
+            modifier = Modifier
+                .fillMaxWidth()
+                .fillMaxHeight()
+        )
+        Column(modifier = Modifier.fillMaxSize(),
+            verticalArrangement = Arrangement.Center,
+            horizontalAlignment = Alignment.CenterHorizontally,
+            )
+        {
+            Text("Похоже, вы не вошли в систему\nАвторизируйтесь или создайте аккаунт для использования всех функций приложения",
+                fontSize = 18.sp,
+                color = Color.White,
+                fontWeight = FontWeight.Normal,
+                fontFamily = OldStandart,
+                softWrap = true,
+                textAlign = TextAlign.Center)
+            Button(
+                modifier = Modifier
+                    .padding(top = 20.dp),
+                onClick = {},
+                colors = ButtonDefaults.buttonColors(
+                    containerColor = Color(255, 215, 0),
+                    contentColor = Color.Gray
+                ),
+                border = BorderStroke(0.dp, color = Color(255, 215, 0))
+            )
+            {
+                Text(
+                    "РЕГИСТРАЦИЯ",
+                    fontSize = 18.sp,
+                    color = Color.White,
+                    fontWeight = FontWeight.Normal,
+                    textAlign = TextAlign.Center,
+                    fontFamily = OldStandart
+                )
+            }
+            Button(
+                modifier = Modifier
+                    .padding(0.dp),
+                onClick = {},
+                colors = ButtonDefaults.buttonColors(
+                    containerColor = Color(255, 215, 0),
+                    contentColor = Color.Gray
+                ),
+                border = BorderStroke(0.dp, color = Color(255, 215, 0))
+            )
+            {
+                Text(
+                    "АВТОРИЗАЦИЯ",
+                    fontSize = 18.sp,
+                    color = Color.White,
+                    fontWeight = FontWeight.Normal,
+                    textAlign = TextAlign.Center,
+                    fontFamily = OldStandart
+                )
+            }
+        }
+    }
 }
 }

+ 0 - 101
Development/app/src/main/java/com/example/development/mainActivity/components/registration2.kt

@@ -1,101 +0,0 @@
-package com.example.development.mainActivity.components
-
-import androidx.compose.foundation.BorderStroke
-import androidx.compose.foundation.Image
-import androidx.compose.foundation.background
-import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.fillMaxHeight
-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.width
-import androidx.compose.foundation.shape.RoundedCornerShape
-import androidx.compose.material3.Button
-import androidx.compose.material3.ButtonDefaults
-import androidx.compose.material3.Icon
-import androidx.compose.material3.IconButton
-import androidx.compose.material3.Text
-import androidx.compose.material3.TextField
-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.layout.ContentScale
-import androidx.compose.ui.res.painterResource
-import androidx.compose.ui.text.font.FontFamily
-import androidx.compose.ui.text.font.FontStyle
-import androidx.compose.ui.text.font.FontWeight
-import androidx.compose.ui.text.input.PasswordVisualTransformation
-import androidx.compose.ui.text.input.VisualTransformation
-import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
-import com.example.development.R
-import com.example.development.ui.theme.OldStandart
-
-@Composable
-fun Registaration2() {
-    Box(
-        contentAlignment = Alignment.TopCenter,
-        modifier = Modifier
-            .fillMaxSize()
-    )
-    {
-        Image(
-            painter = painterResource(id = R.drawable.fone),
-            contentDescription = "",
-            contentScale = ContentScale.FillWidth,
-            modifier = Modifier.fillMaxWidth().fillMaxHeight()
-        )
-        Column(modifier = Modifier.fillMaxHeight(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center)
-        {
-            Text("Для завершения регистрации введите следующие данные:",
-                color = Color.White,
-                modifier = Modifier.padding(bottom = 100.dp),
-                fontSize = 20.sp,
-                fontWeight = FontWeight.Bold,
-                fontFamily = OldStandart
-            )
-            TextField(
-                value = "Фамилия",
-                onValueChange = {},
-                Modifier.padding(bottom = 10.dp).width(280.dp)
-            )
-            TextField(
-                value = "Имя",
-                onValueChange = {},
-                Modifier.padding(bottom = 10.dp).width(280.dp)
-            )
-            TextField(
-                value = "Номер телефона",
-                onValueChange = {},
-                Modifier.padding(bottom = 30.dp).width(280.dp)
-            )
-            Button(modifier = Modifier
-                .width(width = 270.dp)
-                .height(height = 40.dp)
-                .padding(),
-                onClick = {},
-                shape = RoundedCornerShape(23.dp),
-                border = BorderStroke(0.dp, Color(0xFFEBEBEB)),
-                colors = ButtonDefaults.buttonColors(
-                    containerColor = Color(255,215,0),
-                    contentColor = Color.White)
-            )
-            {
-                Text("СОХРАНИТЬ", color = Color.White,
-                    modifier = Modifier.padding(),
-                    fontSize = 22.sp,
-                    fontWeight = FontWeight.Bold,
-                    fontFamily = OldStandart)
-            }
-        }
-    }
-}

BIN
Development/app/src/main/res/drawable/schema.png