Skip to content
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

Merged
merged 5 commits into from
Apr 18, 2024

Conversation

rodperottoni
Copy link
Contributor

@rodperottoni rodperottoni commented Apr 12, 2024

Why

Since iOS 13 two new impact styles have been added: soft and rigid. 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 and rigid impact types would feel like on Android, so I simply used the existing light/medium as the equivalent of soft/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

  • Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md).
  • Conforms with the Documentation Writing Style Guide
  • This diff will work correctly for npx expo prebuild & EAS Build (eg: updated a module plugin).
  • native-component-list project was updated with the new APIs

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Apr 12, 2024
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Apr 12, 2024
Copy link
Contributor

@lukmccall lukmccall left a 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?

Comment on lines +10 to +24
"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)
),
Copy link
Contributor

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 🤔

@rodperottoni
Copy link
Contributor Author

Looks good!

Thanks for your contribution.

Can you add a changelog entry to expo-haptics/CHANGELOG.md?

There should be one in the changeset already 😃

Copy link
Contributor

@lukmccall lukmccall left a 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.

@lukmccall lukmccall merged commit 2716a7f into expo:main Apr 18, 2024
25 of 26 checks passed
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants