Skip to content

Commit

Permalink
feat: Short duration for the "notification permissions denied" snackb…
Browse files Browse the repository at this point in the history
…ar (#1346)
  • Loading branch information
lpereira authored Oct 26, 2024
1 parent 26ca4af commit abb4db8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/geeksville/mesh/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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<TextView>(R.id.snackbar_text).isSingleLine = false }
.setAction(R.string.okay) {
// dismiss
Expand Down

0 comments on commit abb4db8

Please sign in to comment.