From 60cfe182e15861ffd5219b67369375b293935148 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 9 Jun 2020 16:33:49 +0200 Subject: [PATCH] use a local variable for accessing resources on the weekly view --- .../simplemobiletools/calendar/pro/fragments/WeekFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 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 6cd0271cc..ef5f5594e 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 @@ -116,7 +116,7 @@ class WeekFragment : Fragment(), WeeklyCalendar { scrollView.onGlobalLayout { if (fullHeight < scrollView.height) { - scrollView.layoutParams.height = fullHeight - context!!.resources.getDimension(R.dimen.one_dp).toInt() + scrollView.layoutParams.height = fullHeight - res.getDimension(R.dimen.one_dp).toInt() } val initialScrollY = (rowHeight * config.startWeeklyAt).toInt() @@ -350,7 +350,7 @@ class WeekFragment : Fragment(), WeeklyCalendar { private fun updateViewScale() { rowHeight = context?.getWeeklyViewItemHeight() ?: return - val oneDp = context!!.resources.getDimension(R.dimen.one_dp).toInt() + val oneDp = res.getDimension(R.dimen.one_dp).toInt() val fullHeight = Math.max(rowHeight.toInt() * 24, scrollView.height + oneDp) scrollView.layoutParams.height = fullHeight - oneDp mView.week_horizontal_grid_holder.layoutParams.height = fullHeight