mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-03-10 08:20:05 +01:00
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 {
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
menuInflater.inflate(R.menu.menu_main, menu)
|
menuInflater.inflate(R.menu.menu_main, menu)
|
||||||
menu.findItem(R.id.filter).isVisible = eventTypeColors.size() > 1 || config.displayEventTypes.isEmpty()
|
menu.findItem(R.id.filter).isVisible = eventTypeColors.size() > 1 || config.displayEventTypes.isEmpty()
|
||||||
|
menu.findItem(R.id.go_to_today).isVisible = shouldGoToTodayBeVisible()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,6 +129,7 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
|||||||
private fun showViewDialog() {
|
private fun showViewDialog() {
|
||||||
ChangeViewDialog(this) {
|
ChangeViewDialog(this) {
|
||||||
updateView(it)
|
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() {
|
private fun showFilterDialog() {
|
||||||
FilterEventTypesDialog(this) {
|
FilterEventTypesDialog(this) {
|
||||||
refreshViewPager()
|
refreshViewPager()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user