当前位置: 首页>>代码示例>>Java>>正文


Java ScheduleItem.SESSION属性代码示例

本文整理汇总了Java中com.google.samples.apps.iosched.model.ScheduleItem.SESSION属性的典型用法代码示例。如果您正苦于以下问题:Java ScheduleItem.SESSION属性的具体用法?Java ScheduleItem.SESSION怎么用?Java ScheduleItem.SESSION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.samples.apps.iosched.model.ScheduleItem的用法示例。


在下文中一共展示了ScheduleItem.SESSION属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getItemViewType

@Override
public int getItemViewType(int position) {
    if (position < 0 || position >= mItems.size()) {
        LOGE(TAG, "Invalid view position passed to MyScheduleAdapter: " + position);
        return VIEW_TYPE_NORMAL;
    }
    ScheduleItem item = mItems.get(position);
    long now = UIUtils.getCurrentTime(mContext);
    if (item.startTime <= now && now <= item.endTime && item.type == ScheduleItem.SESSION) {
        return VIEW_TYPE_NOW;
    } else if (item.endTime <= now && now < Config.CONFERENCE_END_MILLIS) {
        return VIEW_TYPE_PAST_DURING_CONFERENCE;
    } else {
        return VIEW_TYPE_NORMAL;
    }
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:16,代码来源:MyScheduleAdapter.java

示例2: getItemViewType

public int getItemViewType(int position) {
    if (position < 0 || position >= mScheduleItems.size()) {
        LOGE(TAG, "Invalid view position passed to MyScheduleAdapter: " + position);
        return VIEW_TYPE_NORMAL;
    }
    ScheduleItem item = mScheduleItems.get(position);
    long now = UIUtils.getCurrentTime(mContext);
    if (item.startTime <= now && now <= item.endTime && item.type == ScheduleItem.SESSION) {
        return VIEW_TYPE_NOW;
    } else {
        return VIEW_TYPE_NORMAL;
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:13,代码来源:ScheduleWidgetRemoteViewsService.java

示例3: getItemViewType

public int getItemViewType(int position) {
    if (position < 0 || position >= mScheduleItems.size()) {
        LOGE(TAG, "Invalid view position passed to ScheduleDayAdapter: " + position);
        return VIEW_TYPE_NORMAL;
    }
    ScheduleItem item = mScheduleItems.get(position);
    long now = TimeUtils.getCurrentTime(mContext);
    if (item.startTime <= now && now <= item.endTime && item.type == ScheduleItem.SESSION) {
        return VIEW_TYPE_NOW;
    } else {
        return VIEW_TYPE_NORMAL;
    }
}
 
开发者ID:google,项目名称:iosched,代码行数:13,代码来源:ScheduleWidgetRemoteViewsService.java

示例4: bind

public void bind(@NonNull ScheduleItem item, @NonNull TagPool tagPool,
                 @Nullable TagMetadata tagMetadata) {
    if (item.type != ScheduleItem.SESSION) {
        return;
    }
    mSession = item;
    final Context context = itemView.getContext();

    mTitle.setText(item.title);
    updateReservationStatus(item);
    setDescription(mDescription, item);

    mTagsHolder.removeAllViews();
    if (tagMetadata != null) {
        updateTags(item, tagMetadata, tagPool);
    }

    boolean isLivestreamed = item.isKeynote()
            || (item.flags & ScheduleItem.FLAG_HAS_LIVESTREAM) != 0;
    final long now = TimeUtils.getCurrentTime(context);
    final boolean streamingNow = isLivestreamed && item.startTime <= now && now <= item.endTime;

    if (isLivestreamed && !streamingNow) {
        if (mTagsHolder.getChildCount() > 0) {
            // Insert the spacer first
            mTagsHolder.addView(tagPool.getSpacer(mTagsHolder));
        }
        mTagsHolder.addView(tagPool.getLivestream(mTagsHolder));
    }
    mTagsHolder.setVisibility(mTagsHolder.getChildCount() > 0 ? VISIBLE : GONE);

    if (mCallbacks.bookmarkingEnabled() && !item.isKeynote()) {
        mBookmark.setVisibility(VISIBLE);
        // activated is proxy for in-schedule
        mBookmark.setActivated(item.inSchedule);
    } else {
        mBookmark.setVisibility(GONE);
    }

    mLiveNow.setVisibility(streamingNow ? VISIBLE : GONE);

    boolean showFeedback = mCallbacks.feedbackEnabled()
            && (now >= item.endTime && !item.hasGivenFeedback);
    mRate.setVisibility(showFeedback ? VISIBLE : GONE);
}
 
开发者ID:google,项目名称:iosched,代码行数:45,代码来源:SessionItemViewHolder.java


注:本文中的com.google.samples.apps.iosched.model.ScheduleItem.SESSION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。