|
|
@ -224,17 +224,10 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea |
|
|
|
launch { |
|
|
|
launch { |
|
|
|
when (bookChapter.index) { |
|
|
|
when (bookChapter.index) { |
|
|
|
viewModel.durChapterIndex -> { |
|
|
|
viewModel.durChapterIndex -> { |
|
|
|
tv_chapter_name.text = bookChapter.title |
|
|
|
viewModel.curTextChapter = |
|
|
|
tv_chapter_name.visible() |
|
|
|
ChapterProvider.getTextChapter(content_text_view, bookChapter, content) |
|
|
|
if (!viewModel.isLocalBook) { |
|
|
|
|
|
|
|
tv_chapter_url.text = bookChapter.url |
|
|
|
|
|
|
|
tv_chapter_url.visible() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ChapterProvider.getTextChapter(content_text_view, bookChapter, content).let { |
|
|
|
|
|
|
|
viewModel.curTextChapter = it |
|
|
|
|
|
|
|
page_view.upContent() |
|
|
|
page_view.upContent() |
|
|
|
read_menu.upReadProgress(it.pageSize(), viewModel.durPageIndex) |
|
|
|
curChapterChange() |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
viewModel.durChapterIndex - 1 -> { |
|
|
|
viewModel.durChapterIndex - 1 -> { |
|
|
|
viewModel.prevTextChapter = ChapterProvider.getTextChapter(content_text_view, bookChapter, content) |
|
|
|
viewModel.prevTextChapter = ChapterProvider.getTextChapter(content_text_view, bookChapter, content) |
|
|
@ -248,6 +241,18 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun curChapterChange() { |
|
|
|
|
|
|
|
viewModel.curTextChapter?.let { |
|
|
|
|
|
|
|
tv_chapter_name.text = it.title |
|
|
|
|
|
|
|
tv_chapter_name.visible() |
|
|
|
|
|
|
|
if (!viewModel.isLocalBook) { |
|
|
|
|
|
|
|
tv_chapter_url.text = it.url |
|
|
|
|
|
|
|
tv_chapter_url.visible() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
read_menu.upReadProgress(it.pageSize(), viewModel.durPageIndex) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun chapterSize(): Int { |
|
|
|
override fun chapterSize(): Int { |
|
|
|
return viewModel.chapterSize |
|
|
|
return viewModel.chapterSize |
|
|
|
} |
|
|
|
} |
|
|
@ -293,10 +298,12 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea |
|
|
|
|
|
|
|
|
|
|
|
override fun moveToNextChapter() { |
|
|
|
override fun moveToNextChapter() { |
|
|
|
viewModel.moveToNextChapter() |
|
|
|
viewModel.moveToNextChapter() |
|
|
|
|
|
|
|
curChapterChange() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun moveToPrevChapter() { |
|
|
|
override fun moveToPrevChapter() { |
|
|
|
viewModel.moveToPrevChapter() |
|
|
|
viewModel.moveToPrevChapter() |
|
|
|
|
|
|
|
curChapterChange() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun clickCenter() { |
|
|
|
override fun clickCenter() { |
|
|
|