Skip to content

Instantly share code, notes, and snippets.

@AKiniyalocts
Created December 7, 2015 20:45
Show Gist options
  • Save AKiniyalocts/d866274ddb55bfabc4f4 to your computer and use it in GitHub Desktop.
Save AKiniyalocts/d866274ddb55bfabc4f4 to your computer and use it in GitHub Desktop.
Base class for RecyclerView holder that forces the bind() pattern
import android.support.v7.widget.RecyclerView;
import android.view.View;
import butterknife.ButterKnife;
/**
* Created by anthonykiniyalocts on 11/9/15.
*/
public abstract class BaseViewHolder extends RecyclerView.ViewHolder {
public BaseViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
public abstract void bind();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment