Source/sources/android/support/p003v7/widget/ActionMenuView.java
public void onLayout(boolean changed, int left, int top, int right, int bottom) {
        int r;
        int l;
        if (!this.mFormatItems) {
            super.onLayout(changed, left, top, right, bottom);
            return;
        }
        int childCount = getChildCount();
        int midVertical = (bottom - top) / 2;
        int dividerWidth = getDividerWidth();
        int nonOverflowWidth = 0;
        int nonOverflowCount = 0;
        int widthRemaining = ((right - left) - getPaddingRight()) - getPaddingLeft();
        boolean hasOverflow = false;
        boolean isLayoutRtl = ViewUtils.isLayoutRtl(this);
        for (int i = 0; i < childCount; i++) {
            View v = getChildAt(i);
            if (v.getVisibility() != 8) {
                LayoutParams p = (LayoutParams) v.getLayoutParams();
                if (p.isOverflowButton) {
                    int overflowWidth = v.getMeasuredWidth();
                    if (hasSupportDividerBeforeChildAt(i)) {
                        overflowWidth += dividerWidth;
                    }
                    int height = v.getMeasuredHeight();
                    if (isLayoutRtl) {
                        l = getPaddingLeft() + p.leftMargin;
                        r = l + overflowWidth;
                    } else {
                        r = (getWidth() - getPaddingRight()) - p.rightMargin;
                        l = r - overflowWidth;
                    }
                    int t = midVertical - (height / 2);
                    v.layout(l, t, r, t + height);
                    widthRemaining -= overflowWidth;
                    hasOverflow = true;
                } else {
                    int size = v.getMeasuredWidth() + p.leftMargin + p.rightMargin;
                    nonOverflowWidth += size;
                    widthRemaining -= size;
                    if (hasSupportDividerBeforeChildAt(i)) {
                        nonOverflowWidth += dividerWidth;
                    }
                    nonOverflowCount++;
                }
            }
        }
        if (childCount != 1 || hasOverflow) {
            int spacerCount = nonOverflowCount - (hasOverflow ? 0 : 1);
            int spacerSize = Math.max(0, spacerCount > 0 ? widthRemaining / spacerCount : 0);
            if (isLayoutRtl) {
                int startRight = getWidth() - getPaddingRight();
                for (int i2 = 0; i2 < childCount; i2++) {
                    View v2 = getChildAt(i2);
                    LayoutParams lp = (LayoutParams) v2.getLayoutParams();
                    if (v2.getVisibility() != 8 && !lp.isOverflowButton) {
                        int startRight2 = startRight - lp.rightMargin;
                        int width = v2.getMeasuredWidth();
                        int height2 = v2.getMeasuredHeight();
                        int t2 = midVertical - (height2 / 2);
                        v2.layout(startRight2 - width, t2, startRight2, t2 + height2);
                        startRight = startRight2 - ((lp.leftMargin + width) + spacerSize);
                    }
                }
                return;
            }
            int startLeft = getPaddingLeft();
            for (int i3 = 0; i3 < childCount; i3++) {
                View v3 = getChildAt(i3);
                LayoutParams lp2 = (LayoutParams) v3.getLayoutParams();
                if (v3.getVisibility() != 8 && !lp2.isOverflowButton) {
                    int startLeft2 = startLeft + lp2.leftMargin;
                    int width2 = v3.getMeasuredWidth();
                    int height3 = v3.getMeasuredHeight();
                    int t3 = midVertical - (height3 / 2);
                    v3.layout(startLeft2, t3, startLeft2 + width2, t3 + height3);
                    startLeft = startLeft2 + lp2.rightMargin + width2 + spacerSize;
                }
            }
            return;
        }
        View v4 = getChildAt(0);
        int width3 = v4.getMeasuredWidth();
        int height4 = v4.getMeasuredHeight();
        int l2 = ((right - left) / 2) - (width3 / 2);
        int t4 = midVertical - (height4 / 2);
        v4.layout(l2, t4, l2 + width3, t4 + height4);
    }
/* access modifiers changed from: protected */
access modifiers changed from: protected
access modifiers changed from : protected
public void onLayout(boolean changed, int left, int top, int right, int bottom) {
        int r;
        int l;
        if (!this.mFormatItems) {
            super.onLayout(changed, left, top, right, bottom);
            return;
        }
        int childCount = getChildCount();
        int midVertical = (bottom - top) / 2;
        int dividerWidth = getDividerWidth();
        int nonOverflowWidth = 0;
        int nonOverflowCount = 0;
        int widthRemaining = ((right - left) - getPaddingRight()) - getPaddingLeft();
        boolean hasOverflow = false;
        boolean isLayoutRtl = ViewUtils.isLayoutRtl(this);
        for (int i = 0; i < childCount; i++) {
            View v = getChildAt(i);
            if (v.getVisibility() != 8) {
                LayoutParams p = (LayoutParams) v.getLayoutParams();
                if (p.isOverflowButton) {
                    int overflowWidth = v.getMeasuredWidth();
                    if (hasSupportDividerBeforeChildAt(i)) {
                        overflowWidth += dividerWidth;
                    }
                    int height = v.getMeasuredHeight();
                    if (isLayoutRtl) {
                        l = getPaddingLeft() + p.leftMargin;
                        r = l + overflowWidth;
                    } else {
                        r = (getWidth() - getPaddingRight()) - p.rightMargin;
                        l = r - overflowWidth;
                    }
                    int t = midVertical - (height / 2);
                    v.layout(l, t, r, t + height);
                    widthRemaining -= overflowWidth;
                    hasOverflow = true;
                } else {
                    int size = v.getMeasuredWidth() + p.leftMargin + p.rightMargin;
                    nonOverflowWidth += size;
                    widthRemaining -= size;
                    if (hasSupportDividerBeforeChildAt(i)) {
                        nonOverflowWidth += dividerWidth;
                    }
                    nonOverflowCount++;
                }
            }
        }
        if (childCount != 1 || hasOverflow) {
            int spacerCount = nonOverflowCount - (hasOverflow ? 0 : 1);
            int spacerSize = Math.max(0, spacerCount > 0 ? widthRemaining / spacerCount : 0);
            if (isLayoutRtl) {
                int startRight = getWidth() - getPaddingRight();
                for (int i2 = 0; i2 < childCount; i2++) {
                    View v2 = getChildAt(i2);
                    LayoutParams lp = (LayoutParams) v2.getLayoutParams();
                    if (v2.getVisibility() != 8 && !lp.isOverflowButton) {
                        int startRight2 = startRight - lp.rightMargin;
                        int width = v2.getMeasuredWidth();
                        int height2 = v2.getMeasuredHeight();
                        int t2 = midVertical - (height2 / 2);
                        v2.layout(startRight2 - width, t2, startRight2, t2 + height2);
                        startRight = startRight2 - ((lp.leftMargin + width) + spacerSize);
                    }
                }
                return;
            }
            int startLeft = getPaddingLeft();
            for (int i3 = 0; i3 < childCount; i3++) {
                View v3 = getChildAt(i3);
                LayoutParams lp2 = (LayoutParams) v3.getLayoutParams();
                if (v3.getVisibility() != 8 && !lp2.isOverflowButton) {
                    int startLeft2 = startLeft + lp2.leftMargin;
                    int width2 = v3.getMeasuredWidth();
                    int height3 = v3.getMeasuredHeight();
                    int t3 = midVertical - (height3 / 2);
                    v3.layout(startLeft2, t3, startLeft2 + width2, t3 + height3);
                    startLeft = startLeft2 + lp2.rightMargin + width2 + spacerSize;
                }
            }
            return;
        }
        View v4 = getChildAt(0);
        int width3 = v4.getMeasuredWidth();
        int height4 = v4.getMeasuredHeight();
        int l2 = ((right - left) / 2) - (width3 / 2);
        int t4 = midVertical - (height4 / 2);
        v4.layout(l2, t4, l2 + width3, t4 + height4);
    }
public void onLayout ( boolean changed , int left , int top , int right , int bottom ) { int r ; int l ; if ( ! this . mFormatItems ) { super . onLayout ( changed , left , top , right , bottom ) ; return ; } int childCount = getChildCount ( ) ; int midVertical = ( bottom - top ) / 2 ; int dividerWidth = getDividerWidth ( ) ; int nonOverflowWidth = 0 ; int nonOverflowCount = 0 ; int widthRemaining = ( ( right - left ) - getPaddingRight ( ) ) - getPaddingLeft ( ) ; boolean hasOverflow = false ; boolean isLayoutRtl = ViewUtils . isLayoutRtl ( this ) ; for ( int i = 0 ; i < childCount ; i ++ ) { View v = getChildAt ( i ) ; if ( v . getVisibility ( ) != 8 ) { LayoutParams p = ( LayoutParams ) v . getLayoutParams ( ) ; if ( p . isOverflowButton ) { int overflowWidth = v . getMeasuredWidth ( ) ; if ( hasSupportDividerBeforeChildAt ( i ) ) { overflowWidth += dividerWidth ; } int height = v . getMeasuredHeight ( ) ; if ( isLayoutRtl ) { l = getPaddingLeft ( ) + p . leftMargin ; r = l + overflowWidth ; } else { r = ( getWidth ( ) - getPaddingRight ( ) ) - p . rightMargin ; l = r - overflowWidth ; } int t = midVertical - ( height / 2 ) ; v . layout ( l , t , r , t + height ) ; widthRemaining -= overflowWidth ; hasOverflow = true ; } else { int size = v . getMeasuredWidth ( ) + p . leftMargin + p . rightMargin ; nonOverflowWidth += size ; widthRemaining -= size ; if ( hasSupportDividerBeforeChildAt ( i ) ) { nonOverflowWidth += dividerWidth ; } nonOverflowCount ++ ; } } } if ( childCount != 1 || hasOverflow ) { int spacerCount = nonOverflowCount - ( hasOverflow ? 0 : 1 ) ; int spacerSize = Math . max ( 0 , spacerCount > 0 ? widthRemaining / spacerCount : 0 ) ; if ( isLayoutRtl ) { int startRight = getWidth ( ) - getPaddingRight ( ) ; for ( int i2 = 0 ; i2 < childCount ; i2 ++ ) { View v2 = getChildAt ( i2 ) ; LayoutParams lp = ( LayoutParams ) v2 . getLayoutParams ( ) ; if ( v2 . getVisibility ( ) != 8 && ! lp . isOverflowButton ) { int startRight2 = startRight - lp . rightMargin ; int width = v2 . getMeasuredWidth ( ) ; int height2 = v2 . getMeasuredHeight ( ) ; int t2 = midVertical - ( height2 / 2 ) ; v2 . layout ( startRight2 - width , t2 , startRight2 , t2 + height2 ) ; startRight = startRight2 - ( ( lp . leftMargin + width ) + spacerSize ) ; } } return ; } int startLeft = getPaddingLeft ( ) ; for ( int i3 = 0 ; i3 < childCount ; i3 ++ ) { View v3 = getChildAt ( i3 ) ; LayoutParams lp2 = ( LayoutParams ) v3 . getLayoutParams ( ) ; if ( v3 . getVisibility ( ) != 8 && ! lp2 . isOverflowButton ) { int startLeft2 = startLeft + lp2 . leftMargin ; int width2 = v3 . getMeasuredWidth ( ) ; int height3 = v3 . getMeasuredHeight ( ) ; int t3 = midVertical - ( height3 / 2 ) ; v3 . layout ( startLeft2 , t3 , startLeft2 + width2 , t3 + height3 ) ; startLeft = startLeft2 + lp2 . rightMargin + width2 + spacerSize ; } } return ; } View v4 = getChildAt ( 0 ) ; int width3 = v4 . getMeasuredWidth ( ) ; int height4 = v4 . getMeasuredHeight ( ) ; int l2 = ( ( right - left ) / 2 ) - ( width3 / 2 ) ; int t4 = midVertical - ( height4 / 2 ) ; v4 . layout ( l2 , t4 , l2 + width3 , t4 + height4 ) ; }
access modifiers changed from: protected
access modifiers changed from : protected