hide the GoToToday button at event list view
This commit is contained in:
parent
644a9fbd03
commit
2022081881
|
@ -100,6 +100,8 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
|||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu_main, menu)
|
||||
menu.findItem(R.id.filter).isVisible = eventTypeColors.size() > 1 || config.displayEventTypes.isEmpty()
|
||||
menu.findItem(R.id.go_to_today).isVisible = shouldGoToTodayBeVisible()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -127,6 +129,7 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
|||
private fun showViewDialog() {
|
||||
ChangeViewDialog(this) {
|
||||
updateView(it)
|
||||
invalidateOptionsMenu()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,6 +137,10 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
|||
|
||||
}
|
||||
|
||||
private fun shouldGoToTodayBeVisible(): Boolean {
|
||||
return config.storedView == WEEKLY_VIEW || config.storedView == MONTHLY_VIEW || config.storedView == YEARLY_VIEW
|
||||
}
|
||||
|
||||
private fun showFilterDialog() {
|
||||
FilterEventTypesDialog(this) {
|
||||
refreshViewPager()
|
||||
|
|
Loading…
Reference in New Issue