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:
Chris Banes 2016-11-30 05:03:35 +00:00 committed by Travis Collins
parent 0240f57b2c
commit c79ff658da

View File

@ -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