use of com.google.samples.apps.iosched.model.ScheduleItem in project iosched by google.
the class TestScheduleHelperAction method item.
private ScheduleItem item(String start, String end, String id, boolean conflict, int type) {
ScheduleItem i = new ScheduleItem();
i.title = id;
i.startTime = date(start);
i.endTime = date(end);
i.type = type;
if (conflict)
i.flags = ScheduleItem.FLAG_CONFLICTS_WITH_PREVIOUS;
return i;
}
use of com.google.samples.apps.iosched.model.ScheduleItem in project iosched by google.
the class MyScheduleModel method preparePreConferenceDayAdapter.
/**
* This method is an ad-hoc implementation of the pre conference day, which contains an item to
* pick up the badge at registration desk
*/
private void preparePreConferenceDayAdapter() {
ScheduleItem item = new ScheduleItem();
item.title = mContext.getString(R.string.my_schedule_badgepickup);
item.startTime = ParserUtils.parseTime(BuildConfig.PRECONFERENCE_DAY_START);
item.endTime = ParserUtils.parseTime(BuildConfig.PRECONFERENCE_DAY_END);
item.type = ScheduleItem.BREAK;
item.room = item.subtitle = mContext.getString(R.string.my_schedule_badgepickup_description);
item.sessionType = ScheduleItem.SESSION_TYPE_MISC;
mScheduleData.put(PRE_CONFERENCE_DAY_ID, new ArrayList<ScheduleItem>(Arrays.asList(item)));
}
use of com.google.samples.apps.iosched.model.ScheduleItem in project iosched by google.
the class MyScheduleMockItems method getItemsForAttendee.
/**
* Generates the schedule items for one day of the conference, including the keynote and 1
* session at 12PM with title {@code title}. The user attends the conference and the time is
* set to before the conference.
*
* @param dayId Pass in 1 for the first day, 2 for the second etc
* @param title The title of the non keynote session
* @param feedbackGiven Whether feedback has been given for the session
* @return the schedule items
*/
public static ArrayList<ScheduleItem> getItemsForAttendee(int dayId, boolean feedbackGiven, String title) {
long timeBase = Config.CONFERENCE_START_MILLIS + (dayId - 1) * TimeUtils.DAY;
ArrayList<ScheduleItem> newItems = new ArrayList<ScheduleItem>();
ScheduleItem newItem1 = new ScheduleItem();
newItem1.type = 1;
newItem1.sessionType = 1;
newItem1.mainTag = "FLAG_KEYNOTE";
newItem1.startTime = timeBase;
newItem1.endTime = timeBase + TimeUtils.HOUR;
newItem1.sessionId = "__keynote__";
newItem1.title = "Keynote";
newItem1.subtitle = "Keynote Room (L3)";
newItem1.room = "Keynote Room (L3)";
newItem1.hasGivenFeedback = true;
newItem1.backgroundImageUrl = "https://storage.googleapis.com/io2015-data.appspot.com/images/sessions/__w-200-" + "400-600-800-1000__/14f5088b-d0e2-e411-b87f-00155d5066d7.jpg";
newItem1.backgroundColor = -12627531;
newItem1.flags = 1;
newItems.add(newItem1);
ScheduleItem newItem2 = new ScheduleItem();
newItem2.type = 1;
newItem2.sessionType = 2;
newItem2.startTime = timeBase + SESSION_TITLE_AFTER_START_OFFSET;
newItem2.endTime = timeBase + SESSION_TITLE_AFTER_START_OFFSET + 1 * TimeUtils.HOUR;
newItem2.sessionId = SESSION_ID;
newItem2.title = title;
newItem2.subtitle = "Develop Sandbox (L2)";
newItem2.room = "Develop Sandbox (L2)";
newItem2.hasGivenFeedback = feedbackGiven;
newItem2.backgroundImageUrl = "https://storage.googleapis.com/io2015-data.appspot.com/images/sessions/__w-200-" + "400-600-800-1000__/ac8d5cc7-36e5-e411-b87f-00155d5066d7.jpg";
newItem2.backgroundColor = -14235942;
newItems.add(newItem2);
return newItems;
}
use of com.google.samples.apps.iosched.model.ScheduleItem in project iosched by google.
the class MyScheduleMockItems method getItemsForAttendeeBefore.
/**
* Generates the schedule items for one day of the conference, including the keynote, 1 session
* at 12PM and one slow with available sessions. The user attends the conference and the time is
* set to before the conference.
*
* @param dayId Pass in 1 for the first day, 2 for the second etc
* @return the schedule items
*/
public static ArrayList<ScheduleItem> getItemsForAttendeeBefore(int dayId) {
long timeBase = Config.CONFERENCE_START_MILLIS + (dayId - 1) * TimeUtils.DAY;
ArrayList<ScheduleItem> newItems = new ArrayList<ScheduleItem>();
ScheduleItem newItem1 = new ScheduleItem();
newItem1.type = 1;
newItem1.sessionType = 1;
newItem1.mainTag = "FLAG_KEYNOTE";
newItem1.startTime = timeBase;
newItem1.endTime = timeBase + TimeUtils.HOUR;
newItem1.sessionId = "__keynote__";
newItem1.title = "Keynote";
newItem1.subtitle = "Keynote Room (L3)";
newItem1.room = "Keynote Room (L3)";
newItem1.hasGivenFeedback = false;
newItem1.backgroundImageUrl = "https://storage.googleapis.com/io2015-data.appspot.com/images/sessions/__w-200-" + "400-600-800-1000__/14f5088b-d0e2-e411-b87f-00155d5066d7.jpg";
newItem1.backgroundColor = -12627531;
newItem1.flags = 1;
newItems.add(newItem1);
ScheduleItem newItem2 = new ScheduleItem();
newItem2.type = 1;
newItem2.sessionType = 2;
newItem2.startTime = timeBase + TimeUtils.HOUR;
newItem2.endTime = timeBase + 2 * TimeUtils.HOUR;
newItem2.sessionId = SESSION_ID;
newItem2.title = SESSION_TITLE_BEFORE;
newItem2.subtitle = "Develop Sandbox (L2)";
newItem2.room = "Develop Sandbox (L2)";
newItem2.hasGivenFeedback = false;
newItem2.backgroundImageUrl = "https://storage.googleapis.com/io2015-data.appspot.com/images/sessions/__w-200-" + "400-600-800-1000__/ac8d5cc7-36e5-e411-b87f-00155d5066d7.jpg";
newItem2.backgroundColor = -14235942;
newItems.add(newItem2);
ScheduleItem newItem3 = new ScheduleItem();
newItem3.type = 0;
newItem3.sessionType = 4;
newItem3.startTime = timeBase + SESSION_AVAILABLE_SLOT_TIME_OFFSET;
newItem3.endTime = timeBase + SESSION_AVAILABLE_SLOT_TIME_OFFSET + SESSION_AVAILABLE_SLOT_TIME_DURATION;
newItem3.numOfSessions = 23;
newItem3.title = "";
newItem3.subtitle = "23 available sessions";
newItem3.room = "";
newItem3.hasGivenFeedback = false;
newItems.add(newItem3);
return newItems;
}
use of com.google.samples.apps.iosched.model.ScheduleItem in project iosched by google.
the class FirstFreeSlotWithAvailableSessionsMatcher method matches.
@Override
public boolean matches(Object o) {
if (matchedBefore) {
return false;
} else {
final ScheduleItem scheduleItem = (ScheduleItem) o;
boolean match = scheduleItem.subtitle.contains("available sessions");
matchedBefore = match;
return match;
}
}
Aggregations