mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-04 00:44:14 +08:00
There was an issue when navigating back to a fragment with a CollapsingToolbarLayout, where the items at bottom of the CollapsingToolbarLayout's scrolling sibling view were cut off and couldn't be reached by scrolling. It had to do with the minimum height of the CollapsingToolbarLayout not being set at the point when HeaderScrollingViewBehavior calculates the height of the scrolling view in its onMeasureChild() method. The onMeasureChild() method factors in AppBarLayout#getTotalScrollRange which is dependent on the minimum height of the CollapsingToolbarLayout, so moving the CollapsingToolbarLayout's setMinimumHeight() from its onLayout() to its onMeasure() fixes the issue by making the minimum height available earlier. Resolves https://github.com/material-components/material-components-android/issues/1558 Resolves https://github.com/material-components/material-components-android/issues/846 Resolves https://github.com/material-components/material-components-android/issues/1070 Resolves https://github.com/material-components/material-components-android/issues/1198 PiperOrigin-RevId: 337309314