Migrate to DataStore
This commit is contained in:
@@ -270,6 +270,8 @@ fun HomeScreen(intentVideoId: String?) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!preferences.isReady) return@LazyColumn
|
||||
|
||||
item {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
@@ -302,9 +304,7 @@ fun HomeScreen(intentVideoId: String?) {
|
||||
modifier = Modifier
|
||||
.clickable {
|
||||
val values = SongCollection.values()
|
||||
|
||||
preferences.homePageSongCollection =
|
||||
values[(preferences.homePageSongCollection.ordinal + 1) % values.size]
|
||||
preferences.onHomePageSongCollectionChange(values[(preferences.homePageSongCollection.ordinal + 1) % values.size])
|
||||
}
|
||||
.padding(horizontal = 8.dp, vertical = 8.dp)
|
||||
.size(16.dp)
|
||||
|
||||
@@ -51,7 +51,6 @@ fun LocalPlaylistScreen(
|
||||
Database.playlistWithSongs(playlistId).map { it ?: PlaylistWithSongs.NotFound }
|
||||
}.collectAsState(initial = PlaylistWithSongs.Empty, context = Dispatchers.IO)
|
||||
|
||||
|
||||
val lazyListState = rememberLazyListState()
|
||||
|
||||
val albumRoute = rememberAlbumRoute()
|
||||
|
||||
@@ -183,9 +183,7 @@ fun SearchResultScreen(
|
||||
selectedTextStyle = typography.xs.medium.color(colorPalette.onPrimaryContainer),
|
||||
unselectedTextStyle = typography.xs.medium,
|
||||
shape = RoundedCornerShape(36.dp),
|
||||
onValueChanged = { filter ->
|
||||
preferences.searchFilter = filter
|
||||
},
|
||||
onValueChanged = preferences.onSearchFilterChange,
|
||||
modifier = Modifier
|
||||
.padding(vertical = 8.dp)
|
||||
.padding(horizontal = 16.dp)
|
||||
|
||||
@@ -112,17 +112,13 @@ fun SettingsScreen() {
|
||||
EnumValueSelectorEntry(
|
||||
title = "Theme mode",
|
||||
selectedValue = preferences.colorPaletteMode,
|
||||
onValueSelected = {
|
||||
preferences.colorPaletteMode = it
|
||||
}
|
||||
onValueSelected = preferences.onColorPaletteModeChange
|
||||
)
|
||||
|
||||
EnumValueSelectorEntry(
|
||||
title = "Thumbnail roundness",
|
||||
selectedValue = preferences.thumbnailRoundness,
|
||||
onValueSelected = {
|
||||
preferences.thumbnailRoundness = it
|
||||
}
|
||||
onValueSelected = preferences.onThumbnailRoundnessChange
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +449,8 @@ fun PlayerView(
|
||||
.clickable {
|
||||
player.mediaController.repeatMode =
|
||||
(player.mediaController.repeatMode + 2) % 3
|
||||
preferences.repeatMode = player.mediaController.repeatMode
|
||||
|
||||
preferences.onRepeatModeChange(player.mediaController.repeatMode)
|
||||
}
|
||||
.padding(horizontal = 16.dp)
|
||||
.size(28.dp)
|
||||
|
||||
Reference in New Issue
Block a user