mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
use a local variable for accessing resources on the weekly view
This commit is contained in:
@@ -116,7 +116,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||||||
|
|
||||||
scrollView.onGlobalLayout {
|
scrollView.onGlobalLayout {
|
||||||
if (fullHeight < scrollView.height) {
|
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()
|
val initialScrollY = (rowHeight * config.startWeeklyAt).toInt()
|
||||||
@@ -350,7 +350,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||||||
private fun updateViewScale() {
|
private fun updateViewScale() {
|
||||||
rowHeight = context?.getWeeklyViewItemHeight() ?: return
|
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)
|
val fullHeight = Math.max(rowHeight.toInt() * 24, scrollView.height + oneDp)
|
||||||
scrollView.layoutParams.height = fullHeight - oneDp
|
scrollView.layoutParams.height = fullHeight - oneDp
|
||||||
mView.week_horizontal_grid_holder.layoutParams.height = fullHeight
|
mView.week_horizontal_grid_holder.layoutParams.height = fullHeight
|
||||||
|
Reference in New Issue
Block a user