I made collapsible toolbar on Activity, but there is one problem.
Screen contains RecyclerView that has multiple layout items, and one of them is another RecyclerView that has horizontal scroll. When main recycler is scrolled, toolbar doesn't expand or collapse when scroll started on that nested recycler, but on other views it's working as it should.
To make it easier to understand: when I first touch screen on position where there is nested RecyclerView and try to scroll up and down, there is no collapsing or expanding of toolbar.
Any idea what might be causing that issue and how to fix it?
I only needed to set recyclerView.setNestedScrollingEnabled(false)
for the nested RecyclerView
to work.
Thanks to Reddit user in this thread: Toolbar not collapsing with nested RecyclerView
For those who would like the same thing in Kotlin is:
recyclerView.isNestedScrollingEnabled = false
And for XML it is this property in RecyclerView but only for API 21 and higher:
android:nestedScrollingEnabled="false"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With