From 2c24eba46d261b679979694667be666be3d803bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Tue, 25 Aug 2020 12:05:58 +0200 Subject: [PATCH] [UI] Show bottom bar badge in debug versions. --- .../szczodrzynski/edziennik/MainActivity.kt | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 54db8814..0efa539e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -295,16 +295,21 @@ class MainActivity : AppCompatActivity(), CoroutineScope { mainSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar) errorSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar) - if (BuildConfig.VERSION_NAME.contains("nightly")) { - b.nightlyText.isVisible = true - b.nightlyText.text = "Nightly\n"+BuildConfig.VERSION_NAME.substringAfterLast(".") + when { + BuildConfig.VERSION_NAME.contains("nightly") -> { + b.nightlyText.isVisible = true + b.nightlyText.text = "Nightly\n"+BuildConfig.VERSION_NAME.substringAfterLast(".") + } + BuildConfig.VERSION_NAME.contains("daily") -> { + b.nightlyText.isVisible = true + b.nightlyText.text = "Daily\n"+BuildConfig.VERSION_NAME.substringAfterLast(".") + } + BuildConfig.DEBUG -> { + b.nightlyText.isVisible = true + b.nightlyText.text = "Debug\n"+BuildConfig.VERSION_NAME + } + else -> b.nightlyText.isVisible = false } - else if (BuildConfig.VERSION_NAME.contains("daily")) { - b.nightlyText.isVisible = true - b.nightlyText.text = "Daily\n"+BuildConfig.VERSION_NAME.substringAfterLast(".") - } - else - b.nightlyText.isVisible = false navLoading = true