Fixes to navigation swipes (#129)

* Nav swipe: increase the distance traveled in response to gesture movement.

This causes swipes to feel faster and more responsive.

* Fix: fully clamp the swipe against the edge

* Improve the performance of swipes by skipping the interaction manager
This commit is contained in:
Paul Frazee
2023-02-01 11:13:28 -06:00
committed by GitHub
parent ae6b5f0d20
commit 7b802da7b5
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -90,6 +90,7 @@ export function HorzSwipe({
// swiping right
(diffX < 0 && !canSwipeRight)
) {
panX.setValue(0)
return
}
@@ -119,6 +120,7 @@ export function HorzSwipe({
toValue: final,
duration: 100,
useNativeDriver,
isInteraction: false,
}).start(() => {
onSwipeEnd?.(final)
panX.flattenOffset()
@@ -130,6 +132,7 @@ export function HorzSwipe({
toValue: 0,
duration: 100,
useNativeDriver,
isInteraction: false,
}).start(() => {
panX.flattenOffset()
panX.setValue(0)
+1 -1
View File
@@ -353,7 +353,7 @@ export const MobileShell: React.FC = observer(() => {
/>
<View style={[styles.innerContainer, {paddingTop: safeAreaInsets.top}]}>
<HorzSwipe
distThresholdDivisor={1.5}
distThresholdDivisor={2.5}
useNativeDriver
panX={swipeGestureInterp}
swipeEnabled