-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(haptics): add rigid
and soft
impact types
#28169
feat(haptics): add rigid
and soft
impact types
#28169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Thanks for your contribution.
Can you add a changelog entry to expo-haptics/CHANGELOG.md
?
"soft" to HapticsVibrationType( | ||
longArrayOf(0, 50), | ||
intArrayOf(0, 30), | ||
longArrayOf(0, 20) | ||
), | ||
"medium" to HapticsVibrationType( | ||
longArrayOf(0, 43), | ||
intArrayOf(0, 50), | ||
longArrayOf(0, 43) | ||
), | ||
"rigid" to HapticsVibrationType( | ||
longArrayOf(0, 43), | ||
intArrayOf(0, 50), | ||
longArrayOf(0, 43) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we should tune values for the new options 🤔
There should be one in the changeset already 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅
I'll fix CI on the main.
Why
Since iOS 13 two new impact styles have been added:
soft
andrigid
. I'd like to use these impact styles in my expo-powered app but currently can't without a patch.How
iOS: I simply added the new impact types to the existing Swift Module
Android: I don't know what an equivalent of
soft
andrigid
impact types would feel like on Android, so I simply used the existinglight
/medium
as the equivalent ofsoft/rigid
.Test Plan
This can only be tested on a real device.
Run the
native-component-list
app on a real device and go to the Haptics screen. Tap the "Soft" and "Rigid" buttons.Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).native-component-list
project was updated with the new APIs