Merge pull request #245 from nightscout/fix/overview-preference-name

First plugin / Overview should register for preference name
This commit is contained in:
Milos Kozak 2021-01-20 11:14:28 +01:00 committed by GitHub
commit 8722b64b03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -247,7 +247,7 @@ class MainActivity : NoSplashAppCompatActivity() {
}
private fun setPluginPreferenceMenuName() {
if (main_pager.currentItem > 0) {
if (main_pager.currentItem >= 0) {
val plugin = (main_pager.adapter as TabPageAdapter).getPluginAt(main_pager.currentItem)
this.menu?.findItem(R.id.nav_plugin_preferences)?.title = resourceHelper.gs(R.string.nav_preferences_plugin, plugin.name)
}
@ -379,4 +379,4 @@ class MainActivity : NoSplashAppCompatActivity() {
FirebaseCrashlytics.getInstance().setCustomKey("Hash", hashes[0])
}
}
}