Skip to content

Instantly share code, notes, and snippets.

@weverb2
Created December 10, 2015 17:10
Show Gist options
  • Save weverb2/319236a3b83c6c4499f5 to your computer and use it in GitHub Desktop.
Save weverb2/319236a3b83c6c4499f5 to your computer and use it in GitHub Desktop.
Adapted from https://gist.github.com/AKiniyalocts/d866274ddb55bfabc4f4 to bind a specific model to a view holder.
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import butterknife.ButterKnife;
/**
* Created by brandon on 12/9/15.
*/
public abstract class ButterKnifeViewHolder<T> extends RecyclerView.ViewHolder {
public ButterKnifeViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
public abstract void bindWithModel(@Nullable T model);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment