am 8e0b8093: am 551a28ad: am 39cfe79f: am a0e42834: Merge "Allow AppBarLayout to handle size changes" into lmp-mr1-ub-dev

* commit '8e0b80934b91b5398cd0a652fcd6316a7b98b472':
  Allow AppBarLayout to handle size changes

GitOrigin-RevId=d8bf9fa65716dd427e0ee2366802385185f23c4e

PiperOrigin-RevId: 140548869
This commit is contained in:
Chris Banes 2016-11-30 01:20:16 +00:00 committed by Travis Collins
parent c3c5e74e7a
commit f9009de091

View File

@ -1024,7 +1024,12 @@ public class AppBarLayout extends LinearLayout {
ViewCompat.setFitsSystemWindows(child, true);
}
final int height = parent.getHeight() - appBar.getMeasuredHeight()
int availableHeight = MeasureSpec.getSize(parentHeightMeasureSpec);
if (availableHeight == 0) {
// If the measure spec doesn't specify a size, use the current height
availableHeight = parent.getHeight();
}
final int height = availableHeight - appBar.getMeasuredHeight()
+ appBar.getTotalScrollRange();
final int heightMeasureSpec = MeasureSpec.makeMeasureSpec(height,
MeasureSpec.AT_MOST);