|
@@ -58,16 +58,17 @@ import androidx.compose.runtime.*
|
|
@Composable
|
|
@Composable
|
|
public fun Filters(isVisible: Boolean, onClose: () -> Unit) {
|
|
public fun Filters(isVisible: Boolean, onClose: () -> Unit) {
|
|
var styledubs by remember { mutableStateOf<List<Style_dublicate>>(listOf()) }
|
|
var styledubs by remember { mutableStateOf<List<Style_dublicate>>(listOf()) }
|
|
- var subdubtype by remember { mutableStateOf<List<Type_subtype_dublicate>>(listOf()) }
|
|
|
|
- var dubtype by remember { mutableStateOf<List<Type_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 seasondubs by remember { mutableStateOf<List<Season_dublicate>>(listOf()) }
|
|
var selectedSeasondub by remember { mutableStateOf<Season_dublicate?>(null) }
|
|
var selectedSeasondub by remember { mutableStateOf<Season_dublicate?>(null) }
|
|
var selectedStyledub by remember { mutableStateOf<Style_dublicate?>(null) }
|
|
var selectedStyledub by remember { mutableStateOf<Style_dublicate?>(null) }
|
|
|
|
+ var selectedTypedub by remember { mutableStateOf<Type_subtype_dublicate?>(null) }
|
|
LaunchedEffect(Unit) {
|
|
LaunchedEffect(Unit) {
|
|
withContext(Dispatchers.IO) {
|
|
withContext(Dispatchers.IO) {
|
|
- subdubtype = Constants.supabase.from("Type_subtype_dublicate")
|
|
|
|
|
|
+ subdubtypes = Constants.supabase.from("Type_subtype_dublicate")
|
|
.select().decodeList<Type_subtype_dublicate>()
|
|
.select().decodeList<Type_subtype_dublicate>()
|
|
- dubtype = Constants.supabase.from("Type_dublicate")
|
|
|
|
|
|
+ typedubs = Constants.supabase.from("Type_dublicate")
|
|
.select().decodeList<Type_dublicate>()
|
|
.select().decodeList<Type_dublicate>()
|
|
seasondubs = Constants.supabase.from("Season_dublicate")
|
|
seasondubs = Constants.supabase.from("Season_dublicate")
|
|
.select().decodeList<Season_dublicate>()
|
|
.select().decodeList<Season_dublicate>()
|
|
@@ -76,6 +77,9 @@ public fun Filters(isVisible: Boolean, onClose: () -> Unit) {
|
|
seasondubs.forEach { it ->
|
|
seasondubs.forEach { it ->
|
|
Log.d("ts", it.title_season)
|
|
Log.d("ts", it.title_season)
|
|
}
|
|
}
|
|
|
|
+ typedubs.forEach { it ->
|
|
|
|
+ Log.d("ts", it.title_type)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (isVisible) {
|
|
if (isVisible) {
|
|
@@ -102,17 +106,19 @@ public fun Filters(isVisible: Boolean, onClose: () -> Unit) {
|
|
Button(
|
|
Button(
|
|
onClick = { onClose() }, // Закрыть выбор фильтров
|
|
onClick = { onClose() }, // Закрыть выбор фильтров
|
|
modifier = Modifier.padding(top = 16.dp)
|
|
modifier = Modifier.padding(top = 16.dp)
|
|
|
|
+ .background( Color(0xFFD05656),shape = ButtonDefaults.shape),
|
|
|
|
+ colors = ButtonDefaults.buttonColors(containerColor = Color.Transparent)
|
|
) {
|
|
) {
|
|
Text("Закрыть выбор фильтров")
|
|
Text("Закрыть выбор фильтров")
|
|
}
|
|
}
|
|
|
|
|
|
- Spacer(modifier = Modifier.height(30.dp))
|
|
|
|
|
|
+ Spacer(modifier = Modifier.height(20.dp))
|
|
|
|
|
|
// Белый бокс с закругленными краями
|
|
// Белый бокс с закругленными краями
|
|
Box(
|
|
Box(
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
.fillMaxWidth() // Бокс на всю ширину
|
|
.fillMaxWidth() // Бокс на всю ширину
|
|
- .padding(start = 16.dp, end = 16.dp, bottom = 10.dp)
|
|
|
|
|
|
+ .padding(start = 16.dp, end = 16.dp)
|
|
.background(
|
|
.background(
|
|
color = Color.White,
|
|
color = Color.White,
|
|
shape = RoundedCornerShape(16.dp) // Закругленные края
|
|
shape = RoundedCornerShape(16.dp) // Закругленные края
|
|
@@ -120,142 +126,203 @@ public fun Filters(isVisible: Boolean, onClose: () -> Unit) {
|
|
.padding(16.dp) // Отступы внутри бокса
|
|
.padding(16.dp) // Отступы внутри бокса
|
|
) {
|
|
) {
|
|
// Используем Column для размещения текста и кнопки
|
|
// Используем Column для размещения текста и кнопки
|
|
- Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
|
|
|
- // Текст заголовка
|
|
|
|
- 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("Сезон")
|
|
|
|
|
|
+ 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(
|
|
|
|
|
|
- FlowRow(
|
|
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
|
|
+// .align(Alignment.Start)
|
|
.fillMaxWidth()
|
|
.fillMaxWidth()
|
|
- .padding(10.dp)
|
|
|
|
) {
|
|
) {
|
|
- seasondubs.forEach { seasondub ->
|
|
|
|
- Row(
|
|
|
|
- verticalAlignment = Alignment.CenterVertically,
|
|
|
|
- modifier = Modifier
|
|
|
|
- .padding(4.dp) // Отступы между элементами
|
|
|
|
- .selectable(
|
|
|
|
|
|
+ Text("Сезон")
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ FlowRow(
|
|
|
|
+ modifier = Modifier
|
|
|
|
+ .fillMaxWidth()
|
|
|
|
+ .padding(10.dp)
|
|
|
|
+ ) {
|
|
|
|
+ seasondubs.forEach { seasondub ->
|
|
|
|
+ Row(
|
|
|
|
+ verticalAlignment = Alignment.CenterVertically,
|
|
|
|
+ modifier = Modifier
|
|
|
|
+ .padding(4.dp) // Отступы между элементами
|
|
|
|
+ .selectable(
|
|
|
|
+ selected = (seasondub == selectedSeasondub),
|
|
|
|
+ onClick = { selectedSeasondub = seasondub }
|
|
|
|
+ )
|
|
|
|
+ ) {
|
|
|
|
+ RadioButton(
|
|
selected = (seasondub == selectedSeasondub),
|
|
selected = (seasondub == selectedSeasondub),
|
|
onClick = { selectedSeasondub = seasondub }
|
|
onClick = { selectedSeasondub = seasondub }
|
|
)
|
|
)
|
|
- ) {
|
|
|
|
- RadioButton(
|
|
|
|
- selected = (seasondub == selectedSeasondub),
|
|
|
|
- onClick = { selectedSeasondub = seasondub }
|
|
|
|
- )
|
|
|
|
- Text(
|
|
|
|
- text = seasondub.title_season,
|
|
|
|
- fontSize = 16.sp,
|
|
|
|
- modifier = Modifier.padding(start = 8.dp),
|
|
|
|
- color = Color(0xFF92A2B0)
|
|
|
|
- )
|
|
|
|
|
|
+ Text(
|
|
|
|
+ text = seasondub.title_season,
|
|
|
|
+ fontSize = 16.sp,
|
|
|
|
+ modifier = Modifier.padding(start = 8.dp),
|
|
|
|
+ color = Color(0xFF92A2B0)
|
|
|
|
+ )
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
Spacer(modifier = Modifier.height(10.dp))
|
|
Spacer(modifier = Modifier.height(10.dp))
|
|
- Box(
|
|
|
|
|
|
+ Box(
|
|
|
|
|
|
- modifier = Modifier
|
|
|
|
- .align(Alignment.Start)
|
|
|
|
- .fillMaxWidth()
|
|
|
|
|
|
+ modifier = Modifier
|
|
|
|
+// .align(Alignment.Start)
|
|
|
|
+ .fillMaxWidth()
|
|
|
|
|
|
- ) {
|
|
|
|
- Text("Стиль")
|
|
|
|
- }
|
|
|
|
- Box(
|
|
|
|
|
|
+ ) {
|
|
|
|
+ Text("Стиль")
|
|
|
|
+ }
|
|
|
|
+ Box(
|
|
|
|
|
|
- modifier = Modifier
|
|
|
|
- .align(Alignment.Start)
|
|
|
|
- .fillMaxWidth()
|
|
|
|
- .padding(10.dp)
|
|
|
|
- ) {
|
|
|
|
- FlowRow(
|
|
|
|
- modifier = Modifier
|
|
|
|
- .fillMaxWidth()
|
|
|
|
- .padding(10.dp)
|
|
|
|
- ) {
|
|
|
|
- styledubs.forEach { styledub ->
|
|
|
|
- Box(
|
|
|
|
|
|
+ modifier = Modifier
|
|
|
|
+// .align(Alignment.Start)
|
|
|
|
+ .fillMaxWidth()
|
|
|
|
+ .padding(10.dp)
|
|
|
|
+ ) {
|
|
|
|
+ FlowRow(
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
- .padding(4.dp) // Отступы между элементами
|
|
|
|
- .background(
|
|
|
|
- Color(0xFFF1F1F3),
|
|
|
|
- shape = RoundedCornerShape(20.dp)
|
|
|
|
- )
|
|
|
|
- .width(145.dp)// Задаем одинаковую ширину для всех элементов
|
|
|
|
- .height(38.dp) // Устанавливаем фиксированную высоту для всех элементов
|
|
|
|
|
|
+ .fillMaxWidth()
|
|
|
|
+ .padding(10.dp)
|
|
) {
|
|
) {
|
|
- Row(
|
|
|
|
- verticalAlignment = Alignment.CenterVertically,
|
|
|
|
- modifier = Modifier
|
|
|
|
|
|
+ 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 == selectedStyledub),
|
|
|
|
- onClick = { selectedStyledub = styledub }
|
|
|
|
- )
|
|
|
|
- ) {
|
|
|
|
- RadioButton(
|
|
|
|
- selected = (styledub == selectedStyledub),
|
|
|
|
- onClick = { selectedStyledub = styledub }
|
|
|
|
- )
|
|
|
|
- Text(
|
|
|
|
- text = styledub.title_style,
|
|
|
|
- fontSize = 16.sp,
|
|
|
|
- modifier = Modifier.padding(start = 0.dp), // Отступ слева от радиокнопки
|
|
|
|
- color = Color(0xFF92A2B0)
|
|
|
|
- )
|
|
|
|
|
|
+ .selectable(
|
|
|
|
+ selected = (styledub == selectedStyledub),
|
|
|
|
+ onClick = { selectedStyledub = styledub }
|
|
|
|
+ )
|
|
|
|
+ ) {
|
|
|
|
+ RadioButton(
|
|
|
|
+ selected = (styledub == selectedStyledub),
|
|
|
|
+ onClick = { selectedStyledub = styledub }
|
|
|
|
+ )
|
|
|
|
+ Text(
|
|
|
|
+ text = styledub.title_style,
|
|
|
|
+ fontSize = 16.sp,
|
|
|
|
+ modifier = Modifier.padding(start = 0.dp), // Отступ слева от радиокнопки
|
|
|
|
+ color = Color(0xFF92A2B0)
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
- Box(
|
|
|
|
|
|
+ Box(
|
|
|
|
|
|
- modifier = Modifier
|
|
|
|
- .align(Alignment.Start)
|
|
|
|
- .fillMaxWidth()
|
|
|
|
|
|
+ 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 == selectedTypedub),
|
|
|
|
+ onClick = { selectedTypedub = subtypedub }
|
|
|
|
+ )
|
|
|
|
+ .padding(top = 14.dp)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ ) {
|
|
|
|
+ RadioButton(
|
|
|
|
+ selected = (subtypedub == selectedTypedub),
|
|
|
|
+ onClick = { selectedTypedub = subtypedub }
|
|
|
|
+ )
|
|
|
|
+ Text(
|
|
|
|
+ text = subtypedub.sub_type,
|
|
|
|
+ fontSize = 16.sp,
|
|
|
|
+ modifier = Modifier.padding(start = 0.dp), // Отступ слева от радиокнопки
|
|
|
|
+ color = Color(0xFF92A2B0)
|
|
|
|
+
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
- ) {
|
|
|
|
- Text("Типы")
|
|
|
|
- }
|
|
|
|
|
|
|
|
- FlowRow(
|
|
|
|
- modifier = Modifier
|
|
|
|
- .fillMaxWidth()
|
|
|
|
- .padding(10.dp)
|
|
|
|
- )
|
|
|
|
- {
|
|
|
|
- Column() {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
|
- Button(
|
|
|
|
- onClick = { /* Действие при нажатии */ },
|
|
|
|
|
|
+ Button(
|
|
|
|
+ onClick = { /* Действие при нажатии */ },
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
|
|
+ .align(Alignment.BottomCenter)
|
|
.fillMaxWidth() // Занять всю ширину
|
|
.fillMaxWidth() // Занять всю ширину
|
|
.height(50.dp)
|
|
.height(50.dp)
|
|
.padding(horizontal = 20.dp)
|
|
.padding(horizontal = 20.dp)
|
|
@@ -268,7 +335,8 @@ public fun Filters(isVisible: Boolean, onClose: () -> Unit) {
|
|
),
|
|
),
|
|
shape = ButtonDefaults.shape
|
|
shape = ButtonDefaults.shape
|
|
),
|
|
),
|
|
- colors = ButtonDefaults.buttonColors(containerColor = Color.Transparent)
|
|
|
|
|
|
+ colors = ButtonDefaults.buttonColors(containerColor = Color.Transparent),
|
|
|
|
+
|
|
) {
|
|
) {
|
|
Text(
|
|
Text(
|
|
text = "Применить",
|
|
text = "Применить",
|
|
@@ -276,7 +344,6 @@ public fun Filters(isVisible: Boolean, onClose: () -> Unit) {
|
|
fontWeight = FontWeight.Medium
|
|
fontWeight = FontWeight.Medium
|
|
)
|
|
)
|
|
}
|
|
}
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|