Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 4e70cbe8 authored by rparkins999's avatar rparkins999 Committed by Michael Bestas
Browse files

Show multiday events with corrent start and end points

If a multiday event is shown in the all day region, show its actual
start and end times rather than the beginning of the first day and
the end of the last day

Change-Id: I7f0f914612370347d8adb8d884009c248702456e
parent 7d0ab984
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -2935,6 +2935,7 @@ public class DayView extends View implements View.OnCreateContextMenuListener,

        int alpha = eventTextPaint.getAlpha();
        eventTextPaint.setAlpha(mEventsAlpha);
        int cellWidth = (mViewWidth - mHoursWidth) / mNumDays - DAY_GAP;
        for (int i = 0; i < numEvents; i++) {
            Event event = events.get(i);
            int startDay = event.startDay;
@@ -2942,11 +2943,20 @@ public class DayView extends View implements View.OnCreateContextMenuListener,
            if (startDay > lastDay || endDay < firstDay) {
                continue;
            }
            int leftoffset;
            int rightoffset;
            if (startDay < firstDay) {
                startDay = firstDay;
                leftoffset = 0;
            } else {
                leftoffset = (event.startTime * cellWidth) / MINUTES_PER_DAY;
            }
            if (endDay > lastDay) {
                endDay = lastDay;
                rightoffset = 0;
            } else {
                rightoffset =
                    ((MINUTES_PER_DAY - event.endTime) * cellWidth) / MINUTES_PER_DAY;
            }
            int startIndex = startDay - firstDay;
            int endIndex = endDay - firstDay;
@@ -2960,8 +2970,8 @@ public class DayView extends View implements View.OnCreateContextMenuListener,

            // Leave a one-pixel space between the vertical day lines and the
            // event rectangle.
            event.left = computeDayLeftPosition(startIndex);
            event.right = computeDayLeftPosition(endIndex + 1) - DAY_GAP;
            event.left = computeDayLeftPosition(startIndex) + leftoffset;
            event.right = computeDayLeftPosition(endIndex + 1) - DAY_GAP - rightoffset;
            event.top = y + height * event.getColumn();
            event.bottom = event.top + height - ALL_DAY_EVENT_RECT_BOTTOM_MARGIN;
            if (mMaxAlldayEvents > mMaxUnexpandedAlldayEventCount) {