Drop Settings.initialize
This commit is contained in:
1 parent
b5baecf8d0
commit
6725ef992a
2 files changed
+10
-9
No files matched your search
@@ -68,7 +68,6 @@ class EhApplication : Application(), ImageLoaderFactory {
|
||||
}
|
||||
super.onCreate()
|
||||
System.loadLibrary("ehviewer")
|
||||
Settings.initialize()
|
||||
ReadableTime.initialize(this)
|
||||
AppConfig.initialize(this)
|
||||
AppCompatDelegate.setDefaultNightMode(Settings.theme)
|
||||
|
||||
@@ -44,14 +44,6 @@ object Settings : DefaultPreferences() {
|
||||
KEY_HIDE_HV_EVENTS,
|
||||
)
|
||||
|
||||
fun initialize() {
|
||||
if ("CN" == Locale.getDefault().country) {
|
||||
if (KEY_BUILT_IN_HOSTS !in prefs) builtInHosts = true
|
||||
if (KEY_DOMAIN_FRONTING !in prefs) dF = true
|
||||
if (KEY_SHOW_TAG_TRANSLATIONS !in prefs) showTagTranslations = true
|
||||
}
|
||||
}
|
||||
|
||||
var downloadScheme by stringOrNullPref("image_scheme", null)
|
||||
var downloadAuthority by stringOrNullPref("image_authority", null)
|
||||
var downloadPath by stringOrNullPref("image_path", null)
|
||||
@@ -121,6 +113,16 @@ object Settings : DefaultPreferences() {
|
||||
var dohUrl by stringPref("doh_url", "")
|
||||
var lastDawnDay by longPref("last_dawn_day", 0)
|
||||
|
||||
init {
|
||||
if ("CN" == Locale.getDefault().country) {
|
||||
edit {
|
||||
if (KEY_BUILT_IN_HOSTS !in prefs) builtInHosts = true
|
||||
if (KEY_DOMAIN_FRONTING !in prefs) dF = true
|
||||
if (KEY_SHOW_TAG_TRANSLATIONS !in prefs) showTagTranslations = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private interface Delegate<R> {
|
||||
operator fun getValue(thisRef: Any?, prop: KProperty<*>?): R
|
||||
operator fun setValue(thisRef: Any?, prop: KProperty<*>?, value: R)
|
||||
|
||||
Reference in new issue
Block a user