3

I've encountered an issue where a fragment with a CoordinatorLayout and RecyclerView doesn't allow scrolling to reveal all the content (only part of it) after a fragment transaction.

More specifically I have the following components:

  1. An activity (ScrollingActivity.java) that its layout only has a FrameLayout that serves as a fragments container.
  2. Page1Fragment - a fragment that contains a simple "Next" button that upon click performs a fragment transaction and shows Page2Fragment.
  3. Page2Fragment - a fragment with a CoordinatorLayout at the top and a RecyclerView that displays a long content.

The behavior I'm witnessing that is that in Page2Fragment the content doesn't scroll to the bottom, specifically at the end there should be an "THE END!" string.

This can be seen in this video: https://github.com/ifeins/sandbox2/blob/master/screencaps/page2-scroll-not-working.gif

What's surprising is that if I change ScrollingActivity to displays Page2Fragment in onCreate (instead of Page1Fragment) then the content scrolls correctly as can be seen in this video: https://github.com/ifeins/sandbox2/blob/master/screencaps/page2-scroll-working.gif

Not sure why this issue occurs, does anybody have any clue?

I've created a sample project to demonstrate this issue: https://github.com/ifeins/sandbox2/

ifeins
  • 869
  • 1
  • 9
  • 20

0 Answers0