Browse Source

app: input user wardrob

Anna 1 week ago
parent
commit
a12307a8b7

+ 1 - 0
Project_exvesta/app/build.gradle.kts

@@ -65,6 +65,7 @@ dependencies {
     implementation(libs.androidx.ui.android)
     implementation(libs.volley)
     implementation(libs.androidx.espresso.core)
+    implementation(libs.androidx.tools.core)
     testImplementation(libs.junit)
     androidTestImplementation(libs.androidx.junit)
     androidTestImplementation(libs.androidx.espresso.core)

+ 72 - 0
Project_exvesta/app/src/main/java/com/example/exvesta/Screans/Auth.kt

@@ -0,0 +1,72 @@
+package com.example.exvesta.Screans
+
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewModelScope
+import androidx.navigation.NavController
+import androidx.navigation.NavHostController
+import androidx.privacysandbox.tools.core.model.Constant
+import com.example.exvesta.domain.utils.Constants
+import io.github.jan.supabase.gotrue.providers.builtin.OTP
+import kotlinx.coroutines.launch
+
+
+import io.github.jan.supabase.gotrue.auth
+import io.github.jan.supabase.gotrue.providers.builtin.Email
+
+
+class  Auth(): ViewModel(){
+    fun onSignInEmailCode(emailUser: String) {
+        viewModelScope.launch {
+            try {
+                Constants.supabase.auth.signInWith(OTP) {
+                    email = emailUser
+                    createUser = false
+                }
+
+            } catch (e: Exception) {
+                println(e.message.toString())
+
+            }
+
+        }
+    }
+
+    fun onSignInEmailPassword(emailUser: String, passwordUser: String, navHost: NavHostController) {
+        viewModelScope.launch {
+            try {
+                val user = Constants.supabase.auth.signInWith(Email) {
+                    email = emailUser
+                    password = passwordUser
+                }
+                println(user.toString())
+                println(Constants.supabase.auth.currentUserOrNull()!!.id)
+                println("Success")
+                navHost.navigate("Home")
+            } catch (e: Exception) {
+                println("Error")
+                println(e.message.toString())
+            }
+        }
+    }
+    fun onSignUpEmail(emailUser: String, passwordUser: String) {
+        viewModelScope.launch {
+            try{
+                var  user =  Constants.supabase.auth.signUpWith(Email) {
+                    email = emailUser
+                    password = passwordUser
+                }
+                println(user.toString())
+                println(Constants.supabase.auth.currentUserOrNull()!!.id)
+                println("Success")
+            }
+            catch (e: Exception) {
+                println("Error")
+                println(e.message.toString())
+            }
+
+        }
+    }
+
+
+
+}

+ 301 - 0
Project_exvesta/app/src/main/java/com/example/exvesta/Screans/Filters.kt

@@ -353,4 +353,305 @@ public  fun Filters(   onApplyFilters: (Type_subtype_dublicate?, Season_dublicat
             }
         }
 
+}
+
+
+@OptIn(ExperimentalLayoutApi::class)
+@Composable
+public  fun FiltersUser(   onApplyFilters: (Type_subtype_dublicate?, Season_dublicate?,  Style_dublicate?) -> Unit,
+                       onDismiss: () -> Unit) {
+    var styledubs by remember { mutableStateOf<List<Style_dublicate>>(listOf()) }
+    var subdubtypes by remember { mutableStateOf<List<Type_subtype_dublicate>>(listOf()) }
+    var typedubs by remember { mutableStateOf<List<Type_dublicate>>(listOf()) }
+    var seasondubs by remember { mutableStateOf<List<Season_dublicate>>(listOf()) }
+    var selectedStyle by remember { mutableStateOf<Style_dublicate?>(null) }
+    var selectedSubtype by remember { mutableStateOf<Type_subtype_dublicate?>(null) }
+    var selectedSeason by remember { mutableStateOf<Season_dublicate?>(null) }
+
+    var selectedsubId by remember { mutableStateOf(0) }
+    var selectedseasonId by remember { mutableStateOf(0) }
+    val viewModel = MainViewModel()
+    LaunchedEffect(Unit) {
+        withContext(Dispatchers.IO) {
+            subdubtypes = Constants.supabase.from("Type_subtype_dublicate")
+                .select().decodeList<Type_subtype_dublicate>()
+            typedubs = Constants.supabase.from("Type_dublicate")
+                .select().decodeList<Type_dublicate>()
+            seasondubs = Constants.supabase.from("Season_dublicate")
+                .select().decodeList<Season_dublicate>()
+            styledubs = Constants.supabase.from("Style_dublicate")
+                .select().decodeList<Style_dublicate>()
+            seasondubs.forEach { it ->
+                Log.d("ts", it.title_season)
+            }
+            typedubs.forEach { it ->
+                Log.d("ts", it.title_type)
+            }
+        }
+    }
+
+    Column(
+        modifier = Modifier
+            .fillMaxHeight()
+            .fillMaxWidth()
+            .background(
+                Brush.verticalGradient(
+                    colors = listOf(
+                        Color(0xFFF4F4F4),
+                        Color(0xFFE7D2A9),
+                        Color(0xFFC1A88B),
+                        Color(0xFF6F4A48)
+                    )
+                )
+            ),
+        verticalArrangement = Arrangement.Top,
+        horizontalAlignment = Alignment.CenterHorizontally
+    ) {
+        Spacer(modifier = Modifier.height(50.dp))
+
+        // Кнопка для закрытия фильтров
+        Button(
+            onClick = { onDismiss() }, // Закрыть выбор фильтров
+            modifier = Modifier.padding(top = 16.dp)
+                .background( Color(0xFFD05656),shape = ButtonDefaults.shape),
+            colors = ButtonDefaults.buttonColors(containerColor = Color.Transparent)
+        ) {
+            Text("Закрыть выбор фильтров")
+        }
+
+        Spacer(modifier = Modifier.height(20.dp))
+
+        // Белый бокс с закругленными краями
+        Box(
+            modifier = Modifier
+                .fillMaxWidth() // Бокс на всю ширину
+                .padding(start = 16.dp, end = 16.dp)
+                .background(
+                    color = Color.White,
+                    shape = RoundedCornerShape(16.dp) // Закругленные края
+                )
+                .padding(16.dp) // Отступы внутри бокса
+        ) {
+            // Используем Column для размещения текста и кнопки
+            LazyColumn(horizontalAlignment = Alignment.CenterHorizontally) {
+                item {
+                    // Текст заголовка
+                    Text(
+                        text = "Фильтры",
+                        fontSize = 16.sp,
+                        fontWeight = FontWeight.Medium,
+                        color = Color(0xFF92A2B0)
+                    )
+                    Divider(
+                        modifier = Modifier.padding(vertical = 8.dp),
+                        color = Color.LightGray,
+                        thickness = 1.dp
+                    )
+                    Spacer(modifier = Modifier.height(10.dp)) // Отступ между текстом и кнопкой
+
+                    // Текст "Сезон"
+                    Box(
+
+                        modifier = Modifier
+//                                .align(Alignment.Start)
+                            .fillMaxWidth()
+                    ) {
+                        Text("Сезон")
+
+
+                        FlowRow(
+                            modifier = Modifier
+                                .fillMaxWidth()
+                                .padding(10.dp)
+                        ) {
+                            seasondubs.forEach { seasondub ->
+                                Row(
+                                    verticalAlignment = Alignment.CenterVertically,
+                                    modifier = Modifier
+                                        .padding(4.dp) // Отступы между элементами
+                                        .selectable(
+                                            selected = (seasondub == selectedSeason),
+                                            onClick = { selectedSeason = seasondub }
+                                        )
+                                ) {
+                                    RadioButton(
+                                        selected = (seasondub == selectedSeason),
+                                        onClick = { selectedSeason = seasondub }
+                                    )
+                                    Text(
+                                        text = seasondub.title_season,
+                                        fontSize = 16.sp,
+                                        modifier = Modifier.padding(start = 8.dp),
+                                        color = Color(0xFF92A2B0)
+                                    )
+                                }
+                            }
+                        }
+                    }
+                    Spacer(modifier = Modifier.height(10.dp))
+                    Box(
+
+                        modifier = Modifier
+//                                .align(Alignment.Start)
+                            .fillMaxWidth()
+
+                    ) {
+                        Text("Стиль")
+                    }
+                    Box(
+
+                        modifier = Modifier
+//                                .align(Alignment.Start)
+                            .fillMaxWidth()
+                            .padding(10.dp)
+                    ) {
+                        FlowRow(
+                            modifier = Modifier
+                                .fillMaxWidth()
+                                .padding(10.dp)
+                        ) {
+                            styledubs.forEach { styledub ->
+                                Box(
+                                    modifier = Modifier
+                                        .padding(4.dp) // Отступы между элементами
+                                        .background(
+                                            Color(0xFFF1F1F3),
+                                            shape = RoundedCornerShape(20.dp)
+                                        )
+                                        .width(145.dp)// Задаем одинаковую ширину для всех элементов
+                                        .height(38.dp) // Устанавливаем фиксированную высоту для всех элементов
+                                ) {
+                                    Row(
+                                        verticalAlignment = Alignment.CenterVertically,
+                                        modifier = Modifier
+
+                                            .selectable(
+                                                selected = (styledub == selectedStyle),
+                                                onClick = { selectedStyle = styledub }
+                                            )
+                                    ) {
+                                        RadioButton(
+                                            selected = (styledub == selectedStyle),
+                                            onClick = { selectedStyle = styledub }
+                                        )
+                                        Text(
+                                            text = styledub.title_style,
+                                            fontSize = 16.sp,
+                                            modifier = Modifier.padding(start = 0.dp), // Отступ слева от радиокнопки
+                                            color = Color(0xFF92A2B0)
+                                        )
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    Box(
+
+                        modifier = Modifier
+//                                .align(Alignment.Start)
+                            .fillMaxWidth()
+
+                    ) {
+                        Text("Типы")
+                    }
+
+                    FlowRow(
+                        modifier = Modifier
+                            .fillMaxWidth()
+                            .padding(10.dp)
+                    )
+                    {
+                        typedubs.forEach { typedub ->
+
+                            Box(
+                                modifier = Modifier
+                                    .padding(4.dp) // Отступы между элементами
+                                    .background(
+                                        Color(0xFFF1F1F3),
+                                        shape = RoundedCornerShape(20.dp)
+                                    )
+                                    .width(145.dp)// Задаем одинаковую ширину для всех элементов
+                                    .height(245.dp) // Устанавливаем фиксированную высоту для всех элементов
+                            ) {
+
+                                Text(text = typedub.title_type)
+
+
+
+                                LazyColumn {
+                                    items(
+                                        subdubtypes,
+                                        key = { subdubtype -> subdubtype.id },
+                                    ) { subtypedub ->
+                                        if (subtypedub.id_type == typedub.id) {
+                                            Row(
+                                                verticalAlignment = Alignment.CenterVertically,
+                                                modifier = Modifier
+
+                                                    .selectable(
+                                                        selected = (subtypedub ==  selectedSubtype),
+                                                        onClick = { selectedSubtype = subtypedub }
+                                                    )
+                                                    .padding(top = 14.dp)
+
+
+
+                                            ) {
+                                                RadioButton(
+                                                    selected = (subtypedub ==  selectedSubtype),
+                                                    onClick = { selectedSubtype = subtypedub }
+                                                )
+                                                Text(
+                                                    text = subtypedub.sub_type,
+                                                    fontSize = 16.sp,
+                                                    modifier = Modifier.padding(start = 0.dp), // Отступ слева от радиокнопки
+                                                    color = Color(0xFF92A2B0)
+
+                                                )
+                                            }
+                                        }
+
+                                    }
+
+                                }
+
+
+                            }
+
+                        }
+
+
+
+                    }
+                }
+            }
+
+            Button(
+                onClick = {  onApplyFilters(selectedSubtype, selectedSeason, selectedStyle) },
+                modifier = Modifier
+                    .align(Alignment.BottomCenter)
+                    .fillMaxWidth() // Занять всю ширину
+                    .height(50.dp)
+                    .padding(horizontal = 20.dp)
+                    .background(
+                        brush = Brush.horizontalGradient(
+                            colors = listOf(
+                                Color(0xFF6F4A48),
+                                Color(0xFFE7D2A9),
+                            )
+                        ),
+                        shape = ButtonDefaults.shape
+                    ),
+                colors = ButtonDefaults.buttonColors(containerColor = Color.Transparent),
+
+                ) {
+                Text(
+                    text = "Применить",
+                    fontSize = 16.sp,
+                    fontWeight = FontWeight.Medium
+                )
+            }
+        }
+    }
+
 }

+ 19 - 1
Project_exvesta/app/src/main/java/com/example/exvesta/Screans/Home.kt

@@ -81,6 +81,7 @@ fun Home(navHost: NavHostController) {
     var styledub by remember { mutableStateOf<List<Style_dublicate>>(listOf()) }
     var recpubthingsList by remember { mutableStateOf<List<Publicthings>>(listOf()) }
     var filteredPublicThings by remember { mutableStateOf<List<Publicthings>>(listOf()) }
+    val viewModel = MainViewModel()
 
     LaunchedEffect(Unit) {
         withContext(Dispatchers.IO) {
@@ -101,6 +102,7 @@ fun Home(navHost: NavHostController) {
         filteredPublicThings = publicthings
 
     }
+    var filtersApplied by remember { mutableStateOf(false) }
     var isFilterSheetVisible by remember { mutableStateOf(false) }
     var drawerState = rememberDrawerState(DrawerValue.Closed)
     val scope = rememberCoroutineScope()
@@ -146,9 +148,25 @@ fun Home(navHost: NavHostController) {
                         colors = ButtonDefaults.buttonColors(Color(0xFFF1F1F3))
                     ) {
                         Text(text = "+ добавить фильтр", color = Color(0xFF92A2B0))
+
                     }
 
             }
+            if (filtersApplied) {
+                Button(
+                    onClick = {
+                        filteredPublicThings = publicthings
+                        filtersApplied = false
+                    },
+                    border = BorderStroke(1.dp, Color(0xFF92A2B0)),
+                    modifier = Modifier
+                        .fillMaxWidth()
+                        .padding(vertical = 8.dp),
+                    colors = ButtonDefaults.buttonColors(Color(0xFFF1F1F3))
+                ) {
+                    Text(text = "сбросить фильтры", color = Color(0xFF92A2B0))
+                }
+            }
             Spacer(modifier = Modifier.height(10.dp))
 
 
@@ -409,6 +427,7 @@ fun Home(navHost: NavHostController) {
                     }
 
                     isFilterSheetVisible = false // Закрываем окно фильтров
+                    filtersApplied = true;
                 },
                 onDismiss = { isFilterSheetVisible = false })
 
@@ -418,7 +437,6 @@ fun Home(navHost: NavHostController) {
 
 
 
-
     @Composable
  public  fun DrawerContent(navHost: NavHostController) {
         Column(

+ 6 - 6
Project_exvesta/app/src/main/java/com/example/exvesta/Screans/Login.kt

@@ -45,7 +45,7 @@ import com.example.exvesta.R
 
 @Composable
 fun Login(navHost: NavHostController) {
-    val viewModel = MainViewModel()
+    val viewModel = Auth()
     val email = remember { mutableStateOf("") }
     val password = remember { mutableStateOf("")}
     val gradientButton = Brush.linearGradient(
@@ -85,11 +85,11 @@ fun Login(navHost: NavHostController) {
         Spacer(modifier = Modifier.height(16.dp))
         OutlinedTextField(
             value = email.value,
-            onValueChange = { email.value = it },
+            onValueChange = { newText -> email.value = newText },
             label = { Text("Логин", color = Color(0xFFB9A791)) },
             modifier = Modifier
                 .width(350.dp)
-                .height(50.dp)
+                .height(60.dp)
             ,
             colors = TextFieldDefaults.colors(
                 unfocusedContainerColor =  Color(0xFFFEFAF3),
@@ -104,12 +104,12 @@ fun Login(navHost: NavHostController) {
         Spacer(modifier = Modifier.height(16.dp))
         OutlinedTextField(
             value = password.value,
-            onValueChange = { password.value = it },
+            onValueChange = {newText -> password.value = newText},
             label = { Text("Пароль", color = Color(0xFFB9A791)) },
             modifier = Modifier
 
                 .width(350.dp)
-                .height(50.dp)
+                .height(60.dp)
 
 
             ,
@@ -125,7 +125,7 @@ fun Login(navHost: NavHostController) {
 
         Spacer(modifier = Modifier.height(30.dp))
         Button(
-            onClick = {  navHost.navigate("Home") },
+            onClick = {  viewModel.onSignInEmailPassword(email.value, password.value, navHost) },
             modifier = Modifier
                 .width(370.dp)
                 .height(60.dp)

+ 10 - 13
Project_exvesta/app/src/main/java/com/example/exvesta/Screans/MainViewModel.kt

@@ -3,34 +3,23 @@ package com.example.exvesta.Screans
 import android.util.Log
 import androidx.compose.runtime.getValue
 import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
 import androidx.compose.runtime.setValue
 import androidx.lifecycle.LiveData
 import androidx.lifecycle.MutableLiveData
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.viewModelScope
-import com.example.exvesta.Screans.items.Itempublicthings
 import com.example.exvesta.domain.utils.Constants
-import com.example.exvesta.domain.utils.Constants.supabase
 import com.example.exvesta.model.Publicthings
 import com.example.exvesta.model.Season_dublicate
+import com.example.exvesta.model.Style_dublicate
 import com.example.exvesta.model.Type_dublicate
 import com.example.exvesta.model.Type_subtype_dublicate
 import io.github.jan.supabase.gotrue.auth
 import io.github.jan.supabase.gotrue.providers.builtin.Email
 import io.github.jan.supabase.gotrue.providers.builtin.OTP
 import io.github.jan.supabase.postgrest.from
-import io.github.jan.supabase.SupabaseClient
-import io.github.jan.supabase.postgrest.query.Columns
-import kotlinx.coroutines.Dispatchers
-import io.github.jan.supabase.postgrest.query.filter.PostgrestFilterBuilder
-import io.github.jan.supabase.postgrest.query.PostgrestQueryBuilder
-import io.github.jan.supabase.postgrest.result.PostgrestResult
-import io.github.jan.supabase.storage.publicStorageItem
-import kotlinx.coroutines.awaitAll
 import kotlinx.coroutines.launch
-import kotlinx.coroutines.withContext
-import kotlinx.serialization.builtins.serializer
+
 
 class MainViewModel(): ViewModel() {
     private val _loginResult = MutableLiveData<Boolean>()
@@ -51,6 +40,14 @@ class MainViewModel(): ViewModel() {
 
         }
     }
+    fun drop(){
+        var selectedStyle by  mutableStateOf<Style_dublicate?>(null)
+        var selectedSubtype by mutableStateOf<Type_subtype_dublicate?>(null)
+        var selectedSeason by  mutableStateOf<Season_dublicate?>(null)
+        selectedStyle = null
+        selectedSubtype = null
+        selectedSeason = null
+    }
 
     fun onSignInEmailPassword(emailUser: String, passwordUser: String): Boolean {
         viewModelScope.launch {

+ 358 - 18
Project_exvesta/app/src/main/java/com/example/exvesta/Screans/Wardrob.kt

@@ -1,6 +1,8 @@
 package com.example.exvesta.Screans
 
+import android.util.Log
 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
@@ -37,18 +39,77 @@ import androidx.compose.material.*
 import androidx.compose.runtime.*
 
 import androidx.compose.foundation.layout.*
+import androidx.compose.foundation.lazy.LazyColumn
+import androidx.compose.foundation.lazy.items
 import androidx.compose.material.icons.Icons
 import androidx.compose.material.icons.filled.Menu
+import androidx.compose.ui.graphics.Brush
+import androidx.compose.ui.layout.ContentScale
+import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.text.font.FontWeight
 import androidx.compose.ui.unit.sp
+import coil.compose.AsyncImagePainter
+import coil.compose.rememberAsyncImagePainter
+import coil.request.ImageRequest
+import coil.size.Size
+import com.example.exvesta.domain.utils.Constants
+import com.example.exvesta.model.Consists_wardrob
+import com.example.exvesta.model.Publicthings
+import com.example.exvesta.model.Season
+import com.example.exvesta.model.Season_dublicate
+import com.example.exvesta.model.Style
+import com.example.exvesta.model.Style_dublicate
+import com.example.exvesta.model.Things_user
+import com.example.exvesta.model.Type
+import com.example.exvesta.model.Type_dublicate
+import com.example.exvesta.model.Type_subtype
+import com.example.exvesta.model.Type_subtype_dublicate
+import com.example.exvesta.model.Users
+import com.example.exvesta.model.Wardob
+import io.github.jan.supabase.postgrest.from
+import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
 
 @Composable
 fun Wardrob(navHost: NavHostController) {
     var drawerState = rememberDrawerState(DrawerValue.Closed)
     val scope = rememberCoroutineScope()
     var isFiltersVisible by remember { mutableStateOf(false) }
+    var filteredPublicThings by remember { mutableStateOf<List<Wardob>>(listOf()) }
+    var subdubtype by remember { mutableStateOf<List<Type_subtype>>(listOf()) }
+    var type by remember { mutableStateOf<List<Type>>(listOf()) }
+    var season by remember { mutableStateOf<List<Season>>(listOf()) }
+    var userthings by remember { mutableStateOf<List<Things_user>>(listOf()) }
+    var style by remember { mutableStateOf<List<Style>>(listOf()) }
+    var filtersApplied by remember { mutableStateOf(false) }
+    var isFilterSheetVisible by remember { mutableStateOf(false) }
+    var wardrobs by remember { mutableStateOf<List<Wardob>>(listOf()) }
+    var cwardrob by remember { mutableStateOf<List<Consists_wardrob>>(listOf()) }
+    var users by remember { mutableStateOf<List<Users>>(listOf()) }
+    LaunchedEffect(Unit) {
+        withContext(Dispatchers.IO) {
+            userthings  = Constants.supabase.from("Things_user")
+                .select().decodeList<Things_user>()
+            wardrobs  = Constants.supabase.from("Wardob")
+                .select().decodeList<Wardob>()
+            cwardrob  = Constants.supabase.from("Consists_wardrob")
+                .select().decodeList<Consists_wardrob>()
+            subdubtype = Constants.supabase.from("Type_subtype")
+                .select().decodeList<Type_subtype>()
+            type = Constants.supabase.from("Type")
+                .select().decodeList<Type>()
+            season = Constants.supabase.from("Season")
+                .select().decodeList<Season>()
+            style = Constants.supabase.from("Style")
+                .select().decodeList<Style>()
+            wardrobs.forEach { it ->
+                Log.d("ts", it.toString())
+            }
+        }
+        filteredPublicThings = wardrobs
 
+    }
     ModalDrawer(
         drawerState = drawerState,
         drawerContent = {
@@ -74,38 +135,317 @@ fun Wardrob(navHost: NavHostController) {
                 }) {
                     Icon(imageVector = Icons.Filled.Menu, contentDescription = "Menu")
                 }
+
+                Column(){
+                    Button(
+                        onClick = {
+
+                            scope.launch { drawerState.close() } // Закрываем drawer
+                        },
+                        border = BorderStroke(1.dp, Color(0xFF92A2B0)),
+                        modifier = Modifier
+                            .fillMaxWidth()
+                            .padding(vertical = 8.dp),
+                        colors = ButtonDefaults.buttonColors(Color.White)
+                    ) {
+                        Text(text = "+ добавить фильтр", color = Color(0xFF92A2B0))
+                    }
+
+
+                    Button(
+                        onClick = { /*TODO*/ },
+                        border = BorderStroke(1.dp, Color(0xFF92A2B0)),
+                        modifier = Modifier
+                            .fillMaxWidth()
+                            .padding(vertical = 8.dp),
+                        colors = ButtonDefaults.buttonColors(Color.White)
+                    ) {
+                        Text(text = "+ добавить вещь", color = Color(0xFF92A2B0))
+                    }
+
+                }
+            }
+            if (filtersApplied) {
+                Button(
+                    onClick = {
+                        filteredPublicThings = wardrobs
+                        filtersApplied = false
+                    },
+                    border = BorderStroke(1.dp, Color(0xFF92A2B0)),
+                    modifier = Modifier
+                        .fillMaxWidth()
+                        .padding(vertical = 8.dp),
+                    colors = ButtonDefaults.buttonColors(Color(0xFFF1F1F3))
+                ) {
+                    Text(text = "сбросить фильтры", color = Color(0xFF92A2B0))
+                }
             }
-            Spacer(modifier = Modifier.height(40.dp))
+            Spacer(modifier = Modifier.height(10.dp))
 
-            Button(
-                onClick = {
 
-                    scope.launch { drawerState.close() } // Закрываем drawer
-                },
-                border = BorderStroke(1.dp, Color(0xFF92A2B0)),
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(vertical = 8.dp),
-                colors = ButtonDefaults.buttonColors(Color.White)
+
+
+            Row(
+                modifier = Modifier.fillMaxWidth(),
+                horizontalArrangement = Arrangement.SpaceAround
             ) {
-                Text(text = "+ добавить фильтр", color = Color(0xFF92A2B0))
+                // Кнопка "вещи"
+                Box(
+                    modifier = Modifier
+                        .weight(1f)
+                        .padding(bottom = 4.dp) // Паддинг для отступа от нижней тени
+                        .clip(RoundedCornerShape(16.dp))
+                ) {
+                    // Тень
+                    Box(
+                        modifier = Modifier
+                            .shadow(8.dp, RoundedCornerShape(30.dp))
+
+
+                    )
+
+                    // Кнопка
+                    Button(
+                        onClick = { /*TODO*/ },
+                        modifier = Modifier
+                            .fillMaxWidth()
+
+                            .shadow(
+                                0.dp,
+                                shape = CircleShape,
+                                clip = false
+                            )// Убираем тень у кнопки
+                            .background(
+                                brush = Brush.horizontalGradient(
+                                    colors = listOf(
+                                        Color(0xFFF1F1F3),
+                                        Color(0xFFFFFFFF),
+                                    )
+                                ), shape = ButtonDefaults.shape
+                            ), // Убираем тень у кнопки
+                        colors = ButtonDefaults.buttonColors(containerColor = Color.Transparent)
+
+                    ) {
+                        Text(text = "вещи", color = Color(0xFF92A2B0))
+                    }
+                }
+
+                Spacer(modifier = Modifier.width(16.dp))
+
+                // Кнопка "образы"
+                Box(
+                    modifier = Modifier
+                        .weight(1f)
+                        .padding(bottom = 4.dp) // Паддинг для отступа от нижней тени
+                        .clip(RoundedCornerShape(16.dp))
+                ) {
+                    // Тень
+                    Box(
+                        modifier = Modifier
+                            .shadow(8.dp, RoundedCornerShape(30.dp))
+                    )
+
+                    // Кнопка
+                    Button(
+                        onClick = { /*TODO*/ },
+                        modifier = Modifier
+                            .fillMaxWidth()
+
+                            .background(
+                                brush = Brush.horizontalGradient(
+                                    colors = listOf(
+                                        Color(0xFFF1F1F3),
+                                        Color(0xFFFFFFFF),
+                                    )
+                                ), shape = ButtonDefaults.shape
+                            ), // Убираем тень у кнопки
+                        colors = ButtonDefaults.buttonColors(containerColor = Color.Transparent),
+
+                        ) {
+                        Text(text = "образы", color = Color(0xFF92A2B0))
+                    }
+                }
             }
 
+
+
             Spacer(modifier = Modifier.height(10.dp))
-            Button(
-                onClick = { /*TODO*/ },
-                border = BorderStroke(1.dp, Color(0xFF92A2B0)),
+
+            LazyColumn(
+
                 modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(vertical = 8.dp),
-                colors = ButtonDefaults.buttonColors(Color.White)
+                    .fillMaxSize(1f)
+                    .padding(10.dp)
+            ) {
+
+                items(
+                    filteredPublicThings
+
+                ) { wardrob ->
+                    val userid = wardrob.id
+                    val conidwar = cwardrob.find { it.id == userid  }
+val user =
+         if(conidwar!= null) {
+            if (conidwar.id_wardrob == wardrob.id) {
+
+
+                 val imageState = rememberAsyncImagePainter(
+                  model = ImageRequest.Builder(LocalContext.current).data(userthing.img)
+                 .size(Size.ORIGINAL).build()
+                  ).state
+
+                 Box(
+                   modifier = Modifier
+                     .shadow(8.dp, RoundedCornerShape(30.dp))
+                   ) {
+            Box(
+                modifier = Modifier
+                    .background(
+
+                        Color.White,
+
+                        shape = RoundedCornerShape(30.dp)
+                    )
+                    .padding(8.dp)
+                    .wrapContentSize(Alignment.Center)
+
             ) {
-                Text(text = "+ добавить вещь", color = Color(0xFF92A2B0))
+
+                Column(
+                )
+                {
+                    if (imageState is AsyncImagePainter.State.Error) {
+                        Box(
+                            modifier = Modifier
+                                .fillMaxWidth()
+
+                                .height(250.dp),
+                            contentAlignment = Alignment.Center
+                        ) {
+                            androidx.compose.material3.CircularProgressIndicator()
+                        }
+                    }
+
+                    if (imageState is AsyncImagePainter.State.Success) {
+                        Image(
+                            modifier = Modifier
+                                .fillMaxWidth()
+                                .height(250.dp)
+//                                    .clip(RoundedCornerShape(8.dp))
+                            ,
+                            painter = imageState.painter,
+                            contentDescription = "",
+                            contentScale = ContentScale.Crop
+
+
+                        )
+                    }
+                    androidx.compose.material3.Divider(
+                        modifier = Modifier.padding(vertical = 8.dp),
+                        color = Color.LightGray,
+                        thickness = 1.dp
+                    )
+                    Spacer(modifier = Modifier.height(8.dp))
+                    Text(
+                        "Название: ${userthing.title}",
+                        fontSize = 18.sp,
+                        modifier = Modifier.padding(start = 8.dp),
+                        color = Color(0xFF92A2B0)
+                    )
+                    val seasonid = userthing.id_season
+                    val season = season.find { it.id == seasonid }
+                    val styleid = userthing.style
+                    val style = style.find { it.id == styleid }
+                    val subtypeid = userthing.subtype
+                    val subtype = subdubtype.find { it.id == subtypeid }
+
+                    if (subtype != null) {
+                        val typeid = subtype.id_type
+                        val type = type.find { it.id == typeid }
+
+
+
+                        if (season != null && style != null && type != null) {
+                            Text(
+                                "Категории: ${style.title_style}, ${type.title_type},  ${subtype.sub_type}, ${season.title_season}",
+                                fontSize = 18.sp,
+                                modifier = Modifier.padding(start = 8.dp),
+                                color = Color(0xFF92A2B0)
+                            )
+
+
+                        }
+                    }
+
+
+                    Spacer(modifier = Modifier.height(8.dp))
+                    Row(
+                        horizontalArrangement = Arrangement.SpaceAround
+                    )
+                    {
+
+
+                        Button(
+                            onClick = { navHost.navigate("Registration") },
+                            modifier = Modifier
+                                .width(200.dp)
+                                .height(50.dp)
+                                .padding(start = 50.dp),
+                            colors = ButtonDefaults.buttonColors(
+                                Color(0xFF6F4A48),
+                                contentColor = Color.White
+                            ),
+                            shape = ButtonDefaults.shape
+                        ) {
+                            Text(
+                                text = "Удалить",
+                                fontSize = 16.sp,
+                                fontWeight = FontWeight.Medium
+                            )
+                        }
+
+
+                    }
+
+                }
+
+            }
+
+            Spacer(modifier = Modifier.height(16.dp))
+
+
+        }
+                    Spacer(modifier = Modifier.height(20.dp))
+            }
+}
+                }
             }
 
 
+        }
+
+    }
+    if (isFilterSheetVisible) {
+        Column {
+            Filters(
+                onApplyFilters = { selectedSubtype, selectedSeason, selectedStyle ->
+                    // Применяем фильтры и обновляем отображение
+                    filteredPublicThings = userthings.filter { userthing ->
+                        (selectedSubtype == null || userthing.subtype == selectedSubtype.id) &&
+                                (selectedSeason == null || userthing.id_season == selectedSeason.id)&&
+                                (selectedStyle == null || userthing.style == selectedStyle.id)
+                    }
+
+                    isFilterSheetVisible = false // Закрываем окно фильтров
+                    filtersApplied = true;
+                },
+                onDismiss = { isFilterSheetVisible = false })
+
         }
     }
+
+
+
 }
 
 

+ 0 - 17
Project_exvesta/app/src/main/java/com/example/exvesta/Screans/auth.kt

@@ -1,17 +0,0 @@
-package com.example.exvesta.Screans
-
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
-import androidx.navigation.NavHostController
-
-@Composable
-fun auth(navHost: NavHostController){
-    val viewModel = MainViewModel()
-    val email = remember { mutableStateOf("") }
-    val password = remember { mutableStateOf("") }
-    var showError = remember { mutableStateOf(false) }
-
-
-
-}

+ 23 - 0
Project_exvesta/app/src/main/java/com/example/exvesta/Screans/items/ItemWard.kt

@@ -0,0 +1,23 @@
+package com.example.exvesta.Screans.items
+
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import com.example.exvesta.model.Type_dublicate
+import com.example.exvesta.model.Wardob
+
+
+@Composable
+fun ItemWard(wardobs: Wardob){
+    Text(
+        wardobs.toString(),
+        modifier = Modifier.padding(8.dp),
+    )
+}
+
+
+
+
+

+ 2 - 0
Project_exvesta/gradle/libs.versions.toml

@@ -23,6 +23,7 @@ uiAndroid = "1.7.2"
 volley = "1.2.1"
 material = "1.7.5"
 coilCompose = "2.4.0"
+toolsCore = "1.0.0-alpha10"
 [libraries]
 androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
 bom = { module = "io.github.jan-tennert.supabase:bom", version.ref = "bom" }
@@ -67,6 +68,7 @@ androidx-navigation-compose = { group = "androidx.navigation", name = "navigatio
 androidx-runtime-android = { group = "androidx.compose.runtime", name = "runtime-android", version.ref = "runtimeAndroid" }
 androidx-ui-android = { group = "androidx.compose.ui", name = "ui-android", version.ref = "uiAndroid" }
 volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
+androidx-tools-core = { group = "androidx.privacysandbox.tools", name = "tools-core", version.ref = "toolsCore" }
 
 [plugins]
 android-application = { id = "com.android.application", version.ref = "agp" }