Add dot to make the user aware of battery restrictions

This commit is contained in:
vfsfitvnm
2022-07-11 20:25:40 +02:00
parent 742e8702e5
commit 10b8c66887
3 changed files with 62 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ import it.vfsfitvnm.youtubemusic.YouTube
@Stable
class Preferences(
private val edit: (action: SharedPreferences.Editor.() -> Unit) -> Unit,
initialIsFirstLaunch: Boolean,
initialSongSortBy: SongSortBy,
initialSongSortOrder: SortOrder,
initialColorPaletteMode: ColorPaletteMode,
@@ -30,6 +31,7 @@ class Preferences(
edit = { action: SharedPreferences.Editor.() -> Unit ->
preferences.edit(action = action)
},
initialIsFirstLaunch = preferences.getBoolean(Keys.isFirstLaunch, true),
initialSongSortBy = preferences.getEnum(Keys.songSortBy, SongSortBy.DateAdded),
initialSongSortOrder = preferences.getEnum(Keys.songSortOrder, SortOrder.Descending),
initialColorPaletteMode = preferences.getEnum(Keys.colorPaletteMode, ColorPaletteMode.System),
@@ -44,6 +46,9 @@ class Preferences(
initialIsInvincibilityEnabled = preferences.getBoolean(Keys.isInvincibilityEnabled, false),
)
var isFirstLaunch = initialIsFirstLaunch
set(value) = edit { putBoolean(Keys.isFirstLaunch, value) }
var songSortBy = initialSongSortBy
set(value) = edit { putEnum(Keys.songSortBy, value) }
@@ -81,6 +86,7 @@ class Preferences(
set(value) = edit { putBoolean(Keys.isInvincibilityEnabled, value) }
object Keys {
const val isFirstLaunch = "isFirstLaunch"
const val songSortOrder = "songSortOrder"
const val songSortBy = "songSortBy"
const val colorPaletteMode = "colorPaletteMode"