优化,添加替换净化默认配置

pull/298/head
gedoor 4 years ago
parent f6dc8bf9fd
commit f297c7cd51
  1. 1
      app/src/main/java/io/legado/app/constant/PreferKey.kt
  2. 3
      app/src/main/java/io/legado/app/data/entities/Book.kt
  3. 3
      app/src/main/java/io/legado/app/help/AppConfig.kt
  4. 2
      app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt
  5. 2
      app/src/main/res/values-zh-rHK/strings.xml
  6. 2
      app/src/main/res/values-zh-rTW/strings.xml
  7. 2
      app/src/main/res/values-zh/strings.xml
  8. 2
      app/src/main/res/values/strings.xml
  9. 7
      app/src/main/res/xml/pref_config_other.xml

@ -50,6 +50,7 @@ object PreferKey {
const val barElevation = "barElevation"
const val transparentStatusBar = "transparentStatusBar"
const val defaultCover = "defaultCover"
const val replaceEnableDefault = "replaceEnableDefault"
const val cPrimary = "colorPrimary"
const val cAccent = "colorAccent"

@ -8,6 +8,7 @@ import androidx.room.PrimaryKey
import io.legado.app.App
import io.legado.app.constant.AppPattern
import io.legado.app.constant.BookType
import io.legado.app.help.AppConfig
import io.legado.app.service.help.ReadBook
import io.legado.app.utils.GSON
import io.legado.app.utils.fromJsonObject
@ -51,7 +52,7 @@ data class Book(
var canUpdate: Boolean = true, // 刷新书架时更新书籍信息
var order: Int = 0, // 手动排序
var originOrder: Int = 0, //书源排序
var useReplaceRule: Boolean = true, // 正文使用净化替换规则
var useReplaceRule: Boolean = AppConfig.replaceEnableDefault, // 正文使用净化替换规则
var variable: String? = null // 自定义书籍变量信息(用于书源规则检索书籍信息)
) : Parcelable, BaseBook {

@ -132,6 +132,9 @@ object AppConfig {
App.INSTANCE.putPrefInt(PreferKey.barElevation, value)
}
var replaceEnableDefault: Boolean =
App.INSTANCE.getPrefBoolean(PreferKey.replaceEnableDefault, true)
val autoChangeSource: Boolean get() = App.INSTANCE.getPrefBoolean("autoChangeSource", true)
val readBodyToLh: Boolean get() = App.INSTANCE.getPrefBoolean(PreferKey.readBodyToLh, true)

@ -22,6 +22,7 @@ import io.legado.app.help.AppConfig
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.theme.bottomBackground
import io.legado.app.ui.filechooser.FileChooserDialog
import io.legado.app.ui.filechooser.FilePicker
import io.legado.app.utils.*
@ -58,6 +59,7 @@ class FontSelectDialog : BaseDialogFragment(),
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
tool_bar.setBackgroundColor(requireContext().bottomBackground)
tool_bar.setTitle(R.string.select_font)
tool_bar.inflateMenu(R.menu.font_select)
tool_bar.setOnMenuItemClickListener(this)

@ -729,4 +729,6 @@
<string name="group_name">分組名稱</string>
<string name="note_content">備註內容</string>
<string name="e_ink_change_bg">E-Ink模式下只有白纸黑字,不显示其它背景</string>
<string name="replace_enable_default_t">默认启用替换净化</string>
<string name="replace_enable_default_s">新加入书架的书是否启用替换净化</string>
</resources>

@ -729,5 +729,7 @@
<string name="group_name">分組名稱</string>
<string name="note_content">備註內容</string>
<string name="e_ink_change_bg">E-Ink模式下只有白纸黑字,不显示其它背景</string>
<string name="replace_enable_default_t">默认启用替换净化</string>
<string name="replace_enable_default_s">新加入书架的书是否启用替换净化</string>
</resources>

@ -729,4 +729,6 @@
<string name="group_name">分组名称</string>
<string name="note_content">备注内容</string>
<string name="e_ink_change_bg">E-Ink模式下只有白纸黑字,不显示其它背景</string>
<string name="replace_enable_default_t">默认启用替换净化</string>
<string name="replace_enable_default_s">新加入书架的书是否启用替换净化</string>
</resources>

@ -730,5 +730,7 @@
<string name="group_name">Group name</string>
<string name="note_content">Remarks section</string>
<string name="e_ink_change_bg">E-Ink模式下只有白纸黑字,不显示其它背景</string>
<string name="replace_enable_default_t">默认启用替换净化</string>
<string name="replace_enable_default_s">新加入书架的书是否启用替换净化</string>
</resources>

@ -45,6 +45,13 @@
app:allowDividerBelow="false"
app:iconSpaceReserved="false">
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="true"
android:key="replaceEnableDefault"
android:title="@string/replace_enable_default_t"
android:summary="@string/replace_enable_default_s"
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.Preference
android:key="threadCount"
android:title="@string/threads_num_title"

Loading…
Cancel
Save