pull/480/head
gedoor 4 years ago
parent 8a51fd77cf
commit c0a2b69eea
  1. 8
      app/src/main/java/io/legado/app/help/AppConfig.kt

@ -1,6 +1,5 @@
package io.legado.app.help package io.legado.app.help
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import io.legado.app.App import io.legado.app.App
@ -13,7 +12,6 @@ import io.legado.app.utils.*
object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener { object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
private val context get() = App.INSTANCE private val context get() = App.INSTANCE
val isGooglePlay = context.channel == "google" val isGooglePlay = context.channel == "google"
val isCoolApk = context.channel == "coolApk"
var replaceEnableDefault = context.getPrefBoolean(PreferKey.replaceEnableDefault, true) var replaceEnableDefault = context.getPrefBoolean(PreferKey.replaceEnableDefault, true)
var isEInkMode = context.getPrefString(PreferKey.themeMode) == "3" var isEInkMode = context.getPrefString(PreferKey.themeMode) == "3"
var clickActionTL = context.getPrefInt(PreferKey.clickActionTL, 2) var clickActionTL = context.getPrefInt(PreferKey.clickActionTL, 2)
@ -104,11 +102,8 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
} }
} }
var isShowRSS: Boolean val isShowRSS: Boolean
get() = context.getPrefBoolean(PreferKey.showRss, true) get() = context.getPrefBoolean(PreferKey.showRss, true)
set(value) {
context.putPrefBoolean(PreferKey.showRss, value)
}
val autoRefreshBook: Boolean val autoRefreshBook: Boolean
get() = context.getPrefBoolean(R.string.pk_auto_refresh) get() = context.getPrefBoolean(R.string.pk_auto_refresh)
@ -148,7 +143,6 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
} }
var elevation: Int var elevation: Int
@SuppressLint("PrivateResource")
get() = context.getPrefInt(PreferKey.barElevation, AppConst.sysElevation) get() = context.getPrefInt(PreferKey.barElevation, AppConst.sysElevation)
set(value) { set(value) {
context.putPrefInt(PreferKey.barElevation, value) context.putPrefInt(PreferKey.barElevation, value)

Loading…
Cancel
Save