Commit fa395929 authored by Varun Patil's avatar Varun Patil

Fall back to body image for event image

parent dee03181
......@@ -68,6 +68,11 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> {
if (!eventVenueName.toString().equals(""))
viewHolder.eventVenue.setText(eventVenueName.toString().substring(2));
// Fallback to image of first body if event has no image
if (currentEvent.getEventImageURL() == null) {
currentEvent.setEventImageURL(currentEvent.getEventBodies().get(0).getBodyImageURL());
}
Picasso.get().load(currentEvent.getEventImageURL()).into(viewHolder.eventPicture);
}
......
......@@ -101,6 +101,11 @@ public class EventFragment extends BaseFragment {
webEventButton = getActivity().findViewById(R.id.web_event_button);
shareEventButton = getActivity().findViewById(R.id.share_event_button);
// Fallback to image of first body if event has no image
if (event.getEventImageURL() == null) {
event.setEventImageURL(event.getEventBodies().get(0).getBodyImageURL());
}
Picasso.get().load(event.getEventImageURL()).into(eventPicture);
eventTitle.setText(event.getEventName());
Markwon.setMarkdown(eventDescription, event.getEventDescription());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment