Create Epoxy models from ViewHolders
masterFor XML layouts without DataBinding, you can create a model by extending EpoxyModelWithHolder<Holder>. Use @EpoxyModelClass to specify the layout. Define attributes using @EpoxyAttribute and implement the bind(Holder holder) method to map attributes to your views. Epoxy will generate a subclass (e.g., HeaderModel_) that handles the model implementation details.
@EpoxyModelClass(layout = R.layout.header_view)
public abstract class HeaderModel extends EpoxyModelWithHolder<Holder> {
@EpoxyAttribute String title;
@Override
public void bind(Holder holder) {
holder.header.setText(title);
}
static class Holder extends BaseEpoxyHolder {
@BindView(R.id.text) TextView header;
}
}