Using static fragments with the CoordinatorLayout of the new design support library
I've been experimenting with the new library suggestions and I just can't wrap my setup around myself the way I want.
I am taking this example code as a reference: https://github.com/chrisbanes/cheesesquare
I was able to add a static slice (contains some FrameLayout with recyclerView and additional empty views) as a child of the CoordinatorLayout, which works as expected when scrolling through the (ugly) recycler view inside it.
Working gist and result:
I am only trying to add one additional CardView above my fragment, which should also have the same effect on the toolbar when dragged upwards. I tried adding them to LinearLayout inside NestedScrollView along with various other combinations, none of which were successful. Whenever I click on a card, they move and never again fall into place. Moreover, dragging the map still disappears from the toolbar, but nothing else happens.
Broken gist and result:
source to share
I faced another issue using CoordinatorLayout
as container for my fragments: https://code.google.com/p/android/issues/detail?id=179600
Seems to CoordinatorLayout
have a number of problems with this use case. The solution will most likely be to use FrameLayout
to contain your fragment and then put CoordinatorLayout
as the top-level container of your fragment UI.
source to share