feat(filters): быстрый выбор категории + очистка поиска
- Кнопка-«категории» (круглая, акцентная рамка, иконка SlidersHorizontal) СЛЕВА от чипа «Все» — на экранах Радио и Чарты. Открывает шторку со списком всех категорий (Радио — жанры, Чарты — стили) + поиск, чтобы не листать чипы. CategoryPicker — переиспользуемый компонент с поиском и отметкой выбранного. - SearchBar: анимированная кнопка очистки (X, scale+fade появление, haptic) при непустом запросе.
This commit is contained in:
@@ -44,6 +44,7 @@ import com.radiola.domain.model.ChartTrend
|
||||
import com.radiola.domain.model.DeeplinkService
|
||||
import com.radiola.domain.model.StatPoint
|
||||
import com.radiola.domain.model.TrackStats
|
||||
import com.radiola.ui.components.CategoryPicker
|
||||
import com.radiola.ui.components.EmptyState
|
||||
import com.radiola.ui.components.PopularityChart
|
||||
import com.radiola.ui.components.crossfadeModel
|
||||
@@ -101,11 +102,21 @@ fun ChartsScreen(
|
||||
// Фильтр по жанру (если бэкенд уже накопил жанры)
|
||||
if (genres.isNotEmpty()) {
|
||||
Spacer(Modifier.height(10.dp))
|
||||
GenreSelector(
|
||||
genres = genres,
|
||||
selected = selectedGenre,
|
||||
onSelect = viewModel::selectGenre
|
||||
)
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
CategoryPicker(
|
||||
title = "Стиль музыки",
|
||||
items = genres,
|
||||
selected = selectedGenre,
|
||||
onSelect = viewModel::selectGenre,
|
||||
modifier = Modifier.padding(start = 20.dp)
|
||||
)
|
||||
GenreSelector(
|
||||
genres = genres,
|
||||
selected = selectedGenre,
|
||||
onSelect = viewModel::selectGenre,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(Modifier.height(12.dp))
|
||||
@@ -213,9 +224,11 @@ private fun PeriodChip(label: String, selected: Boolean, onClick: () -> Unit) {
|
||||
private fun GenreSelector(
|
||||
genres: List<String>,
|
||||
selected: String?,
|
||||
onSelect: (String?) -> Unit
|
||||
onSelect: (String?) -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
LazyRow(
|
||||
modifier = modifier,
|
||||
horizontalArrangement = Arrangement.spacedBy(9.dp),
|
||||
contentPadding = PaddingValues(horizontal = 20.dp)
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user