use of org.fossasia.openevent.data.Speaker in project open-event-android by fossasia.
the class SpeakersListAdapter method getSectionTitle.
@Override
public String getSectionTitle(int position) {
// this String will be shown in a bubble for specified position
Speaker speaker = getItem(position);
sortType = SharedPreferencesUtil.getInt(ConstantStrings.PREF_SORT_SPEAKER, SORTED_BY_NAME);
String title;
switch(sortType) {
case SORTED_BY_NAME:
title = speaker.getName();
break;
case SORTED_BY_ORGANIZATION:
title = speaker.getOrganisation();
break;
default:
title = speaker.getCountry();
break;
}
if (TextUtils.isEmpty(title)) {
return "-";
}
return String.valueOf(title.charAt(0));
}
use of org.fossasia.openevent.data.Speaker 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