fixing some current time related glitches on the weekly view

This commit is contained in:
tibbi 2020-06-08 18:43:39 +02:00
parent 5ea14a5aa2
commit dae0ba67d8
1 changed files with 6 additions and 2 deletions

View File

@ -475,7 +475,11 @@ class WeekFragment : Fragment(), WeeklyCalendar {
private fun addCurrentTimeIndicator(minuteHeight: Float) {
if (todayColumnIndex != -1) {
val minutes = DateTime().minuteOfDay
val todayColumn = dayColumns.getOrNull(todayColumnIndex) ?: return
if (todayColumnIndex >= dayColumns.size) {
currentTimeView?.alpha = 0f
return
}
if (currentTimeView != null) {
mView.week_events_holder.removeView(currentTimeView)
}
@ -494,7 +498,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
x = if (weeklyViewDays == 1) {
0f
} else {
todayColumn.x - extraWidth / 2
(mView.width / weeklyViewDays * todayColumnIndex).toFloat() - extraWidth / 2f
}
y = minutes * minuteHeight - markerHeight / 2