优化目录界面

pull/1693/head
kunfei 3 years ago
parent 81558bdc90
commit d2a665bb1d
  1. 20
      app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt
  2. 1
      app/src/main/java/io/legado/app/ui/book/toc/TocActivity.kt

@ -39,16 +39,16 @@ class ChapterListAdapter(context: Context, val callback: Callback) :
override fun areContentsTheSame( override fun areContentsTheSame(
oldItem: BookChapter, oldItem: BookChapter,
newItem: BookChapter newItem: BookChapter
): Boolean { ): Boolean {
return oldItem.bookUrl == newItem.bookUrl return oldItem.bookUrl == newItem.bookUrl
&& oldItem.url == newItem.url && oldItem.url == newItem.url
&& oldItem.isVip == newItem.isVip && oldItem.isVip == newItem.isVip
&& oldItem.isPay == newItem.isPay && oldItem.isPay == newItem.isPay
&& oldItem.title == newItem.title && oldItem.title == newItem.title
&& oldItem.tag == newItem.tag && oldItem.tag == newItem.tag
&& oldItem.isVolume == newItem.isVolume && oldItem.isVolume == newItem.isVolume
} }
} }

@ -83,6 +83,7 @@ class TocActivity : VMBaseActivity<ActivityChapterListBinding, TocViewModel>() {
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { override fun onCompatOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) { when (item.itemId) {
R.id.menu_reverse_toc -> viewModel.reverseToc { R.id.menu_reverse_toc -> viewModel.reverseToc {
viewModel.chapterListCallBack?.clearDisplayTitle()
viewModel.chapterListCallBack?.upChapterList(searchView?.query?.toString()) viewModel.chapterListCallBack?.upChapterList(searchView?.query?.toString())
setResult(RESULT_OK, Intent().apply { setResult(RESULT_OK, Intent().apply {
putExtra("index", it.durChapterIndex) putExtra("index", it.durChapterIndex)

Loading…
Cancel
Save