pull/32/head
kunfei 5 years ago
parent ec5a990dd7
commit cae1a5c0fa
  1. 5
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt
  2. 4
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.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<Book, BookshelfAdapter.MyViewHolder>(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<Book, BookshelfAdapter.MyViewHolder>(D
fun open(book: Book)
fun openBookInfo(book: Book)
fun search()
fun updateList(): List<String>
fun isUpdate(bookUrl: String): Boolean
}
}

@ -118,8 +118,8 @@ class BookshelfFragment : VMBaseFragment<BookshelfViewModel>(R.layout.fragment_b
}
override fun updateList(): List<String> {
return viewModel.updateList
override fun isUpdate(bookUrl: String): Boolean {
return bookUrl in viewModel.updateList
}
override fun onQueryTextSubmit(query: String?): Boolean {

Loading…
Cancel
Save