mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fix the "Go to today" button at monthly view opened from yearly view
This commit is contained in:
@@ -155,7 +155,11 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
|||||||
} else if (config.storedView == MONTHLY_VIEW) {
|
} else if (config.storedView == MONTHLY_VIEW) {
|
||||||
main_view_pager.currentItem = mDefaultMonthlyPage
|
main_view_pager.currentItem = mDefaultMonthlyPage
|
||||||
} else if (config.storedView == YEARLY_VIEW) {
|
} else if (config.storedView == YEARLY_VIEW) {
|
||||||
main_view_pager.currentItem = mDefaultYearlyPage
|
if (mIsMonthSelected) {
|
||||||
|
openMonthlyToday()
|
||||||
|
} else {
|
||||||
|
main_view_pager.currentItem = mDefaultYearlyPage
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,13 +197,17 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
|||||||
} else if (config.storedView == WEEKLY_VIEW) {
|
} else if (config.storedView == WEEKLY_VIEW) {
|
||||||
fillWeeklyViewPager()
|
fillWeeklyViewPager()
|
||||||
} else {
|
} else {
|
||||||
val targetDay = DateTime().toString(Formatter.DAYCODE_PATTERN)
|
openMonthlyToday()
|
||||||
fillMonthlyViewPager(targetDay)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mWeekScrollY = 0
|
mWeekScrollY = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun openMonthlyToday() {
|
||||||
|
val targetDay = DateTime().toString(Formatter.DAYCODE_PATTERN)
|
||||||
|
fillMonthlyViewPager(targetDay)
|
||||||
|
}
|
||||||
|
|
||||||
private fun refreshViewPager() {
|
private fun refreshViewPager() {
|
||||||
if (config.storedView == YEARLY_VIEW) {
|
if (config.storedView == YEARLY_VIEW) {
|
||||||
(main_view_pager.adapter as MyYearPagerAdapter).refreshEvents(main_view_pager.currentItem)
|
(main_view_pager.adapter as MyYearPagerAdapter).refreshEvents(main_view_pager.currentItem)
|
||||||
|
Reference in New Issue
Block a user