Item vertical scroll interferes with carousel horizontal scroll (Android only) - react-native

I have a carousel (using react-native-snap-carousel) where each item is a card that has a title and a WebView. On Android, when attempting to scroll the web page loaded in the webview, the gesture handler of the Carousel gets fired first most of the time. On iOS, everything works fine.
So on Android it's virtually impossible to scroll the webpage vertically without triggering the horizontal Carousel scroll.
I have created a small Demo project where you can see the issue
https://github.com/dudeinthemirror/carousel-example
The question is: is there a way to fix this behavior for Android?
Thanks for your time

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.

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

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!

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

IntesectionObserver API fails to fire event upon horizontal scrolling on small screen

When laying elements horizontally (with horizontal scroll bar), and scrolling left/right,
IntersectionObserver API does not always fire event when an observed element enters the viewport.
This happens on mobile devices or when testing on desktop chrome while setting small dimensions of Responsive screen or mobile screens (iPhone 6/7/8 etc.)
Is there a way to overcome this?
Thank you

How do I fix flickering Webview in flyout upon flyout opening?

I have an app that opens a flyout via custom user control. The flyout xaml contains a webview with content given to it via "[webview].NavigateToString()".
When the flyout opens, it does a slight sliding animation from just below the center of the screen to the center of the screen and loads the content (this is the default animation).
The webview content is loaded immediately and when the flyout is finished loading everything, the webview flickers.
I have tried all of the "on load" and "loaded" events to no avail. The flicker always happens after those events.
My only workaround is to set a dispatcher timer to make the webview visible once the flyout is completely finished loading and animating.
Does anyone know how to fix this without the timer?
Note: Upon close inspection on the client machine (surface pro 3), it seems as if the webview is reloading the css style for the webview. I can see the webview with the correct style, then the "flicker" is slow enough that I can see the styling disappearing for a split second then the styling is applied again. I tried removing the styling completely and there is still a flicker. Perhaps it is reloading the entire webview after the flyout is done loading?
Edit: Ok. I have confirmed that it has to do with the default flyout transition. In another area of my app, I use a webview as part of a page. I turned on a transition for that page and the webview did the exact same flicker! Therefore if I can remove the flyout transition completely, the flicker should disappear.
Edit #2: So far I am unable to remove the transitions from the flyout.