RecyclerView Viewholder Bind using BaseViewholder pattern.
pranaypatel512 opened this issue · 1 comments
pranaypatel512 commented
In My java class, I am using below BaseViewholder to Bind Adapter Viewholder.
How can I Bind itemview of below ViewHolder using kotterknife:
public class BaseViewHolder extends RecyclerView.ViewHolder {
public View itemView;
public BaseViewHolder(View itemView) {
super(itemView);
this.itemView = itemView;
ButterKnife.bind(this, itemView);
}
public View getItemView() {
return itemView;
}
}
By pasting Java code in kotlin file I am getting below kotlin code:
class BaseViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
init {
ButterKnife.bind(this, itemView) // I have to Bind Item View here using kotterknife
}
}
How can I achieve this?
JakeWharton commented
You cannot. KotterKnife binds properties and doesn't use generated binders like ButterKnife.