mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 15:46:09 +00:00
Add German, Japanese, Lithuanian and Chinese UI, closable hint cards, drop license row from About
This commit is contained in:
@@ -25,6 +25,20 @@ class Prefs(context: Context) {
|
||||
get() = sp.getStringSet(KEY_EXCLUDED, null)?.toSet() ?: emptySet()
|
||||
set(value) = sp.edit().putStringSet(KEY_EXCLUDED, value).apply()
|
||||
|
||||
// Hint cards the user closed with the X
|
||||
fun isHintDismissed(key: String): Boolean =
|
||||
sp.getStringSet(KEY_HINTS, null)?.contains(key) == true
|
||||
|
||||
fun dismissHint(key: String) {
|
||||
val current = sp.getStringSet(KEY_HINTS, null)?.toSet() ?: emptySet()
|
||||
sp.edit().putStringSet(KEY_HINTS, current + key).apply()
|
||||
}
|
||||
|
||||
// The Private DNS warning stays closed until the hostname changes
|
||||
var dismissedPrivateDns: String
|
||||
get() = sp.getString(KEY_PRIVATE_DNS, null) ?: ""
|
||||
set(value) = sp.edit().putString(KEY_PRIVATE_DNS, value).apply()
|
||||
|
||||
fun resolve(): DohProvider =
|
||||
if (providerId == Providers.CUSTOM_ID) {
|
||||
DohProvider(Providers.CUSTOM_ID, "Custom", customUrl.trim(), parseIps(customBootstrap), customHttp3)
|
||||
@@ -38,5 +52,7 @@ class Prefs(context: Context) {
|
||||
const val KEY_BOOTSTRAP = "custom_bootstrap"
|
||||
const val KEY_HTTP3 = "custom_http3"
|
||||
const val KEY_EXCLUDED = "excluded_apps"
|
||||
const val KEY_HINTS = "dismissed_hints"
|
||||
const val KEY_PRIVATE_DNS = "dismissed_private_dns"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user