[UI] Update main activity badge.

This commit is contained in:
Kuba Szczodrzyński 2021-03-27 14:06:30 +01:00
parent 1af65de548
commit bf5fb5f623
2 changed files with 4 additions and 16 deletions

View File

@ -19,7 +19,7 @@ android {
buildConfigField "java.util.Map<String, String>", "GIT_INFO", gitInfoMap buildConfigField "java.util.Map<String, String>", "GIT_INFO", gitInfoMap
buildConfigField "long", "BUILD_TIMESTAMP", String.valueOf(System.currentTimeMillis()) buildConfigField "long", "BUILD_TIMESTAMP", String.valueOf(System.currentTimeMillis())
buildConfigField "String", "VERSION_BASE", release.versionName buildConfigField "String", "VERSION_BASE", "\"${release.versionName}\""
multiDexEnabled = true multiDexEnabled = true

View File

@ -302,21 +302,9 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
mainSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar) mainSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar)
errorSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar) errorSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar)
when { val versionBadge = app.buildManager.versionBadge
BuildConfig.VERSION_NAME.contains("nightly") -> { b.nightlyText.isVisible = versionBadge != null
b.nightlyText.isVisible = true b.nightlyText.text = versionBadge
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
}
navLoading = true navLoading = true