[CollapsingToolbarLayout] Scroll state not preserved when recreating view and exitUntilCollapsed
scroll flag is set
#3473
Labels
exitUntilCollapsed
scroll flag is set
#3473
Description:
I spotted multiple mentions of the same issue, i.e. here: #1019 (comment), so I assume this is not new, but since I couldn't find a proper bug report I'm creating a new one.
The issue is:
CollapsingToolbarLayout
withapp:layout_scrollFlags="scroll|exitUntilCollapsed"
doesn't preserve its scroll state when the view is destroyed and then recreated (i.e. when navigating back between fragments)Expected behavior: Screenshots and/or description of expected behavior
The
CollapsingToolbarLayout
scroll state is exactly the same as it was before leaving the screen.Expected
Screen.Recording.2023-07-10.at.20.38.19.mov
Actual
Screen.Recording.2023-07-10.at.20.34.58.mov
(the "should be hidden" label should not be visible. It is because
CollapsingToolbar
restores in an "expanded" state)Source code:
My current repro is:
but the crucial part is the
exitUntilCollapsed
.❗ Interesting thing is setting
minHeight
totipText
TextView seems to restore proper behavior. This is very confusing 😅Minimal sample app repro:
Full project: https://github.com/mateuszkwiecinski/collapsing_toolbar_doesnt_work
./gradlew installDebug
Android API version:
28, 31, 33
Material Library version:
1.11.0-alpha01
,1.9.0
Device:
Android emulator
The text was updated successfully, but these errors were encountered: