Skip to content

Commit c26f142

Browse files
author
Jesse Hoobergs
committed
Fix: AllDay events affected the width of events on that day
1 parent 3b44a4c commit c26f142

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

library/src/main/java/com/alamkanak/weekview/WeekView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,16 +1130,18 @@ private void computePositionOfEvents(List<EventRect> eventRects) {
11301130
List<List<EventRect>> collisionGroups = new ArrayList<List<EventRect>>();
11311131
for (EventRect eventRect : eventRects) {
11321132
boolean isPlaced = false;
1133+
11331134
outerLoop:
11341135
for (List<EventRect> collisionGroup : collisionGroups) {
11351136
for (EventRect groupEvent : collisionGroup) {
1136-
if (isEventsCollide(groupEvent.event, eventRect.event)) {
1137+
if (isEventsCollide(groupEvent.event, eventRect.event) && groupEvent.event.isAllDay() == eventRect.event.isAllDay()) {
11371138
collisionGroup.add(eventRect);
11381139
isPlaced = true;
11391140
break outerLoop;
11401141
}
11411142
}
11421143
}
1144+
11431145
if (!isPlaced) {
11441146
List<EventRect> newGroup = new ArrayList<EventRect>();
11451147
newGroup.add(eventRect);

sample/src/main/java/com/alamkanak/weekview/sample/BasicActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ public List<? extends WeekViewEvent> onMonthChange(int newYear, int newMonth) {
118118

119119
//AllDay event
120120
startTime = Calendar.getInstance();
121-
startTime.set(Calendar.DAY_OF_MONTH, 4);
122121
startTime.set(Calendar.HOUR_OF_DAY, 0);
123122
startTime.set(Calendar.MINUTE, 0);
124123
startTime.set(Calendar.MONTH, newMonth-1);

0 commit comments

Comments
 (0)