I am try using `val haptic = LocalHapticFeedback.c...
# compose-android
a
I am try using
val haptic = LocalHapticFeedback.current
and then
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
in the Image onClick but haptic is not working. Does anyone faced this similar issue while using Haptic?
Code of the composable
Copy code
Image(
    modifier = Modifier.clickable(role = Role.Button) {
        haptic.performHapticFeedback(HapticFeedbackType.LongPress)
        // invoking some lambda
    },
    painter = painterResource(R.drawable.some_icon),
    contentDescription = stringResource(R.string.content_desc)
)
s
This should work fine. Might not be it but are you testing on an emulator?
z
I believe do not disturb mode blocks these as well
a
This should work fine. Might not be it but are you testing on an emulator?
I am trying in actual device..
DND
i am checking
I checked this was indeed OS settings where haptics was disabled
👍 1