adding some null checks at refreshing main viewpager
This commit is contained in:
parent
5d57eea81c
commit
91ed5dbafe
|
@ -318,10 +318,10 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
||||||
|
|
||||||
private fun refreshViewPager() {
|
private fun refreshViewPager() {
|
||||||
when {
|
when {
|
||||||
config.storedView == YEARLY_VIEW -> (main_view_pager.adapter as MyYearPagerAdapter).refreshEvents(main_view_pager.currentItem)
|
config.storedView == YEARLY_VIEW -> (main_view_pager.adapter as? MyYearPagerAdapter)?.refreshEvents(main_view_pager.currentItem)
|
||||||
config.storedView == EVENTS_LIST_VIEW -> fillEventsList()
|
config.storedView == EVENTS_LIST_VIEW -> fillEventsList()
|
||||||
config.storedView == WEEKLY_VIEW -> (week_view_view_pager.adapter as MyWeekPagerAdapter).refreshEvents(week_view_view_pager.currentItem)
|
config.storedView == WEEKLY_VIEW -> (week_view_view_pager.adapter as? MyWeekPagerAdapter)?.refreshEvents(week_view_view_pager.currentItem)
|
||||||
else -> (main_view_pager.adapter as MyMonthPagerAdapter).refreshEvents(main_view_pager.currentItem)
|
else -> (main_view_pager.adapter as? MyMonthPagerAdapter)?.refreshEvents(main_view_pager.currentItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue