|
@@ -1,7 +1,5 @@
|
|
|
package com.yingyang.workbenches.adapter
|
|
|
|
|
|
-import android.content.Context
|
|
|
-import com.bumptech.glide.Glide
|
|
|
import com.yingyang.workbenches.R
|
|
|
import com.yingyang.workbenches.databinding.ItemGameListBinding
|
|
|
import com.yingyang.workbenches.entity.Record
|
|
@@ -14,12 +12,6 @@ import com.yingyangfly.baselib.ext.setOnSingleClickListener
|
|
|
class GameAdapter(override val layoutId: Int = R.layout.item_game_list) :
|
|
|
BaseDataBindingAdapter<Record, ItemGameListBinding>() {
|
|
|
|
|
|
- var mContext: Context? = null
|
|
|
-
|
|
|
- fun setContext(mContext: Context) {
|
|
|
- this.mContext = mContext
|
|
|
- }
|
|
|
-
|
|
|
var onGameImageClickListener: ((
|
|
|
bean: Record,
|
|
|
position: Int
|
|
@@ -27,9 +19,6 @@ class GameAdapter(override val layoutId: Int = R.layout.item_game_list) :
|
|
|
|
|
|
override fun onBindViewHolder(binding: ItemGameListBinding, item: Record, position: Int) {
|
|
|
binding.data = item
|
|
|
- if (mContext != null && item.gameCoverImage.isNullOrEmpty().not()) {
|
|
|
- Glide.with(mContext!!).load(item.gameCoverImage).into(binding.gameImage)
|
|
|
- }
|
|
|
binding.gameLayout.setOnSingleClickListener {
|
|
|
onGameImageClickListener?.invoke(item, position)
|
|
|
}
|