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