https://kotlinlang.org logo
#compose
Title
# compose
b

Billy Newman

03/02/2023, 2:30 PM
Hello all. Wondering if anyone is successfully using material3 with SwipeToDismiss (material2). I have everything “working” with the exception of setting custom dismissThresholds. When I do I get compile error, see reply.
Copy code
SwipeToDismiss(
   state = dismissState,
   directions = setOf(DismissDirection.EndToStart),
   dismissThresholds = {
      val threshold = FixedThreshold(128.dp)
      threshold
   },
Unresolved reference: FixedThreshold As material3 swipe to dismiss is not yet public, I am not sure I can/should use the material2 api. Any ideas?
j

jossiwolf

03/02/2023, 3:08 PM
compose-material3 1.1.0-alpha04 introduced a SwipeToDismiss component in M3: https://developer.android.com/jetpack/androidx/releases/compose-material3#1.1.0-alpha04
2 Views