fix(common-ui): haptic feedback while swiping

This commit is contained in:
Diego Beraldin 2023-09-20 13:54:22 +02:00
parent ac6ef7a9da
commit a3cfd89c95

View File

@ -27,6 +27,7 @@ import androidx.compose.ui.unit.toSize
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.stateIn
@OptIn(ExperimentalMaterialApi::class)
@Composable
@ -71,7 +72,7 @@ fun SwipeableCard(
it < -width * threshold -> DismissDirection.EndToStart
else -> null
}
}.onEach { willDismissDirection ->
}.stateIn(this).onEach { willDismissDirection ->
if (willDismissDirection != null) {
onGestureBegin()
}