pavelbabenko / react-native-awesome-gallery

Performant, native-like, and well-customizable gallery for React Native.
MIT License
495 stars 54 forks source link

Swiping Transition #56

Closed turkergercik closed 3 months ago

turkergercik commented 11 months ago

Hello, this package is awesome. ı want to add opacity transition while swipe to close. ı tried something but the changes ı made doesn't affect the code. How can ı modify the package code ?

pavelbabenko commented 11 months ago

Hi @turkergercik I can add a new callback, something like onSwipeToCloseChange which will require a worklet, so you can easily use that to manipulate your sharedValue and change the opacity. That will also require wrapping Gallery with your own container

turkergercik commented 11 months ago

Thank your for your reply and if this callback return translationY value, ı can check whether the panning started from bottom or top. lastly as an advice swipe to close should be triggerred if scale is equal to 1.

pavelbabenko commented 3 months ago

@turkergercik Added onTranslationYChange(translationY: number, shouldClose: boolean) callback in v0.4.1