pull/1162/head
gedoor 3 years ago
parent b356b1bbbb
commit ec4c188063
  1. 5
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt
  2. 10
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt

@ -117,8 +117,9 @@ class AnalyzeUrl(
//替换所有内嵌{{js}}
val url = analyze.innerRule("{{", "}}") {
when (val jsEval = SCRIPT_ENGINE.eval(it, bindings)) {
is String -> jsEval
val jsEval = SCRIPT_ENGINE.eval(it, bindings) ?: ""
when {
jsEval is String -> jsEval
jsEval is Double && jsEval % 1.0 == 0.0 -> String.format("%.0f", jsEval)
else -> jsEval.toString()
}

@ -592,7 +592,7 @@ class ReadBookActivity : ReadBookBaseActivity(),
resetPageOffset: Boolean,
success: (() -> Unit)?
) {
lifecycleScope.launch {
runOnUI {
autoPageProgress = 0
binding.readView.upContent(relativePosition, resetPageOffset)
binding.readMenu.setSeekPage(ReadBook.durPageIndex())
@ -605,13 +605,13 @@ class ReadBookActivity : ReadBookBaseActivity(),
* 更新视图
*/
override fun upView() {
lifecycleScope.launch {
runOnUI {
binding.readMenu.upBookView()
}
}
override fun upPageAnim() {
lifecycleScope.launch {
runOnUI {
binding.readView.upPageAnim()
}
}
@ -620,12 +620,12 @@ class ReadBookActivity : ReadBookBaseActivity(),
* 页面改变
*/
override fun pageChanged() {
runOnUI {
autoPageProgress = 0
lifecycleScope.launch {
binding.readMenu.setSeekPage(ReadBook.durPageIndex())
}
mHandler.postDelayed(backupRunnable, 600000)
}
}
/**
* 显示菜单

Loading…
Cancel
Save