adding some handling for all-day events too on weekly view

This commit is contained in:
tibbi 2020-06-08 20:14:29 +02:00
parent a6d54f1757
commit b399990be7
1 changed files with 9 additions and 2 deletions

View File

@ -576,11 +576,18 @@ class WeekFragment : Fragment(), WeeklyCalendar {
} }
} }
val dayCode = Formatter.getDayCodeFromDateTime(startDateTime)
val dayOfWeek = dayColumns.indexOfFirst { it.tag == dayCode }
if (dayOfWeek == -1) {
return
}
allDayHolders[drawAtLine].addView(this) allDayHolders[drawAtLine].addView(this)
val dayWidth = mView.width / context!!.config.weeklyViewDays
(layoutParams as RelativeLayout.LayoutParams).apply { (layoutParams as RelativeLayout.LayoutParams).apply {
leftMargin = dayColumns[firstDayIndex].x.toInt() leftMargin = dayOfWeek * dayWidth
bottomMargin = 1 bottomMargin = 1
width = dayColumns[Math.min(firstDayIndex + daysCnt, 6)].right - leftMargin - 1 width = (dayWidth) * (daysCnt + 1)
} }
calculateExtraHeight() calculateExtraHeight()