Fix search favorites tag expand icon color

This commit is contained in:
MM20 2024-05-17 12:35:59 +02:00
parent 9f8fdfaf65
commit 6793047577
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -12,7 +12,9 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Star
import androidx.compose.material.icons.rounded.Tag
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
@ -37,41 +39,43 @@ fun LazyListScope.SearchFavorites(
item(
key = "favorites",
) {
Column(
modifier = Modifier
.padding(
top = if (reverse) 8.dp else 0.dp,
bottom = if (reverse) 0.dp else 8.dp,
)
.background(
MaterialTheme.colorScheme.surface.copy(
LocalCardStyle.current.opacity
),
MaterialTheme.shapes.medium
)
) {
if (favorites.isNotEmpty()) {
SearchResultGrid(favorites)
} else {
Banner(
modifier = Modifier.padding(16.dp),
text = stringResource(
if (selectedTag == null) R.string.favorites_empty else R.string.favorites_empty_tag
),
icon = if (selectedTag == null) Icons.Rounded.Star else Icons.Rounded.Tag,
)
}
if (pinnedTags.isNotEmpty() || editButton) {
FavoritesTagSelector(
tags = pinnedTags,
selectedTag = selectedTag,
editButton = editButton,
reverse = false,
onSelectTag = onSelectTag,
scrollState = rememberScrollState(),
expanded = tagsExpanded,
onExpand = onExpandTags,
)
CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onSurface) {
Column(
modifier = Modifier
.padding(
top = if (reverse) 8.dp else 0.dp,
bottom = if (reverse) 0.dp else 8.dp,
)
.background(
MaterialTheme.colorScheme.surface.copy(
LocalCardStyle.current.opacity
),
MaterialTheme.shapes.medium
)
) {
if (favorites.isNotEmpty()) {
SearchResultGrid(favorites)
} else {
Banner(
modifier = Modifier.padding(16.dp),
text = stringResource(
if (selectedTag == null) R.string.favorites_empty else R.string.favorites_empty_tag
),
icon = if (selectedTag == null) Icons.Rounded.Star else Icons.Rounded.Tag,
)
}
if (pinnedTags.isNotEmpty() || editButton) {
FavoritesTagSelector(
tags = pinnedTags,
selectedTag = selectedTag,
editButton = editButton,
reverse = false,
onSelectTag = onSelectTag,
scrollState = rememberScrollState(),
expanded = tagsExpanded,
onExpand = onExpandTags,
)
}
}
}
}