mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
move the extra height calculation in a separate function
This commit is contained in:
@ -379,6 +379,18 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
||||
width = getColumnWithId(Math.min(firstDayIndex + daysCnt, 6)).right - leftMargin - 1
|
||||
}
|
||||
|
||||
calculateExtraHeight()
|
||||
|
||||
setOnClickListener {
|
||||
Intent(activity.applicationContext, EventActivity::class.java).apply {
|
||||
putExtra(EVENT_ID, event.id)
|
||||
startActivity(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun calculateExtraHeight() {
|
||||
mView.week_top_holder.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
|
||||
override fun onGlobalLayout() {
|
||||
if (activity == null)
|
||||
@ -395,13 +407,6 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
||||
}
|
||||
}
|
||||
})
|
||||
setOnClickListener {
|
||||
Intent(activity.applicationContext, EventActivity::class.java).apply {
|
||||
putExtra(EVENT_ID, event.id)
|
||||
startActivity(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
Reference in New Issue
Block a user