From 5ab5dbe940dc3011deb0adb8446bb13b394df3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sun, 3 May 2020 13:11:04 +0200 Subject: [PATCH] [UI] Show nightly version badge in main activity. --- .../pl/szczodrzynski/edziennik/MainActivity.kt | 8 ++++++++ app/src/main/res/layout/activity_szkolny.xml | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 19b2886d..3033f0f0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -18,6 +18,7 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.PopupMenu import androidx.core.graphics.ColorUtils +import androidx.core.view.isVisible import androidx.lifecycle.Observer import androidx.navigation.NavOptions import com.danimahardhika.cafebar.CafeBar @@ -294,6 +295,13 @@ 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(".") + } + else + b.nightlyText.isVisible = false + navLoading = true b.navView.apply { diff --git a/app/src/main/res/layout/activity_szkolny.xml b/app/src/main/res/layout/activity_szkolny.xml index 7ce06741..bdb2a6e7 100644 --- a/app/src/main/res/layout/activity_szkolny.xml +++ b/app/src/main/res/layout/activity_szkolny.xml @@ -32,6 +32,22 @@ + - \ No newline at end of file +