use of com.github.sundeepk.compactcalendarview.domain.Event in project CompactCalendarView by SundeepK.
the class CompactCalendarControllerTest method testItRemovesEvent.
@Test
public void testItRemovesEvent() {
Event event = getSingleEvents(0, 30, 1433701251000L).get(0);
underTest.removeEvent(event);
verify(eventsContainer).removeEvent(event);
verifyNoMoreInteractions(eventsContainer);
}
use of com.github.sundeepk.compactcalendarview.domain.Event in project CompactCalendarView by SundeepK.
the class CompactCalendarController method drawSingleEvent.
private void drawSingleEvent(Canvas canvas, float xPosition, float yPosition, List<Event> eventsList) {
Event event = eventsList.get(0);
drawEventIndicatorCircle(canvas, xPosition, yPosition, event.getColor());
}
use of com.github.sundeepk.compactcalendarview.domain.Event in project CompactCalendarView by SundeepK.
the class CompactCalendarHelper method getSingleEvents.
//generate one event per a day for a month
public static List<Event> getSingleEvents(int start, int days, long timeStamp, int color) {
Calendar currentCalender = Calendar.getInstance(Locale.getDefault());
List<Event> events = new ArrayList<>();
for (int i = start; i < days; i++) {
setDateTime(timeStamp, currentCalender, i);
events.add(new Event(color, currentCalender.getTimeInMillis()));
}
return events;
}
use of com.github.sundeepk.compactcalendarview.domain.Event in project CompactCalendarView by SundeepK.
the class CompactCalendarHelper method getMultipleEventsForEachDayAsMap.
public static Map<Long, List<Event>> getMultipleEventsForEachDayAsMap(int start, int days, long timeStamp) {
Calendar currentCalender = Calendar.getInstance(Locale.getDefault());
Map<Long, List<Event>> epochMillisToEvents = new HashMap<>();
for (int i = start; i < days; i++) {
setDateTime(timeStamp, currentCalender, i);
List<Event> eventList = new ArrayList<>();
List<Event> events = Arrays.asList(new Event(Color.BLUE, currentCalender.getTimeInMillis()), new Event(Color.RED, currentCalender.getTimeInMillis() + 3600 * 1000), new Event(Color.RED, currentCalender.getTimeInMillis() + (3600 * 2) * 1000), new Event(Color.RED, currentCalender.getTimeInMillis() + (3600 * 3) * 1000));
eventList.addAll(events);
epochMillisToEvents.put(currentCalender.getTimeInMillis(), eventList);
}
return epochMillisToEvents;
}
use of com.github.sundeepk.compactcalendarview.domain.Event in project CompactCalendarView by SundeepK.
the class CompactCalendarHelper method getDayEventWith2EventsPerDay.
public static List<Events> getDayEventWith2EventsPerDay(int start, int days, long timeStamp) {
Calendar currentCalender = Calendar.getInstance(Locale.getDefault());
List<Events> events = new ArrayList<>();
for (int i = start; i < days; i++) {
setDateTime(timeStamp, currentCalender, i);
List<Event> eventList = new ArrayList<>();
eventList.add(new Event(Color.BLUE, currentCalender.getTimeInMillis()));
eventList.add(new Event(Color.RED, currentCalender.getTimeInMillis() + 3600 * 1000));
Events eventsObject = new Events(currentCalender.getTimeInMillis(), eventList);
events.add(eventsObject);
}
return events;
}
Aggregations