Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why Epoxy does not generate custom model class? #2

Open
sbhuvana opened this issue Dec 11, 2019 · 0 comments
Open

Why Epoxy does not generate custom model class? #2

sbhuvana opened this issue Dec 11, 2019 · 0 comments

Comments

@sbhuvana
Copy link

I want to use Epoxy for my recyclerView with kotlin, but Epoxy Model does not generate HotelItemModel_() class, what wrong with it?

`import android.widget.ImageView
import android.widget.TextView
import com.airbnb.epoxy.EpoxyAttribute
import com.airbnb.epoxy.EpoxyModelClass
import com.airbnb.epoxy.EpoxyModelWithHolder
import io.navendra.nachos.R
import io.navendra.nachos.models.Food

@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
}

/**
 * This is ViewHolder class equivalent to Google's RecyclerView.ViewHolder class
 */
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)

}

}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant