pull/1319/head
gedoor 3 years ago
parent fa8d85e721
commit d979cf4aa1
  1. 16
      app/src/main/assets/updateLog.md
  2. 2
      app/src/main/java/io/legado/app/data/entities/rule/ContentRule.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt
  4. 2
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
  5. 21
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt

@ -16,19 +16,9 @@
1. 书架菜单添加了日志,更新失败的和下载失败的信息会显示在里面 1. 书架菜单添加了日志,更新失败的和下载失败的信息会显示在里面
2. 书源添加校验关键字,有校验关键字的书源用此关键字校验 2. 书源添加校验关键字,有校验关键字的书源用此关键字校验
3. 正文规则添加操作规则,可执行js和打开网页,格式: 3. 目录添加购买标识规则
4. 正文标题使用替换,简繁转换,正文中已书名,标题开头的自动去重
```json 5. 其它一些优化
[
{
"name": "购买",
"action": "http:xxxx"
}
]
```
4. 目录添加购买标识规则
5. 正文标题使用替换,简繁转换,正文中已书名,标题开头的自动去重
**2021/09/08** **2021/09/08**

@ -11,5 +11,5 @@ data class ContentRule(
var sourceRegex: String? = null, var sourceRegex: String? = null,
var replaceRegex: String? = null, //替换规则 var replaceRegex: String? = null, //替换规则
var imageStyle: String? = null, //默认大小居中,FULL最大宽度 var imageStyle: String? = null, //默认大小居中,FULL最大宽度
var actions: String? = null //操作 var payAction: String? = null, //购买操作,url/js
) : Parcelable ) : Parcelable

@ -143,9 +143,11 @@ class ReadMenu @JvmOverloads constructor(
tvChapterUrl.setOnClickListener { tvChapterUrl.setOnClickListener {
context.openUrl(binding.tvChapterUrl.text.toString()) context.openUrl(binding.tvChapterUrl.text.toString())
} }
//登录
tvLogin.setOnClickListener { tvLogin.setOnClickListener {
callBack.showLogin() callBack.showLogin()
} }
//亮度跟随
ivBrightnessAuto.setOnClickListener { ivBrightnessAuto.setOnClickListener {
context.putPrefBoolean("brightnessAuto", !brightnessAuto()) context.putPrefBoolean("brightnessAuto", !brightnessAuto())
upBrightnessState() upBrightnessState()

@ -275,7 +275,6 @@ class BookSourceEditActivity :
add(EditEntity("sourceRegex", cr?.sourceRegex, R.string.rule_source_regex)) add(EditEntity("sourceRegex", cr?.sourceRegex, R.string.rule_source_regex))
add(EditEntity("replaceRegex", cr?.replaceRegex, R.string.rule_replace_regex)) add(EditEntity("replaceRegex", cr?.replaceRegex, R.string.rule_replace_regex))
add(EditEntity("imageStyle", cr?.imageStyle, R.string.rule_image_style)) add(EditEntity("imageStyle", cr?.imageStyle, R.string.rule_image_style))
add(EditEntity("actions", cr?.actions, R.string.rule_actions))
} }
binding.tabLayout.selectTab(binding.tabLayout.getTabAt(0)) binding.tabLayout.selectTab(binding.tabLayout.getTabAt(0))
setEditEntities(0) setEditEntities(0)
@ -370,7 +369,6 @@ class BookSourceEditActivity :
"sourceRegex" -> contentRule.sourceRegex = it.value "sourceRegex" -> contentRule.sourceRegex = it.value
"replaceRegex" -> contentRule.replaceRegex = it.value "replaceRegex" -> contentRule.replaceRegex = it.value
"imageStyle" -> contentRule.imageStyle = it.value "imageStyle" -> contentRule.imageStyle = it.value
"actions" -> contentRule.actions = it.value
} }
} }
source.ruleSearch = searchRule source.ruleSearch = searchRule

@ -163,17 +163,19 @@ class ThemeConfigFragment : BasePreferenceFragment(),
"saveDayTheme", "saveNightTheme" -> alertSaveTheme(key) "saveDayTheme", "saveNightTheme" -> alertSaveTheme(key)
PreferKey.bgImage -> selectBgAction(false) PreferKey.bgImage -> selectBgAction(false)
PreferKey.bgImageN -> selectBgAction(true) PreferKey.bgImageN -> selectBgAction(true)
PreferKey.defaultCover -> if (getPrefString(PreferKey.defaultCover).isNullOrEmpty()) { PreferKey.defaultCover ->
selectImage.launch(requestCodeCover) if (getPrefString(PreferKey.defaultCover).isNullOrEmpty()) {
} else { selectImage.launch(requestCodeCover)
selector(items = arrayListOf("删除图片", "选择图片")) { _, i -> } else {
if (i == 0) { selector(items = arrayListOf("删除图片", "选择图片")) { _, i ->
removePref(PreferKey.defaultCover) if (i == 0) {
} else { removePref(PreferKey.defaultCover)
selectImage.launch(requestCodeCover) CoverImageView.upDefaultCover()
} else {
selectImage.launch(requestCodeCover)
}
} }
} }
}
PreferKey.defaultCoverDark -> PreferKey.defaultCoverDark ->
if (getPrefString(PreferKey.defaultCoverDark).isNullOrEmpty()) { if (getPrefString(PreferKey.defaultCoverDark).isNullOrEmpty()) {
selectImage.launch(requestCodeCoverDark) selectImage.launch(requestCodeCoverDark)
@ -181,6 +183,7 @@ class ThemeConfigFragment : BasePreferenceFragment(),
selector(items = arrayListOf("删除图片", "选择图片")) { _, i -> selector(items = arrayListOf("删除图片", "选择图片")) { _, i ->
if (i == 0) { if (i == 0) {
removePref(PreferKey.defaultCoverDark) removePref(PreferKey.defaultCoverDark)
CoverImageView.upDefaultCover()
} else { } else {
selectImage.launch(requestCodeCoverDark) selectImage.launch(requestCodeCoverDark)
} }

Loading…
Cancel
Save