mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-23 12:53:08 +00:00
update CardPresenter to handle Strings
This commit is contained in:
parent
78a75c7a1d
commit
cc53340c8a
1 changed files with 10 additions and 6 deletions
|
@ -86,8 +86,7 @@ public class CardPresenter extends Presenter {
|
|||
.error(mDefaultCardImage)
|
||||
.into(cardView.getMainImageView());
|
||||
}
|
||||
}
|
||||
if (item instanceof Event) {
|
||||
} else if (item instanceof Event) {
|
||||
cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT_16);
|
||||
Event event = (Event) item;
|
||||
cardView.setTitleText(event.getTitle());
|
||||
|
@ -100,15 +99,13 @@ public class CardPresenter extends Presenter {
|
|||
.error(mDefaultCardImage)
|
||||
.into(cardView.getMainImageView());
|
||||
}
|
||||
}
|
||||
if (item instanceof LiveConference) {
|
||||
} else if (item instanceof LiveConference) {
|
||||
cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT_4);
|
||||
LiveConference con = (LiveConference) item;
|
||||
cardView.setTitleText(con.getConference());
|
||||
cardView.setMainImage(mDefaultCardImage);
|
||||
cardView.setContentText(con.getDescription());
|
||||
}
|
||||
if (item instanceof Room) {
|
||||
} else if (item instanceof Room) {
|
||||
cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT_16);
|
||||
Room room = (Room) item;
|
||||
cardView.setTitleText(room.getDisplay());
|
||||
|
@ -120,7 +117,14 @@ public class CardPresenter extends Presenter {
|
|||
.error(mDefaultCardImage)
|
||||
.into(cardView.getMainImageView());
|
||||
}
|
||||
} else if(item instanceof String) {
|
||||
cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT_4);
|
||||
cardView.setTitleText((String) item);
|
||||
Glide.with(viewHolder.view.getContext())
|
||||
.load(R.drawable.icon)
|
||||
.into(cardView.getMainImageView());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue