Skip to content
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

Merged
merged 4 commits into from
Jan 15, 2024
Merged

Conversation

samholmes
Copy link
Contributor

@samholmes samholmes commented Jan 12, 2024

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@paullinator
Copy link
Member

Is this tested on iOS and Android?

@samholmes
Copy link
Contributor Author

samholmes commented Jan 12, 2024

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 .

Copy link
Contributor

@swansontec swansontec left a 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.

sceneScrollContext.scrollMomentumEndEvent.value = nativeEvent
}
})
[]
Copy link
Contributor

@swansontec swansontec Jan 12, 2024

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])
Copy link
Contributor

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.
@samholmes samholmes enabled auto-merge January 15, 2024 19:08
@samholmes samholmes merged commit 9f361ac into develop Jan 15, 2024
2 checks passed
@samholmes samholmes deleted the sam/dynamic-header branch January 15, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants