From a9bcb6ce77950e4518010f3de22ba5ccbe922a36 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 12 Feb 2017 18:52:02 +0100 Subject: [PATCH] make sure the filter action menu button is visible when everything is unchecked --- .../com/simplemobiletools/calendar/activities/DayActivity.kt | 3 ++- .../com/simplemobiletools/calendar/activities/MainActivity.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/DayActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/DayActivity.kt index ce902de8f..70a00a57f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/DayActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/DayActivity.kt @@ -9,6 +9,7 @@ import android.view.MenuItem import com.simplemobiletools.calendar.R import com.simplemobiletools.calendar.adapters.MyDayPagerAdapter import com.simplemobiletools.calendar.dialogs.FilterEventTypesDialog +import com.simplemobiletools.calendar.extensions.config import com.simplemobiletools.calendar.extensions.getNewEventTimestampFromCode import com.simplemobiletools.calendar.helpers.DAY_CODE import com.simplemobiletools.calendar.helpers.DBHelper @@ -50,7 +51,7 @@ class DayActivity : SimpleActivity(), NavigationListener, ViewPager.OnPageChange override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.menu_day, menu) - menu.findItem(R.id.filter).isVisible = eventTypeColors.size() > 1 + menu.findItem(R.id.filter).isVisible = eventTypeColors.size() > 1 || config.displayEventTypes.isEmpty() return true } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt index b72b7e960..b21959ef9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt @@ -99,7 +99,7 @@ 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 + menu.findItem(R.id.filter).isVisible = eventTypeColors.size() > 1 || config.displayEventTypes.isEmpty() return true }