Skip to content

Commit 8995a5a

Browse files
committed
fix(adapter): 修正 Glide 加载监听器中的位置获取逻辑,以确保异步回调时位置的准确性
1 parent 1878404 commit 8995a5a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/src/main/java/cn/cqautotest/sunnybeach/ui/adapter/WallpaperAdapter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class WallpaperAdapter : BaseQuickAdapter<WallpaperBean.Res.Vertical, QuickViewH
5555
.format(DecodeFormat.PREFER_RGB_565)
5656
.listener(object : RequestListener<Drawable> {
5757
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Drawable>, isFirstResource: Boolean): Boolean {
58-
mOnImageLoadListener?.invoke(position)
58+
mOnImageLoadListener?.invoke(holder.bindingAdapterPosition)
5959
return false
6060
}
6161

@@ -66,7 +66,7 @@ class WallpaperAdapter : BaseQuickAdapter<WallpaperBean.Res.Vertical, QuickViewH
6666
dataSource: DataSource,
6767
isFirstResource: Boolean
6868
): Boolean {
69-
mOnImageLoadListener?.invoke(position)
69+
mOnImageLoadListener?.invoke(holder.bindingAdapterPosition)
7070
return false
7171
}
7272
})

0 commit comments

Comments
 (0)