pull/1606/head
kunfei 3 years ago
parent a3a21c9c42
commit e5984acd9c
  1. 2
      app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt
  2. 10
      app/src/main/res/layout/fragment_chapter_list.xml

@ -111,7 +111,6 @@ class ChapterListFragment : VMBaseFragment<TocViewModel>(R.layout.fragment_chapt
else -> appDb.bookChapterDao.flowSearch(viewModel.bookUrl, searchKey)
}.collect {
if (!(searchKey.isNullOrBlank() && it.isEmpty())) {
binding.rotateLoading.show()
val data = withContext(IO) {
val replaces = viewModel.bookData.value?.let { book ->
ContentProcessor.get(book.name, book.origin).getReplaceRules()
@ -126,7 +125,6 @@ class ChapterListFragment : VMBaseFragment<TocViewModel>(R.layout.fragment_chapt
})
}
}
binding.rotateLoading.hide()
adapter.setItems(data, adapter.diffCallBack)
if (searchKey.isNullOrBlank() && mLayoutManager.findFirstVisibleItemPosition() < 0) {
mLayoutManager.scrollToPositionWithOffset(durChapterIndex, 0)

@ -14,16 +14,6 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/ll_chapter_base_info" />
<io.legado.app.ui.widget.anima.RotateLoading
android:id="@+id/rotate_loading"
android:layout_width="60dp"
android:layout_height="60dp"
android:visibility="gone"
app:layout_constraintTop_toTopOf="@id/recycler_view"
app:layout_constraintBottom_toBottomOf="@+id/recycler_view"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<LinearLayout
android:id="@+id/ll_chapter_base_info"
android:layout_width="match_parent"

Loading…
Cancel
Save