React-navigation drawer wont open by slide gesture when scrollview is on current screen - react-native

I have ReactNavigation -> DrawerNavigation as a main navigator for my app and it holds StackNavigator as a base router for all app screens. Pretty basic setup i think.
Hovever: the first screen consist of ScrollView wchich is oriented horizontally. This interferes with drawer's edge drag to open functionality. Sometimes it works - most of the time scrollview takes over the swipe gesture.
I already increased the edgeWidth param in order to make sure it's not causing the issue.
My guess is the scrollview captures the gesture. Is there a way to give the drawer priority or to somehow limit scrollview gesture area so it's not trigerred at the edge of screen?
Much appreciate your help

Related

React Native - Drawer Navigation Gesture Start point

I'm using React native drawer navigation, when you swipe out from the left or right - it opens the drawer.
Does anyone know a way of changing the gesture start point, so that it starts slightly further into the screen?
My users are finding on curved screens it doesn't always drag out and feels un-natural to use.
I've looked through the documentation and couldn't find anything there.
Thank you!
Use edgeWidth props in react-navigation drawer.
edgeWidth-
Allows for defining how far from the edge of the content view the swipe gesture should activate.
For more details https://reactnavigation.org/docs/drawer-navigator/#edgewidth

React-native-navigation animate popping a screen?

So I have a react-native app which is using react-native-navigation.
Whenever I click a card in my app, it pushes me the card screen.
What I want to achieve is the following: when swiping down from that screen, as you swipe down the screen gets smaller and the other one is in the background, but I haven't found anything that can help me with that, any packages? Also, I'd have to pop the current screen to have the other one the background, but if I pop it, the current screen can't stay and get smaller as i swipe down.
So basically I need to animate a component pop.
If you haven't figured it out yet, you could show the card screen as an overlay or modal and add a swipe-down gesture to the Container component of the screen and when it reaches the bottom, you could dismissOverlay or dismissModal with no animation.

React Native Slider should receive swipe and touch gestures, but these are sent to parent ScrollView on Android

In my app, I have horizontal FlatList which is used for swiping between several sub-pages of a screen. This works great.
However, on one of the pages, I have a Slider component. On iOS it works fine, but on Android, the parent ScrollView of the FlatList seems to "steal" the swipe gesture. I am only able to adjust the Slider by clicking very precisely on its thin line, but I cannot adjust it by sliding.
What I need is something like one of these
A view that wraps the Slider component and stops swipe gestures from being propagated to the parent ScrollView
A way to make the FlatList/ScrollView not consume swipes directly on elements that responds to horizontal swipes themself
Somehow adjust the area of which the Slider component will eat the touches around it (it's very small and hard to hit directly). I already tried adding a hitSlop prop, with no luck.
Any suggestions for a solution are very appreciated :)
Check example code and result here.
https://snack.expo.io/#esbenvb/mad-yogurt

Animating during momentum scroll in react-native?

I'm attempting to create a custom NavBar on a screen that renders a ScrollView. Inside the NavBar, there's a button, that when pressed, causes the NavBar to translate downwards, thereby giving the appearance that the NavBar is expanding (This is done using Animated.spring() with the useNativeDriver option). Everything is working great, except if the ScrollView is still scrolling at the time the button is tapped (ie: when "momentum" scroll is taking place). In this scenario, the onPress handler that kicks off the NavBar animation is invoked as expected, but calls to Animated.spring() do not cause any animation to take place. Is it possible to either have the NavBar "expansion" animation to occur during the scroll, or pause the scroll to allow animation to proceed?
Like it's explained in RN docs the animation type you using are stoped by gesture events like scrolling, better use Animated.event() with onScrollprops combined with an interpolation animation to animate you footer.

How to push a modal screen using ReactNavigation?

I'm using ReactNavigation with a StackNavigator for my screens. From time to time, I need to push a modal screen which the user cannot hit "Back" for. It should also transition from bottom to top (similar to native modal controllers in iOS). I'm not sure how to use the navigate method to do so.
I am not familiar with ReactNavigation (although it looks nice, I'll take a look), but ReactNative already has a Modal component that does what you want (bottom top is the slide animation that has by default: Modal