From 7ee682f32a71927e8c353d2546d895dcbc296e95 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 28 Mar 2018 14:02:54 +0200 Subject: [PATCH] make sure month fragment clickable background is properly added --- .../com/simplemobiletools/calendar/views/MonthViewWrapper.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/views/MonthViewWrapper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/views/MonthViewWrapper.kt index 1d0d7fe1b..ab6aa4bdd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/views/MonthViewWrapper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/views/MonthViewWrapper.kt @@ -34,6 +34,7 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F onGlobalLayout { if (!wereViewsAdded && days.isNotEmpty()) { + measureSizes() addViews() monthView.updateDays(days) } @@ -45,7 +46,9 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F measureSizes() dayClickCallback = callback days = newDays - addViews() + if (dayWidth != 0f && dayHeight != 0f) { + addViews() + } monthView.updateDays(days) }