Browse Source

доделал вывод в menuV
сделал вывод данных в PlaceV
сделал вывод данных в ProfileV
и начал делать в Menu выдвижную шторку

AlexMin 2 days ago
parent
commit
907372200c

BIN
.gradle/8.7/executionHistory/executionHistory.bin


BIN
.gradle/8.7/executionHistory/executionHistory.lock


BIN
.gradle/8.7/fileHashes/fileHashes.bin


BIN
.gradle/8.7/fileHashes/fileHashes.lock


BIN
.gradle/8.7/fileHashes/resourceHashesCache.bin


BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock


BIN
.gradle/file-system.probe


+ 75 - 1
app/src/main/java/com/example/iplace/main/viewModel/MainViewModel.kt

@@ -105,7 +105,7 @@ class MainViewModel(): ViewModel() {
                 }
 
                 val idUser = Constants.supabase.auth.currentUserOrNull()?.id ?: return@launch
-                val newUser = Users(id_UUID = idUser, name = nameUser, address = address, about_me = about_me, id_genderFK = 1, img_user = "dsad")
+                val newUser = Users(id_uuid = idUser, name = nameUser, address = address, about_me = about_me, id_genderFK = 1, img_user = "dsad")
 
                 Constants.supabase.from("users").insert(newUser)
 
@@ -131,6 +131,80 @@ class MainViewModel(): ViewModel() {
             }
         }.decodeSingle<Place>()
 
+    private val _user = mutableStateOf<Users?>(null)
+    val user: State<Users?> = _user
+
+    suspend fun getUserById() {
+        try {
+            // Получаем email и password из authData
+            val email = authData.value.email
+            val password = authData.value.password
+
+            // Проверяем, авторизован ли пользователь
+            if (Constants.supabase.auth.currentUserOrNull() == null) {
+                // Если нет, то пытаемся авторизоваться с сохраненными данными
+                if (email.isNotEmpty() && password.isNotEmpty()) {
+                    Constants.supabase.auth.signInWith(Email) {
+                        this.email = email
+                        this.password = password
+                    }
+                } else {
+                    // Обработка ситуации, когда нет сохраненных данных
+                    Log.e("AddNewUserInTable", "No user data found for sign-in.")
+                    return
+                }
+            }
+            val idUser = Constants.supabase.auth.currentUserOrNull()?.id ?: return
+
+            val userResult = Constants.supabase.from("users")
+                .select(columns = Columns.list("name","address","about_me","id_genderFK","img_user","id_uuid")){
+                    filter {
+                        Users::id_uuid eq idUser
+                    }
+                }.decodeSingle<Users>()
+
+            // Обновляем состояние _user в ViewModel
+            _user.value = userResult
+
+        } catch (e: Exception) {
+            Log.e("getPlaceById", "Error : ${e.message}")
+        }
+    }
+
+    suspend fun  insertPlace(place: Place){
+        Constants.supabase.from("place")
+            .insert(place)
+    }
+    suspend fun  deletePlace(place: Place){
+        Constants.supabase.from("place")
+            .delete{
+                filter {
+                    Place::id_place eq place.id_place
+                }
+            }
+    }
+    suspend fun  upsertPlace(place: Place){
+        Constants.supabase.from("place")
+            .upsert(Place)
+    }
+    suspend fun  updatePlace(place: Place){
+        Constants.supabase.from("place")
+            .update(
+                {
+                    set("title", place.title)
+                    set("img_place", place.img_place)
+                    set("id_categoryFK", place.id_categoryFK)
+                    set("description", place.description)
+                    set("address", place.address)
+                    set("mapping", place.mapping)
+                    set("author", place.author)
+                }
+            ) {
+                filter {
+                    Place::id_place eq place.id_place
+                }
+            }
+    }
 
 }
 

+ 116 - 182
app/src/main/java/com/example/iplace/main/viewModel/dataView/MenuV.kt

@@ -42,9 +42,12 @@ import androidx.compose.foundation.lazy.items
 import androidx.compose.material.icons.Icons
 import androidx.compose.material.icons.filled.Menu
 import androidx.compose.material.icons.filled.Person
+import androidx.compose.material3.DrawerValue
 import androidx.compose.material3.ExperimentalMaterial3Api
+import androidx.compose.material3.ModalNavigationDrawer
 import androidx.compose.material3.Scaffold
 import androidx.compose.material3.TopAppBar
+import androidx.compose.material3.rememberDrawerState
 import androidx.compose.runtime.*
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
@@ -61,7 +64,6 @@ import com.example.iplace.model.Place
 @Composable
 fun MenuV(navController: NavHostController){
     val viewModel = MainViewModel()
-    var showDrawer by remember { mutableStateOf(false) }
 
     var placeList by remember { mutableStateOf<List<Place>>(emptyList()) }
 //    LaunchedEffect(key1 = true) {
@@ -84,179 +86,110 @@ fun MenuV(navController: NavHostController){
         contentScale = ContentScale.FillHeight,
         modifier = Modifier.fillMaxSize()
     )
-    // Шторка (Drawer)
-    AnimatedVisibility(
-        visible = showDrawer,
-        enter = slideInHorizontally { it },
-        exit = slideOutHorizontally { -it }
+
+    var showDrawer by remember { mutableStateOf(false) }
+    //с 7:44
+    ModalNavigationDrawer(
+        modifier = Modifier
+            .fillMaxWidth(0.8f)
+        ,
+
+       drawerContent = {
+           DrawerContent(navController)
+   }
     ) {
-        Box(
-            modifier = Modifier
-                .fillMaxSize()
-                .background(Color.White.copy(alpha = 0.8f)) // Полупрозрачный фон
-                .clickable { showDrawer = false } // Закрытие при клике вне шторки
-        ) {
-            Column(
-                modifier = Modifier
-                    .fillMaxSize()
-                    .background(Color.White)
-                    .padding(16.dp)
-            ) {
-//        IconButton(onClick = { showDrawer = false }) {
-//            Icon(Icons.Filled.Menu, contentDescription = "Закрыть")
-//        }
-                Button(
-                    onClick = { navController.navigate("profile") },
-                    modifier = Modifier.width(290.dp).height(50.dp),
-                    colors = ButtonDefaults.buttonColors(brown_contrast)
-                ) {
-                    Text(
-                        text = "Профиль",
-                        fontSize = 24.sp,
-                        fontFamily = basicNunitosans
-                    )
-                }
-                Button(
-                    onClick = { navController.navigate("favouritesV") },
-                    modifier = Modifier.width(290.dp).height(50.dp),
-                    colors = ButtonDefaults.buttonColors(brown_contrast)
-                ) {
-                    Text(
-                        text = "Избранное",
-                        fontSize = 24.sp,
-                        fontFamily = basicNunitosans
-                    )
-                }
-                Button(
-                    onClick = { navController.navigate("addPlace") },
-                    modifier = Modifier.width(290.dp).height(50.dp),
-                    colors = ButtonDefaults.buttonColors(brown_contrast)
-                ) {
-                    Text(
-                        text = "Добавить место",
-                        fontSize = 24.sp,
-                        fontFamily = basicNunitosans
-                    )
-                }
-                Button(
-                    onClick = { navController.navigate("menuV") },
-                    modifier = Modifier.width(290.dp).height(50.dp),
-                    colors = ButtonDefaults.buttonColors(brown_contrast)
-                ) {
-                    Text(
-                        text = "Меню",
-                        fontSize = 24.sp,
-                        fontFamily = basicNunitosans
-                    )
-                }
-                Button(
-                    onClick = {  },
-                    modifier = Modifier.width(290.dp).height(50.dp),
-                    colors = ButtonDefaults.buttonColors(brown_contrast)
-                ) {
-                    Text(
-                        text = "Ещё",
-                        fontSize = 24.sp,
-                        fontFamily = basicNunitosans
-                    )
-                }
+       Scaffold(
+           topBar = {
+               TopAppBar(
 
-            }
-        }
-    }
+                   title = {
+                       Row(
+                           modifier = Modifier.fillMaxWidth(),
+                           horizontalArrangement = Arrangement.SpaceBetween,
+                           verticalAlignment = Alignment.CenterVertically
+                       ) {
+                           IconButton(onClick = { showDrawer = true }) {
+                               Icon(Icons.Filled.Menu, contentDescription = "Меню")
+                           }
+
+                           OutlinedTextField(
+                               value = "",
+                               onValueChange = {},
+                               label = { Text("Поиск") },
+                               modifier = Modifier
+                                   .fillMaxWidth()
+                                   .padding(horizontal = 16.dp)
+                                   .weight(1f)
+                                   .clip(RoundedCornerShape(20.dp))
+                           )
+
+                           IconButton(onClick = { navController.navigate("profile") }) {
+                               Icon(Icons.Filled.Person, contentDescription = "Профиль")
+                           }
+                       }
+                   }
+
+               )
+           }
+
+       ) { innerPadding ->
+           Column(
+               modifier = Modifier
+                   .fillMaxSize()
+                   .padding(innerPadding)
+           ) {
+               // Кнопка "Фильтр" с выпадающим списком (заглушка)
+               Row(
+                   modifier = Modifier
+                       .fillMaxWidth()
+                       .padding(16.dp),
+                   verticalAlignment = Alignment.CenterVertically
+               ) {
+                   Button(onClick = { /* Обработка нажатия на фильтр */ }) {
+                       Text("Фильтр")
+                   }
+                   // Выпадающий список (заглушка)
+                   Spacer(modifier = Modifier.width(8.dp))
+                   // ...
+                   Button(
+                       onClick = { navController.navigate("addPlace") },
+                       modifier = Modifier
+                           .width(40.dp)
+                           .height(40.dp),
+                       colors = ButtonDefaults.buttonColors(brown_contrast)
+                   ) {
+                       Text(text = "добавить место")
+                   }
+
+               }
+               Text(
+                   text = "Лучшие места",
+                   fontWeight = FontWeight.Bold,
+                   modifier = Modifier
+                       .fillMaxWidth(),
+                   textAlign = TextAlign.Center
+               )
+               LazyColumn(
+                   contentPadding = PaddingValues(
+                       horizontal = 16.dp,
+                       vertical = 10.dp),
+                   verticalArrangement = Arrangement.spacedBy(10.dp)
+               ){
+                   items(placeList) {
+                           place ->
+                       PlaceCard(place = place, navController
+
+                       )
+                   }
+
+               }
+           }
+       }
+   }
 
 
-    Scaffold(
-        topBar = {
-            TopAppBar(
-                title = {
-                    // Кнопка меню
-                    Row(
-                        modifier = Modifier.fillMaxWidth(),
-                        horizontalArrangement = Arrangement.SpaceBetween,
-                        verticalAlignment = Alignment.CenterVertically
-                    ) {
-                        IconButton(onClick = { showDrawer  = true} ) {
-                            Icon(Icons.Filled.Menu, contentDescription = "Меню")
-                        }
-                        OutlinedTextField(
-                            value = "",
-                            onValueChange = {},
-                            label = { Text("Поиск") },
-                            modifier = Modifier
-                                .fillMaxWidth()
-                                .padding(horizontal = 16.dp)
-                                .weight(1f)
-                                .clip(RoundedCornerShape(20.dp))
-                        )// Заглушка для поиска
-//                        Text(text = "Поиск", modifier = Modifier.weight(1f))
-                        IconButton(onClick = { navController.navigate("profile") }) {
-                            Icon(Icons.Filled.Person, contentDescription = "Профиль")
-                        }
-                    }
-                }
-//                ,backgroundColor = Color.White,
-//                elevation = 0.dp
-            )
-        }
-//        ,
-//        drawerContent = {
-//            DrawerContent(showDrawer, navController)
-//        },
-//        drawerGesturesEnabled = showDrawer
-    ) { innerPadding ->
-        Column(
-            modifier = Modifier
-                .fillMaxSize()
-                .padding(innerPadding)
-        ) {
-            // Кнопка "Фильтр" с выпадающим списком (заглушка)
-            Row(
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(16.dp),
-                verticalAlignment = Alignment.CenterVertically
-            ) {
-                Button(onClick = { /* Обработка нажатия на фильтр */ }) {
-                    Text("Фильтр")
-                }
-                // Выпадающий список (заглушка)
-                Spacer(modifier = Modifier.width(8.dp))
-                // ...
-                Button(
-                    onClick = { navController.navigate("addPlace") },
-                    modifier = Modifier
-                        .width(40.dp)
-                        .height(40.dp),
-                    colors = ButtonDefaults.buttonColors(brown_contrast)
-                ) {
-                    Text(text = "добавить место")
-                }
 
-            }
-            Text(
-                text = "Лучшие места",
-                fontWeight = FontWeight.Bold,
-                modifier = Modifier
-                    .fillMaxWidth(),
-                textAlign = TextAlign.Center
-            )
-            LazyColumn(
-                contentPadding = PaddingValues(
-                    horizontal = 16.dp,
-                    vertical = 10.dp),
-                verticalArrangement = Arrangement.spacedBy(10.dp)
-            ){
-                items(placeList) {
-                    place ->
-                        PlaceCard(place = place, navController
-
-                        )
-                }
 
-            }
-        }
-    }
 }
 
 @Composable
@@ -286,7 +219,8 @@ fun PlaceCard(place: Place, navController: NavHostController){
 
             modifier = Modifier
                 .matchParentSize()
-                .background(color = Color.LightGray.copy(alpha = 0.6f))
+                .background(color = Color.LightGray.copy(alpha = 0.2f))
+                .padding(16.dp)
         ){
             Column(
                 modifier = Modifier
@@ -295,13 +229,13 @@ fun PlaceCard(place: Place, navController: NavHostController){
                 Text(
                     text = place.title,
                     fontSize = 18.sp,
-                    color = Color.Black,
+                    color = Color.White,
 
                     )
                 Text(
                     text = place.id_categoryFK.toString(),
                     fontSize = 18.sp,
-                    color = Color.Black,
+                    color = Color.White,
 
                     )
             }
@@ -326,7 +260,7 @@ fun PlaceCard(place: Place, navController: NavHostController){
 
 
 @Composable
-fun DrawerContent(showDrawer: Boolean, navController: NavHostController) {
+fun DrawerContent(navController: NavHostController) {
     val headlinesOswald = FontFamily( //выбор шрифта
         Font(resId = R.font.headlines_oswald)
     )
@@ -335,15 +269,15 @@ fun DrawerContent(showDrawer: Boolean, navController: NavHostController) {
     )
     Column(
         modifier = Modifier
-            .fillMaxSize()
+            .fillMaxWidth()
+            .height(170.dp)
             .background(Color.White)
-            .padding(16.dp)
+        ,
+        horizontalAlignment = Alignment.CenterHorizontally,
+        verticalArrangement = Arrangement.Center
     ) {
-//        IconButton(onClick = { showDrawer = false }) {
-//            Icon(Icons.Filled.Menu, contentDescription = "Закрыть")
-//        }
         Button(
-            onClick = { navController.navigate("policyConditionality") },
+            onClick = { navController.navigate("profile") },
             modifier = Modifier.width(290.dp).height(50.dp),
             colors = ButtonDefaults.buttonColors(brown_contrast)
         ) {
@@ -354,7 +288,7 @@ fun DrawerContent(showDrawer: Boolean, navController: NavHostController) {
             )
         }
         Button(
-            onClick = { navController.navigate("policyConditionality") },
+            onClick = { navController.navigate("favouritesV") },
             modifier = Modifier.width(290.dp).height(50.dp),
             colors = ButtonDefaults.buttonColors(brown_contrast)
         ) {
@@ -365,7 +299,7 @@ fun DrawerContent(showDrawer: Boolean, navController: NavHostController) {
             )
         }
         Button(
-            onClick = { navController.navigate("policyConditionality") },
+            onClick = { navController.navigate("addPlace") },
             modifier = Modifier.width(290.dp).height(50.dp),
             colors = ButtonDefaults.buttonColors(brown_contrast)
         ) {
@@ -376,7 +310,7 @@ fun DrawerContent(showDrawer: Boolean, navController: NavHostController) {
             )
         }
         Button(
-            onClick = { navController.navigate("policyConditionality") },
+            onClick = { navController.navigate("menuV") },
             modifier = Modifier.width(290.dp).height(50.dp),
             colors = ButtonDefaults.buttonColors(brown_contrast)
         ) {
@@ -387,7 +321,7 @@ fun DrawerContent(showDrawer: Boolean, navController: NavHostController) {
             )
         }
         Button(
-            onClick = { navController.navigate("policyConditionality") },
+            onClick = {  },
             modifier = Modifier.width(290.dp).height(50.dp),
             colors = ButtonDefaults.buttonColors(brown_contrast)
         ) {

+ 21 - 20
app/src/main/java/com/example/iplace/main/viewModel/dataView/PlaceV.kt

@@ -33,6 +33,7 @@ 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.TextStyle
 import androidx.compose.ui.text.font.Font
 import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
@@ -77,7 +78,6 @@ fun PlaceV(navController: NavHostController, placeId: String) {
             modifier = Modifier
                 .weight(2f)
                 .background(Color.LightGray.copy(alpha = 0.6f))
-                .padding(16.dp)
         ) {
             AsyncImage(
                 model = place?.img_place,
@@ -89,17 +89,20 @@ fun PlaceV(navController: NavHostController, placeId: String) {
             Row(
                 modifier = Modifier
                     .fillMaxWidth()
-                    .align(Alignment.TopStart), // Выравнивание по левому верхнему углу
+                    .align(Alignment.TopStart)
+                    .padding(16.dp) , // Выравнивание по левому верхнему углу
                 horizontalArrangement = Arrangement.Start, // Выравнивание по левому краю
-                verticalAlignment = Alignment.CenterVertically
+                verticalAlignment = Alignment.CenterVertically,
+
             ) {
                 IconButton(onClick = { navController.navigate("MenuV") }) {
                     Icon(Icons.Filled.ArrowBack, contentDescription = "Назад")
                 }
-                Spacer(modifier = Modifier.width(220.dp))
+                Spacer(modifier = Modifier.width(170.dp))
                 Text(
-                    text = "Автор",
+                    text = place?.author ?:"",
                     fontWeight = FontWeight.Bold,
+                    color = Color.White,
                     modifier = Modifier.padding(start = 16.dp) // Отступ от кнопки "Назад"
                 )
             }
@@ -111,17 +114,13 @@ fun PlaceV(navController: NavHostController, placeId: String) {
                     .padding(16.dp) // Отступ от краев
             ) {
                 Text(
-                    text = place?.title ?:"",
-                    fontWeight = FontWeight.Bold,
-                    fontSize = 32.sp
-                )
-                Text(
-                    text = place?.id_categoryFK.toString() ?:"",
-                    fontWeight = FontWeight.Bold,
-                    fontSize = 18.sp
+                    text = place?.title ?:"",  fontWeight = FontWeight.Bold,
+                    fontSize = 32.sp,
+                    color = Color.White
                 )
                 Spacer(modifier = Modifier.height(8.dp)) // Отступ между текстами
-                Text(text = "Категория")
+                Text(text = place?.id_categoryFK.toString() ?:"",
+                    color = Color.White)
             }
             Button(
                 onClick = { /* Обработка нажатия на фильтр */ },
@@ -151,24 +150,26 @@ fun PlaceV(navController: NavHostController, placeId: String) {
                 Spacer(modifier = Modifier.height(10.dp))
 
                 OutlinedTextField(
-                    value = "",
+                    value = place?.description ?:"",
                     onValueChange = {},
-                    label = { Text("Описание") },
+                    label = { Text("Описание", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
 
                 OutlinedTextField(
-                    value = "",
+                    value = place?.address ?:"",
                     onValueChange = {},
-                    label = { Text("Адрес") },
+                    label = { Text("Адрес", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
 

+ 40 - 25
app/src/main/java/com/example/iplace/main/viewModel/dataView/Profile.kt

@@ -27,12 +27,18 @@ import androidx.compose.material3.MaterialTheme
 import androidx.compose.material3.OutlinedTextField
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+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.TextStyle
 import androidx.compose.ui.text.font.Font
 import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
@@ -41,9 +47,12 @@ import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.navigation.NavHostController
+import coil.compose.AsyncImage
 import coil.compose.rememberImagePainter
 import com.example.iplace.R
 import com.example.iplace.main.viewModel.MainViewModel
+import com.example.iplace.model.Place
+import com.example.iplace.model.Users
 import com.example.iplace.ui.theme.beige_white
 import com.example.iplace.ui.theme.brown_contrast
 
@@ -52,6 +61,14 @@ import com.example.iplace.ui.theme.brown_contrast
 @Composable
 fun Profile(navController: NavHostController) {
     val viewModel = MainViewModel()
+    var user by remember { mutableStateOf<Users?>(null) }
+
+    LaunchedEffect(Unit) { // Запускаем корутину при первом рендере composable
+        viewModel.getUserById() // Вызываем функцию из viewModel
+        user = viewModel.user.value // Получаем результат из viewModel
+    }
+
+
     val headlinesOswald = FontFamily( //выбор шрифта
         Font(resId = R.font.headlines_oswald)
     )
@@ -110,12 +127,14 @@ fun Profile(navController: NavHostController) {
                     .padding(top = 64.dp),
                 horizontalAlignment = Alignment.CenterHorizontally
             ) {
-                // Фотография (заглушка)
-                Box(
-                    modifier = Modifier
-                        .size(120.dp)
+
+                AsyncImage(
+                    model = user?.img_user,
+                    contentDescription = null,
+                    modifier = Modifier.size(200.dp)
                         .clip(CircleShape)
-                        .background(Color.Gray)
+                        .background(Color.Gray),
+                    contentScale = ContentScale.Crop
                 )
 
                 // Имя и гендер
@@ -124,10 +143,15 @@ fun Profile(navController: NavHostController) {
                         .padding(top = 16.dp),
                     verticalAlignment = Alignment.CenterVertically
                 ) {
-                    Text(text = "Имя пользователя")
+                    Text(
+                        text = user?.name ?:""
+                    )
                     Spacer(modifier = Modifier.width(8.dp))
-                    // Символ гендера (заглушка)
-                    Text(text = "♂")
+                    when (user?.id_genderFK?.toString() ?: "") {
+                        "1" -> Text(text = "♂")
+                        "2" -> Text(text = "♀") // Или любой другой символ, который вы хотите использовать для значения 2
+                        else -> {} // Можно добавить обработку других значений или оставить пустым
+                    }
                 }
             }
         }
@@ -148,37 +172,28 @@ fun Profile(navController: NavHostController) {
                 Spacer(modifier = Modifier.height(10.dp))
 
                 OutlinedTextField(
-                    value = "",
+                    value = user?.address ?:"",
                     onValueChange = {},
-                    label = { Text("Адрес") },
+                    label = { Text("Адрес", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
 
                 OutlinedTextField(
-                    value = "",
+                    value = user?.about_me ?:"",
                     onValueChange = {},
-                    label = { Text("Телефон") },
+                    label = { Text("О себе", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
-
-                OutlinedTextField(
-                    value = "",
-                    onValueChange = {},
-                    label = { Text("О себе") },
-                    modifier = Modifier
-                        .fillMaxWidth()
-                        .height(45.dp)
-                        .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
-                )
                 Row(
                     modifier = Modifier.fillMaxWidth(),
                     horizontalArrangement = Arrangement.SpaceBetween,

+ 6 - 4
app/src/main/java/com/example/iplace/main/viewModel/mainView/Auth.kt

@@ -125,11 +125,12 @@ fun  Auth(navController: NavHostController){
                 OutlinedTextField(
                     value = email,
                     onValueChange = { newText -> email = newText },
-                    label = { Text("Логин") },
+                    label = { Text("Логин", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 var passwordVisibility: Boolean by remember { mutableStateOf(false) }
 
@@ -139,11 +140,12 @@ fun  Auth(navController: NavHostController){
                     value = password,
                     visualTransformation = if (passwordVisibility) VisualTransformation.None else PasswordVisualTransformation(),
                     onValueChange = { newText -> password = newText },
-                    label = { Text("Пароль") },
+                    label = { Text("Пароль", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
 
                 Spacer(modifier = Modifier.height(5.dp))

+ 7 - 4
app/src/main/java/com/example/iplace/main/viewModel/mainView/ChangingPassword.kt

@@ -26,6 +26,7 @@ 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.text.TextStyle
 import androidx.compose.ui.text.font.Font
 import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
@@ -102,11 +103,12 @@ fun ChangingPassword(navController: NavHostController) {
                 OutlinedTextField(
                     value = "",
                     onValueChange = {},
-                    label = { Text("Введите новый пароль") },
+                    label = { Text("Введите новый пароль", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
 
                 Spacer(modifier = Modifier.height(10.dp))
@@ -114,11 +116,12 @@ fun ChangingPassword(navController: NavHostController) {
                 OutlinedTextField(
                     value = "",
                     onValueChange = {},
-                    label = { Text("Повторите ваш пароль") },
+                    label = { Text("Повторите ваш пароль", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
 
                 Spacer(modifier = Modifier.height(40.dp))

+ 13 - 8
app/src/main/java/com/example/iplace/main/viewModel/mainView/CreatingUser.kt

@@ -60,6 +60,7 @@ import androidx.compose.foundation.layout.*
 import androidx.compose.material.*
 import androidx.compose.material.icons.filled.ArrowDropDown
 import androidx.compose.runtime.*
+import androidx.compose.ui.text.TextStyle
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 
@@ -170,11 +171,12 @@ fun CreatingUser(navController: NavHostController) {
                 OutlinedTextField(
                     value = nameUser.value,
                     onValueChange = { newText -> nameUser.value = newText },
-                    label = { Text("Имя") },
+                    label = { Text("Имя", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
 
@@ -188,13 +190,14 @@ fun CreatingUser(navController: NavHostController) {
                         value = selectedItem,
                         onValueChange = { selectedItem = it },
                         readOnly = true,
-                        label = { Text("Пол") },
+                        label = { Text("Пол", color = Color.Black) },
                         trailingIcon = {
                             IconButton(onClick = { expanded = !expanded }) {
                                 Icon(Icons.Filled.ArrowDropDown, contentDescription = null)
                             }
                         },
-                        modifier = Modifier.fillMaxWidth()
+                        modifier = Modifier.fillMaxWidth(),
+                        textStyle = TextStyle(color = Color.Black)
                     )
 
                     DropdownMenu(
@@ -226,22 +229,24 @@ fun CreatingUser(navController: NavHostController) {
                 OutlinedTextField(
                     value = address.value,
                     onValueChange = { newText -> address.value = newText },
-                    label = { Text("Адрес") },
+                    label = { Text("Адрес", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
 
                 OutlinedTextField(
                     value = about_me.value,
                     onValueChange = { newText -> about_me.value = newText },
-                    label = { Text("О себе") },
+                    label = { Text("О себе", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
 

+ 7 - 4
app/src/main/java/com/example/iplace/main/viewModel/mainView/PasswordRecovery.kt

@@ -29,6 +29,7 @@ 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.TextStyle
 import androidx.compose.ui.text.font.Font
 import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
@@ -112,11 +113,12 @@ fun PasswordRecovery(navController: NavHostController) {
                 TextField(
                     value = "",
                     onValueChange = {},
-                    label = { Text("Новый пароль") },
+                    label = { Text("Новый пароль", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
 
                 Spacer(modifier = Modifier.height(10.dp))
@@ -124,11 +126,12 @@ fun PasswordRecovery(navController: NavHostController) {
                 TextField(
                     value = "",
                     onValueChange = {},
-                    label = { Text("Повторите пароль") },
+                    label = { Text("Повторите пароль", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
 
                 Spacer(modifier = Modifier.height(40.dp))

+ 4 - 2
app/src/main/java/com/example/iplace/main/viewModel/mainView/PasswordVerification.kt

@@ -26,6 +26,7 @@ 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.text.TextStyle
 import androidx.compose.ui.text.font.Font
 import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
@@ -102,11 +103,12 @@ fun PasswordVerification(navController: NavHostController) {
                 OutlinedTextField(
                     value = "",
                     onValueChange = {},
-                    label = { Text("Введите ваш старый пароль") },
+                    label = { Text("Введите ваш старый пароль", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
 
                 Spacer(modifier = Modifier.height(10.dp))

+ 10 - 6
app/src/main/java/com/example/iplace/main/viewModel/mainView/Registration.kt

@@ -34,6 +34,7 @@ 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.TextStyle
 import androidx.compose.ui.text.font.Font
 import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
@@ -125,11 +126,12 @@ fun Registration(navController: NavHostController) {
                 OutlinedTextField(
                     value = newemail,
                     onValueChange = { newText -> newemail = newText },
-                    label = { Text("Логин") },
+                    label = { Text("Логин", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
 
                 Spacer(modifier = Modifier.height(10.dp))
@@ -137,22 +139,24 @@ fun Registration(navController: NavHostController) {
                 OutlinedTextField(
                     value = newpassword1,
                     onValueChange = { newText -> newpassword1 = newText },
-                    label = { Text("Пароль") },
+                    label = { Text("Пароль", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
 
                 OutlinedTextField(
                     value = newpassword2,
                     onValueChange = { newText -> newpassword2 = newText },
-                    label = { Text("Повторите пароль") },
+                    label = { Text("Повторите пароль", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
 
 

+ 1 - 1
app/src/main/java/com/example/iplace/model/Users.kt

@@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable
 
 @Serializable
 data class Users(
-    val id_UUID: String,
+    val id_uuid: String,
     val name: String,
     val address: String,
     val about_me: String,