Alt use of AppBarLayout - Possible to mimic play sotre behavior on "scroll up"/"scroll to top"
See original GitHub issueI was trying to use AppBarLayout
like this:
<AppBarLayoutAndroid
layoutWidthAndroid="matchParent"
layoutHeightAndroid="wrapContent"
>
{/* Elements directily in <AppBarLayoutAndroid> can have an */}
{/* additional scrollFlagsAndroid prop. This must be an array */}
{/* of strings, specifying the scroll flags of this element. */}
{/* see https://goo.gl/RiAyDX for reference. */}
<View scrollFlagsAndroid={['scroll']}>
<Text style={{ fontSize: 18 }}>Hi, I will be collapsed when scrolling down, and show again when scrolled to top.</Text>
</View>
<View scrollFlagsAndroid={['scroll', 'enterAlways']}>
<Text style={{ fontSize: 18 }}>Hi, I will be collapsed when scrolling down, and show again when scrolling up.</Text>
</View>
<View scrollFlagsAndroid={[]}>
<Text style={{ fontSize: 18 }}>Hi, I will not be collapsed.</Text>
</View>
</AppBarLayoutAndroid>
From this discontinued repo - https://github.com/zetavg/react-native-android-design-support#coordinatorlayout
I was hoping to mimic the playstore behavior:
HD screen recording: https://gfycat.com/ShockingQuickGalapagosdove
GIF screen recording:
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
AppBarLayout scroll behavior with layout_scrollFlags - Medium
Basically, app:layout_scrollFlags attribute must have one of the 5 values (or a few of them combined). In my examples I use a Toolbar...
Read more >AppBarLayout with scrolling behavior alternative/ sticky view ...
I wanted to use RecyclerView with multiple view types and treat the views in group a and b above as different ViewHolders and...
Read more >Handling Scrolls with CoordinatorLayout - CodePath Cliffnotes
Any scroll events to the RecyclerView should trigger changes to the AppBarLayout layout or any views contained within it. Scroll events in the...
Read more >AppBarLayout | Android Developers
AppBarLayout is a vertical LinearLayout which implements many of the features of material designs app bar concept, namely scrolling gestures ...
Read more >App bars: top - Material Design
The top app bar displays information and actions relating to the current view. ... Applying scrolling behavior to the prominent top app bar....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, you need to enable the following
scrollFlags
:SCROLL_FLAG_SCROLL
|SCROLL_FLAG_ENTER_ALWAYS_COLLAPSED
|SCROLL_FLAG_ENTER_ALWAYS
Here’s a practical example.
Let me know if you got it.
Thanks for sharing it.
I just saw they move to a JS solution, sadly 😞
This is one those things that would play nicely inside a native navigation solution, such as airbnb native-navigation, but that’s not something easy to do.
But anyway, i still have my doubts about how that could works, but i will give a try, thanks for sharing it.