mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
Merge \"Fix CollapsingToolbarLayout pinned views with insets\" into nyc-support-24.1-dev
am: 9e55ffc203 Change-Id: I8a4dbb9ee60468ff68024b81e2c4592c46039830 GitOrigin-RevId=497afd753b419ba61f44b548efbf92bb1a4b7375 PiperOrigin-RevId: 140564112
This commit is contained in:
parent
0240f57b2c
commit
c79ff658da
@ -234,14 +234,17 @@ public class CollapsingToolbarLayout extends FrameLayout {
|
||||
// Add an OnOffsetChangedListener if possible
|
||||
final ViewParent parent = getParent();
|
||||
if (parent instanceof AppBarLayout) {
|
||||
// Copy over from the ABL whether we should fit system windows
|
||||
ViewCompat.setFitsSystemWindows(this, ViewCompat.getFitsSystemWindows((View) parent));
|
||||
|
||||
if (mOnOffsetChangedListener == null) {
|
||||
mOnOffsetChangedListener = new OffsetUpdateListener();
|
||||
}
|
||||
((AppBarLayout) parent).addOnOffsetChangedListener(mOnOffsetChangedListener);
|
||||
}
|
||||
|
||||
// We're attached, so lets request an inset dispatch
|
||||
ViewCompat.requestApplyInsets(this);
|
||||
// We're attached, so lets request an inset dispatch
|
||||
ViewCompat.requestApplyInsets(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user