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

CollapsingToolbarScaffold's body height is incorrect when restored from saved state with ExitUntilCollapsed scrolling strategy #95

Open
OlivierGenez opened this issue Oct 19, 2023 · 2 comments

Comments

@OlivierGenez
Copy link

Summary

When using the ExitUntilCollapsed scrolling strategy, the height of the CollapsingToolbarScaffold's body is calculated incorrectly when it is restored from saved state after being killed in the background.

Replication steps

  1. Update the sample app to use the ExitUntilCollapsed scrolling strategy
  2. Open the sample app
  3. Scroll all the way down to the bottom of the list
  4. Background the app
  5. Kill the app while in the background via ADB: adb shell am kill me.onebone.toolbar
  6. Reopen the app to trigger state restoration
  • Expected behaviour: the list is scrolled all the way to the bottom
  • Actual behaviour: the last few elements of the list are obfuscated and it is not possible to scroll further down to reveal them

Additional notes

The issue "fixes itself" if you scroll all the way up and then down again.

Root cause

Measuring the CollapsingToolbarScaffold's toolbar updates the CollapsingToolbarState, which CollapsingToolbarScaffold's body measurement constraints depend on. Therefore the toolbar must be measured before the body measurement constraints are calculated.

Screen recording

Screen_recording_20231019_214440.mp4
OlivierGenez added a commit to OlivierGenez/compose-collapsing-toolbar that referenced this issue Oct 19, 2023
ogenez-square pushed a commit to ogenez-square/compose-collapsing-toolbar that referenced this issue Oct 23, 2023
@datndGreensoft
Copy link

Hi there, I'm experiencing a similar issue. Do you think we could proceed with a release incorporating this change?

@AlexKnyazyk
Copy link

Any updates? same issue

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

No branches or pull requests

3 participants