From d261d25330235037fea62d934e833a1425be3fbb Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 2 Feb 2020 21:31:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/read/ReadBookActivity.kt | 3 +++ .../main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt | 2 +- app/src/main/res/menu/read_book.xml | 4 ++-- app/src/main/res/values/strings.xml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 7437c3cae..f11f3c835 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -219,6 +219,9 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo R.id.menu_copy_text -> { } + R.id.menu_update_toc -> ReadBook.book?.let { + viewModel.loadChapterList(it) + } } return super.onCompatOptionsItemSelected(item) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index 646aa3702..553ab5ede 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -91,7 +91,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } } - private fun loadChapterList( + fun loadChapterList( book: Book, changeDruChapterIndex: ((chapters: List) -> Unit)? = null ) { diff --git a/app/src/main/res/menu/read_book.xml b/app/src/main/res/menu/read_book.xml index 2994a6dbe..18d024862 100644 --- a/app/src/main/res/menu/read_book.xml +++ b/app/src/main/res/menu/read_book.xml @@ -80,9 +80,9 @@ app:showAsAction="never" /> 常见问题 显示所有发现 关闭则只显示勾选源的发现 - 更新目录 + 更新目录 txt目录正则 设置编码 倒序-顺序