Last active
March 14, 2018 06:59
-
-
Save andrzejchm/7cbc7c2538c3cd3c91820cdebdd19702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RepositoriesRecyclerAdapter extends RecyclerView.Adapter<RepositoriesRecyclerAdapter.RepoViewHolder> { | |
private final RepositoriesListPresenter presenter; | |
public RepositoriesRecyclerAdapter(RepositoriesListPresenter repositoriesPresenter) { | |
this.presenter = repositoriesPresenter; | |
} | |
@Override | |
public RepositoryViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | |
return new RepositoryViewHolder(LayoutInflater.from(parent.getContext()) | |
.inflate(R.layout.cell_repo_view, parent, false)); | |
} | |
@Override | |
public void onBindViewHolder(RepositoryViewHolder holder, int position) { | |
presenter.onBindRepositoryRowViewAtPosition(position, holder); | |
} | |
@Override | |
public int getItemCount() { | |
return presenter.getRepositoriesRowsCount(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment