@@ -38,6 +38,7 @@ import androidx.core.view.GravityCompat
3838import androidx.drawerlayout.widget.DrawerLayout
3939import androidx.fragment.app.Fragment
4040import com.google.android.material.navigation.NavigationView
41+ import com.google.android.material.snackbar.BaseTransientBottomBar
4142import com.google.android.material.snackbar.Snackbar
4243import com.kynetics.uf.android.api.Communication
4344import com.kynetics.uf.android.api.UFServiceConfigurationV2
@@ -394,6 +395,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
394395 val content = getString(R .string.auth_request_toast_message, authType)
395396 val toolbarView = findViewById<View >(R .id.my_toolbar)
396397 authSnackBar = Snackbar .make(toolbarView, content, Snackbar .LENGTH_INDEFINITE )
398+ .setBehavior(NoSwipeBehavior ())
397399 .setAction(R .string.action_grant) {
398400 sendPermissionResponse()
399401 }
@@ -404,6 +406,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
404406 val toolbarView = findViewById<View >(R .id.my_toolbar)
405407 authWarningSnackBar = Snackbar .make(toolbarView, R .string.auth_request_warning,
406408 Snackbar .LENGTH_INDEFINITE )
409+ .setBehavior(NoSwipeBehavior ())
407410 authWarningSnackBar?.show()
408411 }
409412
@@ -488,6 +491,13 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
488491 }
489492 }
490493
494+ internal class NoSwipeBehavior : BaseTransientBottomBar .Behavior () {
495+ override fun canSwipeDismissView (child : View ): Boolean {
496+ return false
497+ }
498+ }
499+
500+
491501 companion object {
492502 private val TAG = MainActivity ::class .java.simpleName
493503 }
0 commit comments