diff --git a/app/src/main/java/io/github/zyrouge/symphony/services/Settings.kt b/app/src/main/java/io/github/zyrouge/symphony/services/Settings.kt index 932f9abb..f84bb1a2 100644 --- a/app/src/main/java/io/github/zyrouge/symphony/services/Settings.kt +++ b/app/src/main/java/io/github/zyrouge/symphony/services/Settings.kt @@ -147,6 +147,7 @@ class Settings(private val symphony: Symphony) { AlbumRepository.SortBy.ALBUM_NAME, ) val lastUsedAlbumsSortReverse = BooleanEntry("last_used_albums_sort_reverse", false) + val lastUsedAlbumsTileSize = FloatEntry("last_used_albums_tile_size", 200f) val lastUsedGenresSortBy = EnumEntry( "last_used_genres_sort_by", enumEntries(), diff --git a/app/src/main/java/io/github/zyrouge/symphony/ui/components/AlbumGrid.kt b/app/src/main/java/io/github/zyrouge/symphony/ui/components/AlbumGrid.kt index 377cee39..41b97ee8 100644 --- a/app/src/main/java/io/github/zyrouge/symphony/ui/components/AlbumGrid.kt +++ b/app/src/main/java/io/github/zyrouge/symphony/ui/components/AlbumGrid.kt @@ -13,7 +13,6 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableFloatStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue @@ -35,7 +34,8 @@ fun AlbumGrid( context.symphony.groove.album.sort(albumIds, sortBy, sortReverse) } } - var tileSize by remember { mutableFloatStateOf(200f) } + val tileSize by context.symphony.settings.lastUsedAlbumsTileSize.flow.collectAsState() + val sheetState = rememberModalBottomSheetState() var showBottomSheet by remember { mutableStateOf(false) } @@ -93,7 +93,11 @@ fun AlbumGrid( ) { ResponsiveGridSizeAdjust( tileSize, - onTileSizeChange = { tileSize = it }, + onTileSizeChange = { + context.symphony.settings.lastUsedAlbumsTileSize.setValue( + it + ) + }, ) } }