RecyclerView nested issue with AppBarLayout

My activity contains AppBarLayout, provided by design library 23.0.1, it hides when scrolling up. I have a RecyclerView with each child containing a RecyclerView, basically a nested RecyclerView.

My problem is that when I touch any internal RecyclerView child and scroll up, the AppBar does not hide. However, if I put my finger in a different place (and not in the internal RecyclerView) and scroll, the application bar scrolls just fine. Why is this happening? I even tried to add control panel behavior for internal viewing of the recycler, but the application panel will scroll only when I touch another place and scroll.

Note. The internal recyclerview has a fixed set of elements that will be constantly visible, basically there is no scrolling in the recyclerview.

There is a similar question and the solution provided will be to intercept the touch of the internal recyclerview and transfer it to the view of the parent recycler. But this disables the children click events in the internal recycler scan, I do not want this.

+5
source share
1 answer

You need to set the nested scroll flag to false to view the internal recycler.

mSomeInnerRecyclerView.setNestedScrollingEnabled (false);

+5
source

Source: https://habr.com/ru/post/1233395/


All Articles