From 92c69197799f1660ddd0c35d88a313b5dd97f2fc Mon Sep 17 00:00:00 2001 From: xufuji456 <839789740@qq.com> Date: Sun, 26 Sep 2021 00:04:41 +0800 Subject: [PATCH] change to absoluteAdapterPosition --- .../main/java/com/frank/ffmpeg/adapter/HorizontalAdapter.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/frank/ffmpeg/adapter/HorizontalAdapter.kt b/app/src/main/java/com/frank/ffmpeg/adapter/HorizontalAdapter.kt index 274e6f7..c46e668 100644 --- a/app/src/main/java/com/frank/ffmpeg/adapter/HorizontalAdapter.kt +++ b/app/src/main/java/com/frank/ffmpeg/adapter/HorizontalAdapter.kt @@ -3,7 +3,6 @@ package com.frank.ffmpeg.adapter import android.graphics.Color import androidx.recyclerview.widget.RecyclerView -import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -36,11 +35,10 @@ class HorizontalAdapter(private val itemList: List?) : RecyclerView.Adap if (onItemClickListener != null) { okViewHolder.btnSelect.setOnClickListener { notifyItemChanged(lastClickPosition) - Log.i("onBindViewHolder", "lastClickPosition=$lastClickPosition") //select the current color okViewHolder.btnSelect.setTextColor(Color.BLUE) - onItemClickListener!!.onItemClick(okViewHolder.adapterPosition) - lastClickPosition = okViewHolder.adapterPosition + onItemClickListener!!.onItemClick(okViewHolder.absoluteAdapterPosition) + lastClickPosition = okViewHolder.absoluteAdapterPosition } } }