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