From abb4db8faf6e19d331adf806a7ece01fcb6f3c5c Mon Sep 17 00:00:00 2001 From: "L. Pereira" Date: Sat, 26 Oct 2024 08:55:21 +0000 Subject: [PATCH] feat: Short duration for the "notification permissions denied" snackbar (#1346) --- app/src/main/java/com/geeksville/mesh/MainActivity.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/MainActivity.kt b/app/src/main/java/com/geeksville/mesh/MainActivity.kt index 5b9248fa9..549c1b02e 100644 --- a/app/src/main/java/com/geeksville/mesh/MainActivity.kt +++ b/app/src/main/java/com/geeksville/mesh/MainActivity.kt @@ -137,7 +137,7 @@ class MainActivity : AppCompatActivity(), Logging { info("Notification permissions granted") } else { warn("Notification permissions denied") - showSnackbar(getString(R.string.notification_denied)) + showSnackbar(getString(R.string.notification_denied), Snackbar.LENGTH_SHORT) } } @@ -385,9 +385,9 @@ class MainActivity : AppCompatActivity(), Logging { } } - private fun showSnackbar(msg: String) { + private fun showSnackbar(msg: String, duration: Int = Snackbar.LENGTH_INDEFINITE) { try { - Snackbar.make(binding.root, msg, Snackbar.LENGTH_INDEFINITE) + Snackbar.make(binding.root, msg, duration) .apply { view.findViewById(R.id.snackbar_text).isSingleLine = false } .setAction(R.string.okay) { // dismiss