优化
This commit is contained in:
@@ -111,7 +111,6 @@ class ChapterListFragment : VMBaseFragment<TocViewModel>(R.layout.fragment_chapt
|
|||||||
else -> appDb.bookChapterDao.flowSearch(viewModel.bookUrl, searchKey)
|
else -> appDb.bookChapterDao.flowSearch(viewModel.bookUrl, searchKey)
|
||||||
}.collect {
|
}.collect {
|
||||||
if (!(searchKey.isNullOrBlank() && it.isEmpty())) {
|
if (!(searchKey.isNullOrBlank() && it.isEmpty())) {
|
||||||
binding.rotateLoading.show()
|
|
||||||
val data = withContext(IO) {
|
val data = withContext(IO) {
|
||||||
val replaces = viewModel.bookData.value?.let { book ->
|
val replaces = viewModel.bookData.value?.let { book ->
|
||||||
ContentProcessor.get(book.name, book.origin).getReplaceRules()
|
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)
|
adapter.setItems(data, adapter.diffCallBack)
|
||||||
if (searchKey.isNullOrBlank() && mLayoutManager.findFirstVisibleItemPosition() < 0) {
|
if (searchKey.isNullOrBlank() && mLayoutManager.findFirstVisibleItemPosition() < 0) {
|
||||||
mLayoutManager.scrollToPositionWithOffset(durChapterIndex, 0)
|
mLayoutManager.scrollToPositionWithOffset(durChapterIndex, 0)
|
||||||
|
|||||||
@@ -14,16 +14,6 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/ll_chapter_base_info" />
|
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
|
<LinearLayout
|
||||||
android:id="@+id/ll_chapter_base_info"
|
android:id="@+id/ll_chapter_base_info"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
Reference in New Issue
Block a user