优化目录界面

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(
oldItem: BookChapter,
newItem: BookChapter
): Boolean {
return oldItem.bookUrl == newItem.bookUrl
&& oldItem.url == newItem.url
&& oldItem.isVip == newItem.isVip
&& oldItem.isPay == newItem.isPay
&& oldItem.title == newItem.title
&& oldItem.tag == newItem.tag
&& oldItem.isVolume == newItem.isVolume
}
newItem: BookChapter
): Boolean {
return oldItem.bookUrl == newItem.bookUrl
&& oldItem.url == newItem.url
&& oldItem.isVip == newItem.isVip
&& oldItem.isPay == newItem.isPay
&& oldItem.title == newItem.title
&& oldItem.tag == newItem.tag
&& oldItem.isVolume == newItem.isVolume
}
}

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

Loading…
Cancel
Save