Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demonstrating bug when using collapsing toolbar in dialog #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pyricau
Copy link

@pyricau pyricau commented Oct 6, 2015

This PR adds two menu items, Broken Dialog and Fancy Dialog. Those two open a dialog with an inflating view containing a coordinator layout with a collapsing toolbar with exitUntilCollapsed. Fancy Dialog uses a hack to fix the weird problem.

In the screenshot below, you'll notice blank space below the recycler view. This was totally unexpected to me. That only occurs if the CollapsingToolbarLayout is using exitUntilCollapsed.

I also added an onMeasure() count to the recycler view. It's called 36 times. And 28 in the "not broken" case, when I remove exitUntilCollapsed or when I display the Fancy Dialog

The dialog is in wrap_content for height, so it measures with an AT_MOST height measure spec. I'm not sure where this remeasuring craziness comes from, but it might be the dialog trying to figure out how much it has to stretch. The CoordinatorLayout somehow decides that it doesn't need all the space the dialog can offer after all, and sets its height to the available height minus an empty space that is the height of the toolbar.

My way around this problem was to change the CoordinatorLayout heightMeasureSpec to be in EXACTLY mode instead of AT_MOST.

glhf

screenshot-2015-10-06_05 21 41 25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant