Open bgogetap opened 7 years ago
Currently the workaround for this is to wrap the RecyclerView in a FrameLayout.
This fix is on my radar, but slightly low priority given the simple (though undesired because of extra view nesting) fix.
To use the workaround suggested above, you also need move the appbar_scrolling_view_behavior from the RecyclerView to the FrameLayout so it will be positioned below the AppBarLayout properly. An easy thing to remember to do, but I forgot so I thought I'd help anyone else out who comes across it.
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</FrameLayout>
Could you please fix this? Yes, the workaround works, but please be so kind to fix this, it happens again and again that somebody forgets/doesn't know that this is needed.
If a RecyclerView is nested inside a CoordinatorLayout, the sticky header may not be stuck at the right position depending on insets applied.
Reproduction steps: