Search in sources :

Example 6 with Speaker

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));
}
Also used : Speaker(org.fossasia.openevent.data.Speaker)

Example 7 with Speaker

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;
    }
}
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

Speaker (org.fossasia.openevent.data.Speaker)7 Intent (android.content.Intent)3 Bundle (android.os.Bundle)3 Context (android.content.Context)2 Nullable (android.support.annotation.Nullable)2 Fragment (android.support.v4.app.Fragment)2 FragmentManager (android.support.v4.app.FragmentManager)2 TextUtils (android.text.TextUtils)2 View (android.view.View)2 ImageView (android.widget.ImageView)2 BindView (butterknife.BindView)2 ButterKnife (butterknife.ButterKnife)2 R (org.fossasia.openevent.R)2 Utils (org.fossasia.openevent.common.utils.Utils)2 StrategyRegistry (org.fossasia.openevent.config.StrategyRegistry)2 Timber (timber.log.Timber)2 Activity (android.app.Activity)1 ActivityOptions (android.app.ActivityOptions)1 Dialog (android.app.Dialog)1 ComponentName (android.content.ComponentName)1