Start UI redesign (#172)
This commit is contained in:
@@ -21,7 +21,6 @@ const val songSortOrderKey = "songSortOrder"
|
||||
const val songSortByKey = "songSortBy"
|
||||
const val playlistSortOrderKey = "playlistSortOrder"
|
||||
const val playlistSortByKey = "playlistSortBy"
|
||||
const val playlistGridExpandedKey = "playlistGridExpanded"
|
||||
const val searchFilterKey = "searchFilter"
|
||||
const val repeatModeKey = "repeatMode"
|
||||
const val skipSilenceKey = "skipSilence"
|
||||
@@ -29,6 +28,7 @@ const val volumeNormalizationKey = "volumeNormalization"
|
||||
const val persistentQueueKey = "persistentQueue"
|
||||
const val isShowingSynchronizedLyricsKey = "isShowingSynchronizedLyrics"
|
||||
const val isShowingThumbnailInLockscreenKey = "isShowingThumbnailInLockscreen"
|
||||
const val homeScreenTabIndexKey = "homeScreenTabIndex"
|
||||
|
||||
inline fun <reified T : Enum<T>> SharedPreferences.getEnum(
|
||||
key: String,
|
||||
@@ -61,6 +61,16 @@ fun rememberPreference(key: String, defaultValue: Boolean): MutableState<Boolean
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun rememberPreference(key: String, defaultValue: Int): MutableState<Int> {
|
||||
val context = LocalContext.current
|
||||
return remember {
|
||||
mutableStatePreferenceOf(context.preferences.getInt(key, defaultValue)) {
|
||||
context.preferences.edit { putInt(key, it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun rememberPreference(key: String, defaultValue: String): MutableState<String> {
|
||||
val context = LocalContext.current
|
||||
|
||||
Reference in New Issue
Block a user