pull/854/head
gedoor 4 years ago
parent 4d98146751
commit c5943770df
  1. 1
      app/src/main/assets/updateLog.md
  2. 2
      app/src/main/java/io/legado/app/constant/PreferKey.kt
  3. 3
      app/src/main/java/io/legado/app/help/AppConfig.kt
  4. 3
      app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt
  5. 4
      app/src/main/java/io/legado/app/utils/ContextExtensions.kt
  6. 2
      app/src/main/res/values/pref_key_value.xml
  7. 4
      app/src/main/res/xml/pref_config_other.xml

@ -6,6 +6,7 @@
**2021/02/13**
* 修复分享内容不对的bug
* 优化主题颜色,添加透明度
* rss分类url支持js
**2021/02/09**
* 修复分组内书籍数目少于搜索线程数目,会导致搜索线程数目变低

@ -65,6 +65,8 @@ object PreferKey {
const val screenOrientation = "screenOrientation"
const val syncBookProgress = "syncBookProgress"
const val preDownload = "preDownload"
const val autoRefresh = "auto_refresh"
const val defaultToRead = "defaultToRead"
const val cPrimary = "colorPrimary"
const val cAccent = "colorAccent"

@ -2,7 +2,6 @@ package io.legado.app.help
import android.content.Context
import android.content.SharedPreferences
import io.legado.app.R
import io.legado.app.constant.AppConst
import io.legado.app.constant.PreferKey
import io.legado.app.utils.*
@ -96,7 +95,7 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
get() = context.getPrefBoolean(PreferKey.showRss, true)
val autoRefreshBook: Boolean
get() = context.getPrefBoolean(R.string.pk_auto_refresh)
get() = context.getPrefBoolean(PreferKey.autoRefresh)
var threadCount: Int
get() = context.getPrefInt(PreferKey.threadCount, 16)

@ -3,7 +3,6 @@ package io.legado.app.ui.welcome
import android.content.Intent
import android.os.Bundle
import com.hankcs.hanlp.HanLP
import io.legado.app.R
import io.legado.app.base.BaseActivity
import io.legado.app.constant.PreferKey
import io.legado.app.data.appDb
@ -54,7 +53,7 @@ open class WelcomeActivity : BaseActivity<ActivityWelcomeBinding>() {
private fun startMainActivity() {
startActivity<MainActivity>()
if (getPrefBoolean(R.string.pk_default_read)) {
if (getPrefBoolean(PreferKey.defaultToRead)) {
startActivity<ReadBookActivity>()
}
finish()

@ -17,7 +17,6 @@ import android.provider.Settings
import android.widget.Toast
import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider
import androidx.core.content.edit
@ -68,9 +67,6 @@ val Context.defaultSharedPreferences: SharedPreferences
fun Context.getPrefBoolean(key: String, defValue: Boolean = false) =
defaultSharedPreferences.getBoolean(key, defValue)
fun Context.getPrefBoolean(@StringRes keyId: Int, defValue: Boolean = false) =
defaultSharedPreferences.getBoolean(getString(keyId), defValue)
fun Context.putPrefBoolean(key: String, value: Boolean = false) =
defaultSharedPreferences.edit { putBoolean(key, value) }

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="pk_auto_refresh" translatable="false">auto_refresh</string>
<string name="pk_bookshelf_px" translatable="false">bookshelf_px</string>
<string name="pk_default_read" translatable="false">defaultToRead</string>
<string name="legado_gzh" translatable="false">开源阅读</string>
<string name="source_rule_url" translatable="false">https://alanskycn.gitee.io/teachme/</string>

@ -18,14 +18,14 @@
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false"
android:key="@string/pk_auto_refresh"
android:key="auto_refresh"
android:summary="@string/ps_auto_refresh"
android:title="@string/pt_auto_refresh"
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false"
android:key="@string/pk_default_read"
android:key="defaultToRead"
android:summary="@string/ps_default_read"
android:title="@string/pt_default_read"
app:iconSpaceReserved="false" />

Loading…
Cancel
Save