Make shell hide/show animation smoother
This commit is contained in:
@@ -7,21 +7,22 @@ export function useMinimalShellMode() {
|
|||||||
const store = useStores()
|
const store = useStores()
|
||||||
const minimalShellInterp = useAnimatedValue(0)
|
const minimalShellInterp = useAnimatedValue(0)
|
||||||
const footerMinimalShellTransform = {
|
const footerMinimalShellTransform = {
|
||||||
transform: [{translateY: Animated.multiply(minimalShellInterp, 100)}],
|
opacity: Animated.subtract(1, minimalShellInterp),
|
||||||
|
transform: [{translateY: Animated.multiply(minimalShellInterp, 50)}],
|
||||||
}
|
}
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (store.shell.minimalShellMode) {
|
if (store.shell.minimalShellMode) {
|
||||||
Animated.timing(minimalShellInterp, {
|
Animated.timing(minimalShellInterp, {
|
||||||
toValue: 1,
|
toValue: 1,
|
||||||
duration: 100,
|
duration: 150,
|
||||||
useNativeDriver: true,
|
useNativeDriver: true,
|
||||||
isInteraction: false,
|
isInteraction: false,
|
||||||
}).start()
|
}).start()
|
||||||
} else {
|
} else {
|
||||||
Animated.timing(minimalShellInterp, {
|
Animated.timing(minimalShellInterp, {
|
||||||
toValue: 0,
|
toValue: 0,
|
||||||
duration: 100,
|
duration: 150,
|
||||||
useNativeDriver: true,
|
useNativeDriver: true,
|
||||||
isInteraction: false,
|
isInteraction: false,
|
||||||
}).start()
|
}).start()
|
||||||
|
|||||||
@@ -24,13 +24,14 @@ export const FeedsTabBar = observer(function FeedsTabBarImpl(
|
|||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
Animated.timing(interp, {
|
Animated.timing(interp, {
|
||||||
toValue: store.shell.minimalShellMode ? 1 : 0,
|
toValue: store.shell.minimalShellMode ? 1 : 0,
|
||||||
duration: 100,
|
duration: 150,
|
||||||
useNativeDriver: true,
|
useNativeDriver: true,
|
||||||
isInteraction: false,
|
isInteraction: false,
|
||||||
}).start()
|
}).start()
|
||||||
}, [interp, store.shell.minimalShellMode])
|
}, [interp, store.shell.minimalShellMode])
|
||||||
const transform = {
|
const transform = {
|
||||||
transform: [{translateY: Animated.multiply(interp, -100)}],
|
opacity: Animated.subtract(1, interp),
|
||||||
|
transform: [{translateY: Animated.multiply(interp, -50)}],
|
||||||
}
|
}
|
||||||
|
|
||||||
const brandBlue = useColorSchemeStyle(s.brandBlue, s.blue3)
|
const brandBlue = useColorSchemeStyle(s.brandBlue, s.blue3)
|
||||||
|
|||||||
Reference in New Issue
Block a user