Skip to content

Instantly share code, notes, and snippets.

@frogermcs
Created June 12, 2016 19:16
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/d66e990d059199797bed17e293fcbeaf to your computer and use it in GitHub Desktop.
Save frogermcs/d66e990d059199797bed17e293fcbeaf to your computer and use it in GitHub Desktop.
ViewHolder and Dagger 2 example
public class RepositoriesListAdapter extends RecyclerView.Adapter {
private RepositoriesListActivity repositoriesListActivity;
private Map<Integer, RepositoriesListViewHolderFactory> viewHolderFactories;
public RepositoriesListAdapter(RepositoriesListActivity repositoriesListActivity,
Map<Integer, RepositoriesListViewHolderFactory> viewHolderFactories) {
this.repositoriesListActivity = repositoriesListActivity;
this.viewHolderFactories = viewHolderFactories;
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment