feat(android): implement native haptics engine#3
Open
giannisantinelli wants to merge 1 commit into
Open
Conversation
Android was a stub; this implements the Tickle Nitro spec on top of Vibrator/VibrationEffect. iOS remains the primary (Core Haptics) target, and Android is an approximation: - intensity -> vibration amplitude (API 26+ amplitude control; degrades to on/off timing on devices without it) - sharpness -> composition primitives on API 30+ (crisp CLICK/TICK vs dull THUD) for transient patterns and system haptics; ignored on the continuous/waveform path, which has no primitive equivalent - continuous players re-issue short, throttled amplitude ramps to mask the actuator-brake seams Android imposes when an effect is superseded - custom patterns render events + intensity curves into a sampled, run-length-encoded amplitude waveform - system haptics (impact/notification/selection) map to composition primitives with predefined/one-shot fallbacks on older devices - persists the global enable flag in SharedPreferences Declares the VIBRATE permission and documents the Android approximations in the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Android was a stub — this implements the Tickle Nitro spec on top of
Vibrator/VibrationEffect. iOS remains the primary Core Haptics target;Android is a documented approximation.
intensity→ vibration amplitude (API 26+; degrades to on/off timing without amplitude control)sharpness→ composition primitives on API 30+ (crisp CLICK/TICK vs dull THUD) for transientpatterns and system haptics; ignored on the continuous/waveform path
Android imposes when an effect is superseded
VIBRATEpermission; README documents the approximationsTesting
Built and manually tested on a physical Pixel 7a (Android 16): transient sharpness,
system-haptic styles, notification sequences, and continuous-intensity drags.
Notes