move the extra height calculation in a separate function
This commit is contained in:
parent
41369041cf
commit
c6ca96437c
1 changed files with 20 additions and 15 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue