-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Hide/show header and footer without re-renders, take two #1849
Conversation
const setContext = React.createContext<SetContext>((_: boolean) => {}) | ||
|
||
export function Provider({children}: React.PropsWithChildren<{}>) { | ||
const [state, setState] = React.useState(false) | ||
const mode = useSharedValue(false) | ||
const setMode = React.useCallback( |
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.
I kept the setter so that writes are centralized and easy to trace. Technically code can screw around with .value
but we can catch that in review.
style={[ | ||
styles.prompt, | ||
fabMinimalShellTransform, |
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.
We could rename this since this isn't technically FAB, I think it's fine though.
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.
Nice
@@ -38,7 +38,6 @@ export const FeedsTabBar = observer(function FeedsTabBarImpl( | |||
pal.border, | |||
styles.tabBar, | |||
headerMinimalShellTransform, | |||
minimalShellMode && styles.disabled, |
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.
I moved these into the animated styles so that we don't expose the raw value.
Re-doing the fix from #1691 which regressed in #1676.
This time it's easier to fix at the source. Now that we've moved the shell state into React, I've changed the source of truth to be an Animated value. We can change it directly and make all animations derived from it.
In the future, we should also change this to update with scroll but for now I left it discrete.
Verification
Before
before.mov
After
after.mov
Impact
Low/mid-range Android.
Before
IMG_0816.mov
After
IMG_0819.mov
Test Plan
Verified these elements hide/show as expected: