Search code examples
androidandroid-layoutandroid-design-libraryandroid-collapsingtoolbarlayout

Single fling to uncollapse Android's CollapsingToolbarLayout


I have implemented a CollapsingToolbarLayout with a parallax view.

When I scroll back up the RecyclerView in one continuous scroll it uncollapses the CollapsingToolbarLayout.

But when I issue a 'fling' the nested scroll view, it stops at the top of the nested scroll view. You have to fling again to uncollapse the CollapsingToolbarLayout,

The ScrollingActivity template in Android Studio 2.0 demonstrates this problem. And Chris Bain's Cheesecake project, in the detail view, demonstrates the same.

However, neither Google Play nor Spotify exhibit this problem in the 'view app' and 'playlist' views respectively. In a single fling, they will scroll to the top of the nested scroll view and uncollapse the toolbar.

Is this possible with the design library elements?

Edit: Ian has noted this reported bug. Please star it and post any work around you may have.


Solution

  • Android Support Library 26.0.0-beta2 fixes this issue! See here. It tested it and it is working fine!