diff --git a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt index 6a2b81970..47438ef6c 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt @@ -121,6 +121,10 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragment_chapt } } + override fun clearDisplayTitle() { + adapter.displayTileMap.clear() + } + override val scope: CoroutineScope get() = this diff --git a/app/src/main/java/io/legado/app/ui/book/toc/TocActivity.kt b/app/src/main/java/io/legado/app/ui/book/toc/TocActivity.kt index f69ea0235..1bb44501d 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/TocActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/TocActivity.kt @@ -90,7 +90,7 @@ class TocActivity : VMBaseActivity() { } R.id.menu_use_replace -> { AppConfig.tocUiUseReplace = !item.isChecked - viewModel.chapterCallBack?.upChapterList(null) + viewModel.chapterCallBack?.clearDisplayTitle() } R.id.menu_log -> showDialogFragment() } diff --git a/app/src/main/java/io/legado/app/ui/book/toc/TocViewModel.kt b/app/src/main/java/io/legado/app/ui/book/toc/TocViewModel.kt index 1fdb66fd6..fe3e76323 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/TocViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/TocViewModel.kt @@ -48,6 +48,8 @@ class TocViewModel(application: Application) : BaseViewModel(application) { interface ChapterListCallBack { fun upChapterList(searchKey: String?) + + fun clearDisplayTitle() } interface BookmarkCallBack {