Add config override and per-app proxy feature

This commit is contained in:
iKirby
2023-07-27 22:17:25 +08:00
committed by 世界
parent af0046ce1c
commit 9575764f40
25 changed files with 1052 additions and 17 deletions

View File

@@ -53,6 +53,11 @@ fun PreferenceDataStore.stringToLong(
getString(key, "$default")?.toLongOrNull() ?: default
}, { key, value -> putString(key, "$value") })
fun PreferenceDataStore.stringSet(
name: String,
defaultValue: () -> Set<String> = { emptySet() }
) = PreferenceProxy(name, defaultValue, ::getStringSet, ::putStringSet)
class PreferenceProxy<T>(
val name: String,
val defaultValue: () -> T,