use of org.fossasia.openevent.data.Track in project open-event-android by fossasia.
the class GlobalSearchAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
switch(holder.getItemViewType()) {
case TRACK:
TrackViewHolder trackSearchHolder = (TrackViewHolder) holder;
Track currentTrack = (Track) getItem(position);
trackSearchHolder.bindTrack(currentTrack);
break;
case SPEAKER:
SpeakerViewHolder speakerSearchHolder = (SpeakerViewHolder) holder;
Speaker speaker = (Speaker) getItem(position);
speakerSearchHolder.bindSpeaker(speaker);
break;
case LOCATION:
LocationViewHolder locationSearchHolder = (LocationViewHolder) holder;
Microlocation location = (Microlocation) getItem(position);
locationSearchHolder.bindLocation(location);
break;
case DIVIDER:
DividerViewHolder resultTypeViewHolder = (DividerViewHolder) holder;
String headerItem = (String) getItem(position);
resultTypeViewHolder.bindHeader(headerItem);
break;
case SESSION:
DayScheduleViewHolder bookmarkTypeViewHolder = (DayScheduleViewHolder) holder;
Session bookmarkItem = (Session) getItem(position);
bookmarkTypeViewHolder.setSession(bookmarkItem);
bookmarkTypeViewHolder.bindSession(realmRepo);
break;
default:
// If viewType is none of the above then nothing is done
break;
}
}
Aggregations