feat: introduce header fade-in threshold #17
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces two new properties,
headerFadeInThresholdanddisableLargeHeaderFadeAnim. TheheaderFadeInThresholdallows you to define a number between 0 and 1, which represents the percentage of the large header's height, to be used to animate the smaller header in and out. If you set a smallerheaderFadeInThreshold, the LargeHeader will fade in earlier and may look weird (since the component essentially disappears in front of the user), hence whydisableLargeHeaderFadeAnimwas introduced.Motivation and Context
The reason this was introduced is because the header will fade in once the scroll container has passed the LargeHeader. The issue is that if you have a big LargeHeader component, you may want to fade in the header at an earlier time. These new properties allow you to achieve that.
How Has This Been Tested?
There are 2 examples that make use of this in the example application - the Twitter example and the new
ArbitraryYTransitionHeaderUsageScreen. See the attached video below for a showcase of the new feature.Types of changes
Checklist:
Screenshots
Screen.Recording.2023-06-28.at.10.42.31.PM.mov