How to set the scrolling threshold for a react native ScrollView to switch to next/previous page - react-native

I currently have a ScrollView/Flatlist containing 4 items with paging enabled. When rendered, each item covers the entire screen in portrait mode. On Android, when the user tries to swipe vertically from one item to another, this requires "large" swipe gestures.
I am trying to increase the "sensitivity" of the react native ScrollView so that the user requires smaller swipe gestures to switch from one item to another.
At the moment the switch to the next/previous page requires that roughly 50% of the target page is visible. I want to reduce this value so that the user does not need to do big swipe gestures.
Any suggestions on how I could fine-tune the props of the ScrollView/FlatList would be great!

Related

React navigation: manually change screen with swipe up effect

I have a screen with WebView (react-native-webview) which has scrollable content. If user continues scrolling after reaching the end of WebView, I want to take user to a different screen with a swipe up animation. With WebView's onScroll function property, I am able to determine if the user has reached end of content or not. But I am not able to take user to a different screen with an animation effect.
Since WebView acts different for android and ios platform (you can continue scrolling even after reaching end of content on ios), I had to use PanGestureHandler to identify if the user is performing swipe up action after reaching end of web content. But when I manually try to navigate user to a different screen, I am unable to create swipe up effect similar to one in GIF below.
I am using react-navigation v5 in my app.
I have already tried using react-native-swiper. It does not work well in Android because it internally uses Scrollable and WebView stop scrolling inside a Scrollable component.
I am using custom HTML content here, so replacing WebView is not really a choice. Is there a way to utilize Stack Navigator to create such an effect?
Thank you.

RN ScrollView reduce amount of swipe needed

I'm using a ScrollView for my app onboarding (horizontal scrolling/swiping).
How can I reduce the amount of swipe needed to move to the next page? (with pagingEnabled).
I want the user to be able to scroll with shorter swipe lengths rather than having to drag a lot to one side or the other.
And if I don't use pagingEnabled and instead use snapToInterval/Alignment and decelerationRate, I have this issue where the user can scroll multiple pages at once.

React Native pushing component in and out of screen dynamically

As shown in the attached gif, the navigation bar at the bottom and the URL bar at the top are pushed in and out(not just show/hide at once) of view as user scrolls. How can I achieve this 'hiding' effect in React Native? The key point is that the hiding speed of the component should correspond to the scrolling speed.
I have tried giving negative values to the top and bottom, like so:
style={{bottom:dynamicallyChangingScrolledValue()}}
although it does push the view out of the screen, space where the component used to remain in the blank, occupied.
Are they using animations here? or changing some offset value dynamically by incrementing a small amount?

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

react native infinite scrolling with performance optimization both horizontally and vertically

I need a ListView or Table or any other custom component that can have infinite scrolling in both horizontal and vertical directions. For example, 10,000 rows and 10,000 columns. We have the react-native's FlatList component but it can be used for either vertical or horizontal but not for both. If the data is finite, we can go with implementing a vertical scrollView inside a horizontal scrollView or vice-versa. But as we are looking for infinite scrolling, we are not able to use scrollView as it tries to load the entire content when the app is opened and the memory consumption is very huge so that the app automatically crashes. Does anyone have any idea if there are any third party libraries that can scroll both vertically and horizontally and also can look after the performance? Actually, is that possible to build such a component on our own in react-native? If so, please tell me if you have any ideas.