|
|
@@ -202,6 +202,11 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
ReadBook.readStartTime = System.currentTimeMillis()
|
|
|
+ //web端阅读时,app处于阅读界面,本地记录会覆盖web保存的进度,在此处恢复
|
|
|
+ ReadBook.webBookProgress?.let {
|
|
|
+ ReadBook.setProgress(it)
|
|
|
+ ReadBook.webBookProgress = null
|
|
|
+ }
|
|
|
upSystemUiVisibility()
|
|
|
registerReceiver(timeBatteryReceiver, timeBatteryReceiver.filter)
|
|
|
binding.readView.upTime()
|
|
|
@@ -1170,6 +1175,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
|
|
|
/* 进度条跳转到指定章节 */
|
|
|
override fun skipToChapter(index: Int) {
|
|
|
+ ReadBook.saveCurrentBookProcess() //退出章节跳转恢复此时进度
|
|
|
viewModel.openChapter(index)
|
|
|
}
|
|
|
|
|
|
@@ -1271,10 +1277,6 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
super.observeLiveBus()
|
|
|
observeEvent<String>(EventBus.TIME_CHANGED) { readView.upTime() }
|
|
|
observeEvent<Int>(EventBus.BATTERY_CHANGED) { readView.upBattery(it) }
|
|
|
- observeEvent<BookChapter>(EventBus.OPEN_CHAPTER) {
|
|
|
- viewModel.openChapter(it.index, ReadBook.durChapterPos)
|
|
|
- readView.upContent()
|
|
|
- }
|
|
|
observeEvent<Boolean>(EventBus.MEDIA_BUTTON) {
|
|
|
if (it) {
|
|
|
onClickReadAloud()
|