From 686d7cc0ad29ba6d083755ad40038e1890b889e1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 14 Feb 2019 16:37:48 +0100 Subject: [PATCH] fixing s few more overlapping glitches --- .../calendar/pro/fragments/WeekFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt index e23cb1e8c..b5f346b6b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt @@ -326,15 +326,15 @@ class WeekFragment : Fragment(), WeeklyCalendar { y = startMinutes * minuteHeight (layoutParams as RelativeLayout.LayoutParams).apply { width = layout.width - 1 - width /= overlappingEvents - x = width * currentEventOverlapIndex.toFloat() + width /= Math.max(overlappingEvents, 1) if (overlappingEvents > 1) { + x = width * currentEventOverlapIndex.toFloat() if (currentEventOverlapIndex != 0) { x += density } + width -= density if (currentEventOverlapIndex + 1 != overlappingEvents) { - width -= density if (currentEventOverlapIndex != 0) { width -= density }