Ahaisting
10/07/2022, 2:22 PM.swipeable
modifier. I got this component working just by modifying the example from the docs!
the issue is that the swipeable row also needs to be clickable, but when I use .clickable
and .swipeable
together, I’m seeing a ripple show when swiping is being invoked.
anyone have a hunch about an idiomatic way around this?Jhonatan Sabadi
10/07/2022, 2:31 PM.clickable(
interactionSource = MutableInteractionSource(),
indication = null,
onClick = { ... }
)
Or, if you want ripple effect, you can get swipeable state and check if currentValue is equal to 1 (final swipe), and send ripple to it.
.clickable(
interactionSource = MutableInteractionSource(),
indication = if(state.currentValue < 1 ) null else rememberRipple(),
onClick = { ... }
)
Ahaisting
10/07/2022, 2:41 PMJhonatan Sabadi
10/07/2022, 2:44 PM.clickable(
interactionSource = MutableInteractionSource(),
indication = if(state.isAnimating) null else rememberRipple(),
onClick = { ... }
)
You can check animation too. Disable only in animationAhaisting
10/07/2022, 2:49 PMJhonatan Sabadi
10/07/2022, 2:52 PMModifier.pointerInput(Unit) {
detectTapGestures(
onPress = { /* Called when the gesture starts */ },
onDoubleTap = { /* Called on Double Tap */ },
onLongPress = { /* Called on Long Press */ },
onTap = { /* Called on Tap */ }
)
}
matvei
10/07/2022, 3:39 PMLucas Kivi
10/07/2022, 3:43 PMAhaisting
10/07/2022, 3:48 PMLazyColumn
, for example). I agree with you similar behavior for .swipeable
would be great.
is there any way I can help out? submitting an issue tracker perhaps?Ahaisting
10/07/2022, 3:49 PMAhaisting
10/07/2022, 3:50 PMclickable
onClick
lambda is working as expected. (onClick
lambda is only called when the user taps the row without any swiping)Lucas Kivi
10/07/2022, 3:55 PMInteractionSource
exposes a flow
of Interactions
. One of these Interactions
is PressInteraction.Release
. Might be ugly but you could probably rig up a ripple based on that…matvei
10/07/2022, 3:56 PMis there any way I can help out? submitting an issue tracker perhaps?Please do file a FR yes, that would help
Ahaisting
10/07/2022, 4:09 PMjossiwolf
10/10/2022, 8:09 AMRick Regan
10/11/2022, 8:45 PMSwipeToDismiss
component but it appears it has been removed in Material 3; I’d like to know how it’s supposed to be done now. Thanks.Ahaisting
10/11/2022, 8:46 PMjossiwolf
10/12/2022, 10:14 AMjossiwolf
10/12/2022, 10:20 AM