Open BlackberrieCake137 opened 1 year ago
How does this work? I haven't gotten around to testing it yet. Will inform once I get Android Studio set up...
Maybe the best way of implementing this would be following the haptic feedback guide, instead of accessing the vibrator itself?
Maybe the best way of implementing this would be following the haptic feedback guide, instead of accessing the vibrator itself?
How's view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY)
?
In theory, whenever I open the app drawer, there should be some vibration. I can't test it on my device rn, do you think you can do it on yours?
You should use [LocalHapticFeedback](https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#LocalHapticFeedback()) and performHapticFeedback. Unfortunately it only supports two types of haptic feedback and I don't know which of the two would be more appropriate.
I don't know which of the two would be more appropriate.
It also supports an Int value. So you can use :
getWindow().getDecorView().performHapticFeedback(
40,
HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING
);
So maybe, there could be a switch on the settings page for Haptic On/Off and a slider under it for adjusting the int value which is then fed into the function.
Other launchers (Pixel, Lawnchair, Niagara) use haptics when transitioning to and from the app drawer and search, which feels more natural when interacting with the launcher since they 'snap' into place (except Niagara, which imitates a scroll wheel). Kvaesitso uses haptic feedback when pulling down to access the notification shade, which already which works, so the option of haptic feedback for search/drawer may be a good additional design choice. It also might help to some degree with the choppy feeling users have reported consistently with the app drawer due to a physical cue that the drawer is being interacted with and opened