From cae1a5c0faf924347bdc885a2f30c9b6604aba2c Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 14 Aug 2019 10:39:24 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt | 5 +++-- .../io/legado/app/ui/main/bookshelf/BookshelfFragment.kt | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt index 120f4e383..0f70422e3 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt @@ -7,6 +7,7 @@ import androidx.paging.PagedListAdapter import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView import io.legado.app.R +import io.legado.app.constant.BookType import io.legado.app.data.entities.Book import io.legado.app.help.ImageLoader import io.legado.app.lib.theme.ThemeStore @@ -66,7 +67,7 @@ class BookshelfAdapter : PagedListAdapter(D true } callBack?.let { - if (book.bookUrl in it.updateList()) { + if (book.origin != BookType.local && it.isUpdate(book.bookUrl)) { rl_loading.show() } else { rl_loading.hide() @@ -79,6 +80,6 @@ class BookshelfAdapter : PagedListAdapter(D fun open(book: Book) fun openBookInfo(book: Book) fun search() - fun updateList(): List + fun isUpdate(bookUrl: String): Boolean } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt index 74576b5ed..86cb82006 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt @@ -118,8 +118,8 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b } - override fun updateList(): List { - return viewModel.updateList + override fun isUpdate(bookUrl: String): Boolean { + return bookUrl in viewModel.updateList } override fun onQueryTextSubmit(query: String?): Boolean {