本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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);
}