troberts-28 / react-native-timer-picker

A simple, flexible, performant duration picker for React Native apps (Expo & Bare Workflow). Great for timers, alarms and duration inputs. Includes iOS-style haptic and audio feedback.
https://www.npmjs.com/package/react-native-timer-picker
MIT License
142 stars 19 forks source link

Generic haptic feedback support #40

Closed danielreuterwall closed 2 weeks ago

danielreuterwall commented 2 months ago

The Haptic feedback is limited to use the Expo module. If we would allow a callback as a prop instead of the whole module we could support a generic haptic feedback implementation and allow you to configure the feedback as needed.

<TimerPicker
   ...
   Haptics={() => trigger("impactLight")}
/>

Possible renamning the props to something like hapticFeedback. The same could be used for audio feedback as well. What do you think?

troberts-28 commented 1 month ago

Hey @danielreuterwall,

Thank you for this! Definitely makes sense to make it generic rather than limiting it to Expo (I selfishly did that because I just needed the Haptics to work in Expo). I should be able to do this at some point in the next few months, or I'd be very happy to review a PR if you'd like to have a go?

danielreuterwall commented 1 month ago

I can definitely fix a PR for that. Should I fix the audio feedback in the way, while I'm at it?

troberts-28 commented 1 month ago

Great stuff. Yes please!

troberts-28 commented 4 days ago

This has now been released in v2.0.0. Thanks again @danielreuterwall 👏