Search in sources :

Example 6 with Track

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;
    }
}
Also used : SpeakerViewHolder(org.fossasia.openevent.core.speaker.SpeakerViewHolder) DividerViewHolder(org.fossasia.openevent.common.ui.recyclerview.DividerViewHolder) LocationViewHolder(org.fossasia.openevent.core.location.LocationViewHolder) DayScheduleViewHolder(org.fossasia.openevent.core.schedule.DayScheduleViewHolder) TrackViewHolder(org.fossasia.openevent.core.track.TrackViewHolder) Track(org.fossasia.openevent.data.Track) Microlocation(org.fossasia.openevent.data.Microlocation) Speaker(org.fossasia.openevent.data.Speaker) Session(org.fossasia.openevent.data.Session)

Aggregations

Track (org.fossasia.openevent.data.Track)6 Session (org.fossasia.openevent.data.Session)3 Context (android.content.Context)2 Intent (android.content.Intent)2 Build (android.os.Build)2 View (android.view.View)2 BindView (butterknife.BindView)2 ButterKnife (butterknife.ButterKnife)2 R (org.fossasia.openevent.R)2 ConstantStrings (org.fossasia.openevent.common.ConstantStrings)2 DateConverter (org.fossasia.openevent.common.date.DateConverter)2 Utils (org.fossasia.openevent.common.utils.Utils)2 RealmDataRepository (org.fossasia.openevent.data.repository.RealmDataRepository)2 Timber (timber.log.Timber)2 Dialog (android.app.Dialog)1 ComponentName (android.content.ComponentName)1 DialogInterface (android.content.DialogInterface)1 Color (android.graphics.Color)1 PorterDuff (android.graphics.PorterDuff)1 Rect (android.graphics.Rect)1