Skip to content

Instantly share code, notes, and snippets.

@keinix
Created September 21, 2018 06:46
Show Gist options
  • Save keinix/1d5c50cd2c965f1cb1a2a8624b863c39 to your computer and use it in GitHub Desktop.
Save keinix/1d5c50cd2c965f1cb1a2a8624b863c39 to your computer and use it in GitHub Desktop.
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
switch (getItemViewType(position)) {
case Literature.TYPE_BOOK:
((BookViewHolder) holder).bindView(position);
break;
case Literature.TYPE_MAGAZINE:
((MagazineViewHolder) holder).bindView(position);
break;
case Literature.TYPE_NEWSPAPER:
((NewspaperViewHolder) holder).bindView(position);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment