CollapsingToolbarScaffold's body height is incorrect when restored from saved state with `ExitUntilCollapsed` scrolling strategy
Opened this issue · 2 comments
OlivierGenez commented
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
- Update the sample app to use the
ExitUntilCollapsed
scrolling strategy - Open the sample app
- Scroll all the way down to the bottom of the list
- Background the app
- Kill the app while in the background via ADB:
adb shell am kill me.onebone.toolbar
- 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
datndGreensoft commented
Hi there, I'm experiencing a similar issue. Do you think we could proceed with a release incorporating this change?
AlexKnyazyk commented
Any updates? same issue