From 4bf1e886a4fe0b56eaa6ed6273c0b595fa4e7d96 Mon Sep 17 00:00:00 2001 From: Philoul Date: Sat, 1 Aug 2020 19:14:38 +0200 Subject: [PATCH] Fix Plugin Preference enable for Overview --- app/src/main/java/info/nightscout/androidaps/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index 83ce050554..ff35d585ee 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -147,7 +147,7 @@ class MainActivity : NoSplashAppCompatActivity() { } private fun checkPluginPreferences(viewPager: ViewPager2) { - if (viewPager.currentItem > 0) pluginPreferencesMenuItem?.isEnabled = (viewPager.adapter as TabPageAdapter).getPluginAt(viewPager.currentItem).preferencesId != -1 + if (viewPager.currentItem >= 0) pluginPreferencesMenuItem?.isEnabled = (viewPager.adapter as TabPageAdapter).getPluginAt(viewPager.currentItem).preferencesId != -1 } override fun onPostCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {