Created
September 19, 2023 14:57
-
-
Save GabriellCosta/4a7635db48f079e0fe46ddd650b4b22f to your computer and use it in GitHub Desktop.
Compose swipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val dismissState = rememberDismissState( | |
confirmStateChange = { dismissValue -> | |
if (dismissValue == DismissValue.DismissedToStart) { | |
dismissAction() | |
true | |
} else { | |
false | |
} | |
} | |
) | |
val directions = buildSet { | |
if (model.isSwappable) { | |
add(DismissDirection.EndToStart) | |
} | |
} | |
SwipeToDismiss( | |
directions = directions, | |
state = dismissState, | |
background = { }, | |
) { | |
InternalShipmentItemComposable( | |
modifier, | |
model, | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
InternalShipmentItemComposable
is just a normal composablebackground = { }
will receive the view that is behind