Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collapsing toolbar layout doesn't work when using horizontal recycler view inside nested scroll view

I have some problems with Collapsing Toolbar. I have following layout structure

<CoordinatorLayout>
    <AppbarLayout>
        <CollapsingToolbar>
    <NestedScrollView>
        <HorizontalRecyclerView>
    </NestedScrollView>
</CoordinatorLayout>

The problem occurs only when I'am trying to scroll my NestedScrollView touching the HorizontalRecyclerView. In that case CollapsingToolbar doesn't collaps. Just AppbarLayout stay on it's place and NestedScrollView scroll under it. I've attached a video, where everything is clear. Can anyone explain the problem? Thanks.

like image 902
Raman Branavitski Avatar asked Mar 06 '18 09:03

Raman Branavitski


1 Answers

The problem can be solved by adding setNestedScrollingEnabled(false) to inner HorizontalRecyclerView.

like image 82
Xenolion Avatar answered Nov 13 '22 07:11

Xenolion