From 5b8fc1f273384973617f54cf61957ff8845106f8 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 1 Sep 2019 09:03:15 +0800 Subject: [PATCH] up --- .../app/ui/booksource/BookSourceAdapter.kt | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/booksource/BookSourceAdapter.kt b/app/src/main/java/io/legado/app/ui/booksource/BookSourceAdapter.kt index a89a01b68..f9314073b 100644 --- a/app/src/main/java/io/legado/app/ui/booksource/BookSourceAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/booksource/BookSourceAdapter.kt @@ -14,7 +14,8 @@ import io.legado.app.lib.theme.ThemeStore import kotlinx.android.synthetic.main.item_book_source.view.* import org.jetbrains.anko.sdk27.listeners.onClick -class BookSourceAdapter : PagedListAdapter(DIFF_CALLBACK) { +class BookSourceAdapter : + PagedListAdapter(DIFF_CALLBACK) { companion object { @@ -54,13 +55,22 @@ class BookSourceAdapter : PagedListAdapter?, currentList: PagedList?) { + override fun onCurrentListChanged( + previousList: PagedList?, + currentList: PagedList? + ) { super.onCurrentListChanged(previousList, currentList) callBack?.upCount(itemCount) } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder { - return MyViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_book_source, parent, false)) + return MyViewHolder( + LayoutInflater.from(parent.context).inflate( + R.layout.item_book_source, + parent, + false + ) + ) } @@ -76,7 +86,12 @@ class BookSourceAdapter : PagedListAdapter