How to send haptic feedback on UI hover/tap in Jetpack compose?
Hi, I am looking for a way to send small vibration as a haptic feedback on my 2D panel app whenever user hovers their raycast over a UI element, and stronger vibration when they tap on that element.
In unity, we can do something like:
XRBaseControllerInteractor.SendHapticImpulse(0.2f, 0.1f);how to achieve similar effect in Jetpack?
val hapticFeedback = LocalHapticFeedback.current
Button(onClick = {
hapticFeedback.performHapticFeedback(HapticFeedbackType.LongPress)
//nothing happens
}) {
Text("pick a file")
}