diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt index ff6e49e2d..84e90e8f9 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt @@ -397,13 +397,17 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea page_view.upStyle() } observeEvent(Bus.TTS_START) { + viewModel.curTextChapter?.let { + } } observeEvent(Bus.TTS_NEXT) { if (it) { - + moveToNextChapter() } else { - + viewModel.durPageIndex += viewModel.durPageIndex + 1 + page_view.upContent() + viewModel.saveRead() } } } diff --git a/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt b/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt index c1bbc54d4..d598d5626 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt @@ -184,6 +184,14 @@ class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, att return true } + fun upContent() { + callback?.let { + it.textChapter()?.let { textChapter -> + curPage?.setContent(textChapter.page(it.durChapterIndex())) + } + } + } + fun upStyle() { curPage?.upStyle() prevPage?.upStyle()