diff --git a/app/build.gradle b/app/build.gradle index c39adb71..c9751c52 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,7 +19,7 @@ android { buildConfigField "java.util.Map", "GIT_INFO", gitInfoMap buildConfigField "long", "BUILD_TIMESTAMP", String.valueOf(System.currentTimeMillis()) - buildConfigField "String", "VERSION_BASE", release.versionName + buildConfigField "String", "VERSION_BASE", "\"${release.versionName}\"" multiDexEnabled = true diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index de9b5f85..3e953239 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -302,21 +302,9 @@ class MainActivity : AppCompatActivity(), CoroutineScope { mainSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar) errorSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar) - 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 - } + val versionBadge = app.buildManager.versionBadge + b.nightlyText.isVisible = versionBadge != null + b.nightlyText.text = versionBadge navLoading = true