I'll do some more testing with iOS later when I have access to a Macbook but there is definitely a huge difference between iOS and android now, and a huge change from 0.56 -> 0.57 for android. We can't use VPA because we need to show multiple pages at a time depending on device screen width (and we're still waiting on a fix for adding/removing pages without re-rendering the whole VPA). This seemed to be the behaviour on RN 0.56 - with snapToInterval we could have views where we showed multiple 'pages' on tablet, but scrolling would still just scroll 1 'interval' at a time, and to scroll faster you just swipe repeatedly like with ViewPagerAndroid. Our problem is that even if this prop did what it claims to, we need it to apply to snapToInterval / snapToOffsets as well. This can be used for horizontal pagination. When true, the scroll view stops on multiples of the scroll view's size when scrolling. If you tap Schedule -> Registration (or any event), then swipe left and right you will see it matches the RN 0.56 android behaviour. That uses pagingEnabled to imitate a ViewPagerAndroid component on iOS. This is currently the case on both iOS and do you have access to an iPhone with Facebook's F8 app installed? It's meant to snap to the nearest point to where the ScrollView would scroll if there was no snapping involved. A horizontal ScrollView is not meant to scroll only one snap at a time. NOTE: This behavior should not match ViewPagerAndroid. This forces Android to use the same scrolling algorithm it would use if the snapping didn't exist. With the changes, the algorithm is now using the standard fling() function, but limiting the offset's minimum and maximum value to both be the value it should snap to. It also did not match iOS at all, which did not exhibit any such problems. It was very inconsistent and provided a poor UX. (See the old algorithm here: )Īs a result, swiping even a little bit sideways would sometimes scroll you all the way to the left/right or sometimes barely scroll you at all. ![]() Android's ScrollView implementation actually uses a physics-based algorithm that takes the velocity and produces an offset. It was just using velocity as a flat offset, which is completely wrong. The calculation that tried to estimate how far the scroll would go was totally broken.That means that velocity varied a lot between a short scroll and a long one. smoothScrollTo() always animated over 250ms on Android.Previously, it was using smoothScrollTo() for everything. I fixed the swipe-scrolling algorithm when I added snapToOffsets. Toggle options on/off with the top row of buttons, then try swiping left and right.īTW for NewSwipe the app seems to crash in native code when toggling snapToOffsets off □.Run yarn start and react-native run-android.Doesn't seem to be any combination that works in 0.57.0. I created identical repos for 0.56.1 and 0.57.0 with toggles to turn pagingEnabled, snapToInterval, snapToOffsets on/off. Please follow the guidelines for providing a MCVE: Include a code sample, share a project, or share an app that reproduces the issue using. ![]() finger moving left to right on the screen) but not in a controlled way. It also looks like you can scroll fast if swiping "back" (i.e. ![]() Now the slightest touch scrolls 1 or more pages (usually 2 for a 'normal' swipe) with a really slow animation and it's not possible to swipe through pages rapidly (swiping quickly just makes the animation slow down even more). It was possible to rapidly swipe through a set of pages with quick swipes. ![]() Previously swiping worked pretty much like ViewPagerAndroid and swiped a single page at a time if you swiped at least 50% of the screen width (not sure of exact figure), and the speed of the animation roughly matched the speed of the swipe. The changes to paging and snapping in horizontal scroll views appear to have totally broken the UX in android.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |