Skip to content

Instantly share code, notes, and snippets.

@andrzejchm
Created July 21, 2017 08:42
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 andrzejchm/3fe0ad9f976f8e34c653c122a81d48d8 to your computer and use it in GitHub Desktop.
Save andrzejchm/3fe0ad9f976f8e34c653c122a81d48d8 to your computer and use it in GitHub Desktop.
public class RepositoryViewHolder extends RecyclerView.ViewHolder implements RepositoryRowView {
TextView titleTextView;
TextView starsCountTextView;
public RepositoryViewHolder(View itemView) {
super(itemView);
titleTextView = itemView.findViewById(R.id.repoTitleText);
starsCountTextView = itemView.findViewById(R.id.repoStarsCountText);
}
@Override
public void setTitle(String title) {
titleTextView.setText(title);
}
@Override
public void setStarCount(int starCount) {
starsCountTextView.setText(String.format("%s ★", starCount));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment