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:
@@ -90,6 +90,7 @@ export function HorzSwipe({
|
|||||||
// swiping right
|
// swiping right
|
||||||
(diffX < 0 && !canSwipeRight)
|
(diffX < 0 && !canSwipeRight)
|
||||||
) {
|
) {
|
||||||
|
panX.setValue(0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,6 +120,7 @@ export function HorzSwipe({
|
|||||||
toValue: final,
|
toValue: final,
|
||||||
duration: 100,
|
duration: 100,
|
||||||
useNativeDriver,
|
useNativeDriver,
|
||||||
|
isInteraction: false,
|
||||||
}).start(() => {
|
}).start(() => {
|
||||||
onSwipeEnd?.(final)
|
onSwipeEnd?.(final)
|
||||||
panX.flattenOffset()
|
panX.flattenOffset()
|
||||||
@@ -130,6 +132,7 @@ export function HorzSwipe({
|
|||||||
toValue: 0,
|
toValue: 0,
|
||||||
duration: 100,
|
duration: 100,
|
||||||
useNativeDriver,
|
useNativeDriver,
|
||||||
|
isInteraction: false,
|
||||||
}).start(() => {
|
}).start(() => {
|
||||||
panX.flattenOffset()
|
panX.flattenOffset()
|
||||||
panX.setValue(0)
|
panX.setValue(0)
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ export const MobileShell: React.FC = observer(() => {
|
|||||||
/>
|
/>
|
||||||
<View style={[styles.innerContainer, {paddingTop: safeAreaInsets.top}]}>
|
<View style={[styles.innerContainer, {paddingTop: safeAreaInsets.top}]}>
|
||||||
<HorzSwipe
|
<HorzSwipe
|
||||||
distThresholdDivisor={1.5}
|
distThresholdDivisor={2.5}
|
||||||
useNativeDriver
|
useNativeDriver
|
||||||
panX={swipeGestureInterp}
|
panX={swipeGestureInterp}
|
||||||
swipeEnabled
|
swipeEnabled
|
||||||
|
|||||||
Reference in New Issue
Block a user