|
|
package com.br_technology.securitytrain_master.ui.home.adapter
|
|
|
|
|
|
import android.content.Context
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.ViewGroup
|
|
|
import androidx.viewbinding.ViewBinding
|
...
|
...
|
@@ -18,7 +19,6 @@ import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData |
|
|
class ResultAdapter : BaseMultiAdapter<RecommendData, ViewBinding>() {
|
|
|
|
|
|
|
|
|
|
|
|
override fun onBind(holder: ViewBinding, position: Int, data: RecommendData) {
|
|
|
if (holder is AdapterRecommendDataBinding) {
|
|
|
holder.pic.glideRound(data.pic, 16)
|
...
|
...
|
@@ -35,22 +35,23 @@ class ResultAdapter : BaseMultiAdapter<RecommendData, ViewBinding>() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<ViewBinding> {
|
|
|
override fun getViewBinding(
|
|
|
context: Context,
|
|
|
parent: ViewGroup,
|
|
|
viewType: Int,
|
|
|
from: LayoutInflater
|
|
|
): ViewBinding {
|
|
|
return if (viewType == 0) {
|
|
|
BaseViewHolder(
|
|
|
LayoutEmptyBinding.inflate(
|
|
|
LayoutInflater.from(parent.context),
|
|
|
parent,
|
|
|
false
|
|
|
)
|
|
|
LayoutEmptyBinding.inflate(
|
|
|
LayoutInflater.from(parent.context),
|
|
|
parent,
|
|
|
false
|
|
|
)
|
|
|
} else {
|
|
|
BaseViewHolder(
|
|
|
AdapterRecommendDataBinding.inflate(
|
|
|
LayoutInflater.from(parent.context),
|
|
|
parent,
|
|
|
false
|
|
|
)
|
|
|
AdapterRecommendDataBinding.inflate(
|
|
|
LayoutInflater.from(parent.context),
|
|
|
parent,
|
|
|
false
|
|
|
)
|
|
|
}
|
|
|
}
|
...
|
...
|
|