Add config override and per-app proxy feature

This commit is contained in:
iKirby authored and 世界 committed 2023-07-30 19:57:23 +08:00
1 parent af0046ce1c
commit 9575764f40
25 files changed
+1052 -17

No files matched your search

@@ -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,