|
|
@ -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) |
|
|
|