-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add scroll-based animation to HeaderBackground #4706
Conversation
Is this tested on iOS and Android? |
Yes, it's tested on both iOS and Android. I haven't tested on tablet or small screen admittedly . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good.
src/state/SceneScrollState.tsx
Outdated
sceneScrollContext.scrollMomentumEndEvent.value = nativeEvent | ||
} | ||
}) | ||
[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gets removed again 2 commits later. Was that a mistake?
opacity: 0 | ||
}, | ||
useAnimatedStyle(() => ({ | ||
opacity: interpolate(scrollY.value, [0, MAX_TAB_BAR_HEIGHT], [0, 1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: MAX_TAB_BAR_HEIGHT
might be the wrong constant to use in the header. Do we have a header height constant somewhere?
I hope this means we have static handlers and don't thrash the event handlers unnecessarily, but who knows really what is going on behind the scenes with reanimated since they'll probably do fancy optimizations and tricks that aren't react-kosher (I've seen things).
This required a significant refactor and improvement to global scroll state handling for each scene and component which uses the `useSceneScrollHandler` hook.
c1aad19
to
d1e63d2
Compare
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneRequirements
If you have made any visual changes to the GUI. Make sure you have: