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