Loading core/java/android/widget/Toolbar.java +15 −15 Original line number Diff line number Diff line Loading @@ -1161,6 +1161,21 @@ public class Toolbar extends ViewGroup { childState = combineMeasuredStates(childState, mLogoView.getMeasuredState()); } final int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { final View child = getChildAt(i); final LayoutParams lp = (LayoutParams) child.getLayoutParams(); if (lp.mViewType != LayoutParams.CUSTOM || !shouldLayout(child)) { // We already got all system views above. Skip them and GONE views. continue; } width += measureChildCollapseMargins(child, widthMeasureSpec, width, heightMeasureSpec, 0, collapsingMargins); height = Math.max(height, child.getMeasuredHeight() + getVerticalMargins(child)); childState = combineMeasuredStates(childState, child.getMeasuredState()); } int titleWidth = 0; int titleHeight = 0; final int titleVertMargins = mTitleMarginTop + mTitleMarginBottom; Loading @@ -1186,21 +1201,6 @@ public class Toolbar extends ViewGroup { width += titleWidth; height = Math.max(height, titleHeight); final int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { final View child = getChildAt(i); final LayoutParams lp = (LayoutParams) child.getLayoutParams(); if (lp.mViewType != LayoutParams.CUSTOM || !shouldLayout(child)) { // We already got all system views above. Skip them and GONE views. continue; } width += measureChildCollapseMargins(child, widthMeasureSpec, width, heightMeasureSpec, 0, collapsingMargins); height = Math.max(height, child.getMeasuredHeight() + getVerticalMargins(child)); childState = combineMeasuredStates(childState, child.getMeasuredState()); } // Measurement already took padding into account for available space for the children, // add it in for the final size. width += getPaddingLeft() + getPaddingRight(); Loading Loading
core/java/android/widget/Toolbar.java +15 −15 Original line number Diff line number Diff line Loading @@ -1161,6 +1161,21 @@ public class Toolbar extends ViewGroup { childState = combineMeasuredStates(childState, mLogoView.getMeasuredState()); } final int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { final View child = getChildAt(i); final LayoutParams lp = (LayoutParams) child.getLayoutParams(); if (lp.mViewType != LayoutParams.CUSTOM || !shouldLayout(child)) { // We already got all system views above. Skip them and GONE views. continue; } width += measureChildCollapseMargins(child, widthMeasureSpec, width, heightMeasureSpec, 0, collapsingMargins); height = Math.max(height, child.getMeasuredHeight() + getVerticalMargins(child)); childState = combineMeasuredStates(childState, child.getMeasuredState()); } int titleWidth = 0; int titleHeight = 0; final int titleVertMargins = mTitleMarginTop + mTitleMarginBottom; Loading @@ -1186,21 +1201,6 @@ public class Toolbar extends ViewGroup { width += titleWidth; height = Math.max(height, titleHeight); final int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { final View child = getChildAt(i); final LayoutParams lp = (LayoutParams) child.getLayoutParams(); if (lp.mViewType != LayoutParams.CUSTOM || !shouldLayout(child)) { // We already got all system views above. Skip them and GONE views. continue; } width += measureChildCollapseMargins(child, widthMeasureSpec, width, heightMeasureSpec, 0, collapsingMargins); height = Math.max(height, child.getMeasuredHeight() + getVerticalMargins(child)); childState = combineMeasuredStates(childState, child.getMeasuredState()); } // Measurement already took padding into account for available space for the children, // add it in for the final size. width += getPaddingLeft() + getPaddingRight(); Loading