我想用 Epoxy 对我的 recyclerView 使用 kotlin,但是 Epoxy Model 没有生成 PostModel_() 类,有什么问题吗?
@EpoxyModelClass(layout = R.layout.iteam)
abstract class PostModel : EpoxyModelWithHolder<PostModel.PostHolder>() {
@EpoxyAttribute
lateinit var userName: String
@EpoxyAttribute
lateinit var avatarIcon: Drawable
@EpoxyAttribute
lateinit var post: Drawable
override fun bind(holder: PostHolder) {
holder.avatarIcon.setImageDrawable(avatarIcon)
holder.post.setImageDrawable(post)
holder.name.text = userName
}
class PostHolder : BaseEpoxyHolder() {
@BindView(R.id.name)
lateinit var name: TextView
@BindView(R.id.ic_avatar)
lateinit var avatarIcon: ImageView
@BindView(R.id.post)
lateinit var post: ImageView
}
}