+1
-9
src/state/shell/minimal-mode.tsx
+1
-9
src/state/shell/minimal-mode.tsx
···
1
1
import React from 'react'
2
-
import {
3
-
cancelAnimation,
4
-
SharedValue,
5
-
useSharedValue,
6
-
withSpring,
7
-
} from 'react-native-reanimated'
2
+
import {SharedValue, useSharedValue, withSpring} from 'react-native-reanimated'
8
3
9
4
type StateContext = {
10
5
headerMode: SharedValue<number>
···
42
37
const setMode = React.useCallback(
43
38
(v: boolean) => {
44
39
'worklet'
45
-
// Cancel any existing animation
46
-
cancelAnimation(headerMode)
47
40
headerMode.set(() =>
48
41
withSpring(v ? 1 : 0, {
49
42
overshootClamping: true,
50
43
}),
51
44
)
52
-
cancelAnimation(footerMode)
53
45
footerMode.set(() =>
54
46
withSpring(v ? 1 : 0, {
55
47
overshootClamping: true,
-4
src/view/com/util/MainScrollProvider.tsx
-4
src/view/com/util/MainScrollProvider.tsx
···
1
1
import React, {useCallback, useEffect} from 'react'
2
2
import {NativeScrollEvent} from 'react-native'
3
3
import {
4
-
cancelAnimation,
5
4
interpolate,
6
5
makeMutable,
7
6
useSharedValue,
···
43
42
const setMode = React.useCallback(
44
43
(v: boolean) => {
45
44
'worklet'
46
-
cancelAnimation(headerMode)
47
45
headerMode.set(v ? V1.get() : V0.get())
48
46
},
49
47
[headerMode],
···
149
147
const newValue = clamp(startModeValue + dProgress, 0, 1)
150
148
if (newValue !== headerMode.get()) {
151
149
// Manually adjust the value. This won't be (and shouldn't be) animated.
152
-
// Cancel any any existing animation
153
-
cancelAnimation(headerMode)
154
150
headerMode.set(newValue)
155
151
}
156
152
} else {