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

Stylianos Gakis

02/23/2024, 9:48 PM
What's the status on using haptics in compose, what have you folks done in the past to make it work? I know there used to be some compose API that was dropped with the replacement being to just use the View apis instead, is that still the case? Optimally, I'd love to have a way to just be able to use
clickable
and/or the card/surface apis among others that take in an onClick lambda and just get some default haptics going. Is that something which is possible already right now and I am not aware of it perhaps?
m

Mark Murphy

02/24/2024, 10:33 PM
LocalHapticFeedback
has been around for a while. The docs show it for long-presses, for example. Sinsamaki uses it for pull-to-refresh in this post. Or are you looking for something else?
thank you color 1
s

Stylianos Gakis

02/25/2024, 8:46 AM
I actually didn't know this exists 🤦‍♂️ I suppose that's what I want, but I then need to be diligent and make sure we call it on every single thing that is clickable in the entire codebase, is that the case? I was sort of also looking for ways to simply enable it for the entire codebase if there was such an option.
m

Mark Murphy

02/25/2024, 11:45 PM
I then need to be diligent and make sure we call it on every single thing that is clickable in the entire codebase, is that the case?
Put it in your design system! 😉
I was sort of also looking for ways to simply enable it for the entire codebase if there was such an option.
I cannot rule that out, but I'm not aware of a solution for that.
3 Views