Skip to content

Instantly share code, notes, and snippets.

@frogermcs
Created June 12, 2016 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frogermcs/eadb4a653bde0430abdd023a135326e5 to your computer and use it in GitHub Desktop.
Save frogermcs/eadb4a653bde0430abdd023a135326e5 to your computer and use it in GitHub Desktop.
ViewHolder and Dagger 2 example
@AutoFactory(implementing = RepositoriesListViewHolderFactory.class)
public class RepositoryViewHolderNormal extends RepositoryViewHolder {
@Bind(R.id.tvName)
TextView tvName;
public RepositoryViewHolderNormal(ViewGroup parent) {
super(LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_normal, parent, false));
ButterKnife.bind(this, itemView);
}
@Override
public void bind(Repository repository) {
tvName.setText(repository.name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment