我想在epoxy.HotelItemModel_()
未生成类中创建自定义环氧树脂模型类Epoxy Controller
@EpoxyModelClass(layout = R.layout.singlefood_layout)
abstract class HotelItemModel (@EpoxyAttribute var food: Food) : EpoxyModelWithHolder<HotelItemModel.FoodHolder>() {
override fun bind(holder: FoodHolder) {
holder.imageView.setImageResource(food.image)
holder.titleView.text = food.title
}
inner class FoodHolder : KotlinHolder() {
val imageView by bind<ImageView>(R.id.image)
val titleView by bind<TextView>(R.id.title)
val descView by bind<TextView>(R.id.desc)
}
}