mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fetch the proper daycod for creating new events at month/day view
This commit is contained in:
@@ -36,4 +36,6 @@ class MyMonthDayPagerAdapter(fm: FragmentManager, private val mCodes: List<Strin
|
|||||||
fun printCurrentView(pos: Int) {
|
fun printCurrentView(pos: Int) {
|
||||||
mFragments[pos].printCurrentView()
|
mFragments[pos].printCurrentView()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getNewEventDayCode(pos: Int): String = mFragments[pos].getNewEventDayCode()
|
||||||
}
|
}
|
||||||
|
@@ -151,4 +151,6 @@ class MonthDayFragment : Fragment(), MonthlyCalendar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun printCurrentView() {}
|
fun printCurrentView() {}
|
||||||
|
|
||||||
|
fun getNewEventDayCode() = mSelectedDayCode
|
||||||
}
|
}
|
||||||
|
@@ -139,7 +139,12 @@ class MonthDayFragmentsHolder : MyFragmentHolder(), NavigationListener {
|
|||||||
(activity as? MainActivity)?.updateActionBarTitle(getString(R.string.app_launcher_name))
|
(activity as? MainActivity)?.updateActionBarTitle(getString(R.string.app_launcher_name))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getNewEventDayCode() = if (shouldGoToTodayBeVisible()) currentDayCode else todayDayCode
|
override fun getNewEventDayCode() = (viewPager?.adapter as? MyMonthDayPagerAdapter)?.getNewEventDayCode(viewPager?.currentItem ?: 0)
|
||||||
|
?: if (shouldGoToTodayBeVisible()) {
|
||||||
|
currentDayCode
|
||||||
|
} else {
|
||||||
|
todayDayCode
|
||||||
|
}
|
||||||
|
|
||||||
override fun printView() {}
|
override fun printView() {}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user