本文整理汇总了Java中com.google.samples.apps.iosched.model.ScheduleItemHelper类的典型用法代码示例。如果您正苦于以下问题:Java ScheduleItemHelper类的具体用法?Java ScheduleItemHelper怎么用?Java ScheduleItemHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScheduleItemHelper类属于com.google.samples.apps.iosched.model包,在下文中一共展示了ScheduleItemHelper类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: updateItems
import com.google.samples.apps.iosched.model.ScheduleItemHelper; //导入依赖的package包/类
public void updateItems(final List<ScheduleItem> items) {
mItems.clear();
if (items == null) {
notifyDataSetChanged();
return;
}
if (!mShowTimeSeparators) {
mItems.addAll(items);
} else {
for (int i = 0, size = items.size(); i < size; i++) {
final ScheduleItem prev = i > 0 ? items.get(i - 1) : null;
final ScheduleItem item = items.get(i);
if (prev == null || !ScheduleItemHelper.sameStartTime(prev, item, true)) {
mItems.add(new TimeSeperatorItem(item));
}
mItems.add(item);
}
}
// TODO use DiffUtil
notifyDataSetChanged();
}
开发者ID:google,项目名称:iosched,代码行数:25,代码来源:ScheduleDayAdapter.java
示例2: startTest
import com.google.samples.apps.iosched.model.ScheduleItemHelper; //导入依赖的package包/类
public Boolean startTest() {
boolean success = true;
ArrayList<ScheduleItem> items = new ArrayList<>();
items.add(item(false, -1, "14:00", "14:30", "m1"));
items.add(item(true, -1, "14:25", "14:50", "i1"));
success &= check("no intersection - within range",
ScheduleItemHelper.processItems(items),
new ScheduleItem[]{
item(false, -1, "14:00", "14:30", "m1"),
item(true, -1, "14:25", "14:50", "i1")});
items.clear();
items.add(item(true, 0, "14:30", "15:00", "i1"));
items.add(item(true, -1, "16:30", "19:00", "i2"));
items.add(item(true, -1, "16:30", "17:00", "i3"));
items.add(item(true, -1, "18:00", "18:30", "i4"));
success &= check("conflicting sessions",
ScheduleItemHelper.processItems(items),
new ScheduleItem[]{
item(true, -1, "14:30", "15:00", "i1"),
item(true, -1, "16:30", "19:00", "i2"),
item(true, -1, "16:30", "17:00", "i3", true),
item(true, -1, "18:00", "18:30", "i4", true),
});
return success;
}
开发者ID:google,项目名称:iosched,代码行数:29,代码来源:TestScheduleHelperAction.java
示例3: performQuery
import com.google.samples.apps.iosched.model.ScheduleItemHelper; //导入依赖的package包/类
@Override
public Cursor performQuery(@NonNull CursorModelLoader<List<ScheduleItem>> loader,
@NonNull CancellationSignal cancellationSignal) {
return ContentResolverCompat.query(loader.getContext().getContentResolver(),
Sessions.CONTENT_MY_SCHEDULE_URI, ScheduleItemHelper.REQUIRED_SESSION_COLUMNS,
null, null, Sessions.SORT_BY_TIME, cancellationSignal);
}
开发者ID:google,项目名称:iosched,代码行数:8,代码来源:MyIOScheduleCursorTransform.java
示例4: cursorToModel
import com.google.samples.apps.iosched.model.ScheduleItemHelper; //导入依赖的package包/类
@Override
public List<ScheduleItem> cursorToModel(@NonNull CursorModelLoader<List<ScheduleItem>> loader,
@NonNull Cursor cursor) {
return ScheduleItemHelper.cursorToItems(cursor, loader.getContext());
}
开发者ID:google,项目名称:iosched,代码行数:6,代码来源:MyIOScheduleCursorTransform.java
示例5: readDataFromRelatedSessionsCursor
import com.google.samples.apps.iosched.model.ScheduleItemHelper; //导入依赖的package包/类
private void readDataFromRelatedSessionsCursor(Cursor cursor) {
mRelatedSessions = ScheduleItemHelper.cursorToItems(cursor, mContext);
}
开发者ID:google,项目名称:iosched,代码行数:4,代码来源:SessionDetailModel.java
注:本文中的com.google.samples.apps.iosched.model.ScheduleItemHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论