From 7b501bd6d8cf897ec18a8c62337e14c352bf188c Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 16 Feb 2020 13:38:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/base/adapter/CommonRecyclerAdapter.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt b/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt index a638b87f6..25e6b25c4 100644 --- a/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt +++ b/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt @@ -339,6 +339,9 @@ abstract class CommonRecyclerAdapter(protected val context: Context) : ) ) + itemDelegates.getValue(viewType) + .registerListener(holder) + if (itemClickListener != null) { holder.itemView.setOnClickListener { getItem(holder.layoutPosition)?.let { @@ -374,10 +377,6 @@ abstract class CommonRecyclerAdapter(protected val context: Context) : itemDelegates.getValue(getItemViewType(holder.layoutPosition)) .convert(holder, it, payloads) } - if (payloads.isEmpty()) { - itemDelegates.getValue(getItemViewType(holder.layoutPosition)) - .registerListener(holder) - } } }