Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08532ab9 authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Fix indeterminate ProgressBars with weird sizes and padding; optimize...

Merge "Fix indeterminate ProgressBars with weird sizes and padding; optimize ActionBar measurement" into jb-mr1-dev
parents c89b14bb 6322af54
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -985,9 +985,13 @@ public class ProgressBar extends View {
    }

    private void updateDrawableBounds(int w, int h) {
        // onDraw will translate the canvas so we draw starting at 0,0
        int right = w - mPaddingRight - mPaddingLeft;
        int bottom = h - mPaddingBottom - mPaddingTop;
        // onDraw will translate the canvas so we draw starting at 0,0.
        // Subtract out padding for the purposes of the calculations below.
        w -= mPaddingRight + mPaddingLeft;
        h -= mPaddingTop + mPaddingBottom;

        int right = w;
        int bottom = h;
        int top = 0;
        int left = 0;

+3 −4
Original line number Diff line number Diff line
@@ -856,6 +856,7 @@ public class ActionBarView extends AbsActionBarView {
        final int paddingRight = getPaddingRight();
        final int height = maxHeight - verticalPadding;
        final int childSpecHeight = MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST);
        final int exactHeightSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);

        int availableWidth = contentWidth - paddingLeft - paddingRight;
        int leftOfCenter = availableWidth / 2;
@@ -871,16 +872,14 @@ public class ActionBarView extends AbsActionBarView {
            } else {
                homeWidthSpec = MeasureSpec.makeMeasureSpec(lp.width, MeasureSpec.EXACTLY);
            }
            homeLayout.measure(homeWidthSpec,
                    MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
            homeLayout.measure(homeWidthSpec, exactHeightSpec);
            final int homeWidth = homeLayout.getMeasuredWidth() + homeLayout.getStartOffset();
            availableWidth = Math.max(0, availableWidth - homeWidth);
            leftOfCenter = Math.max(0, availableWidth - homeWidth);
        }
        
        if (mMenuView != null && mMenuView.getParent() == this) {
            availableWidth = measureChildView(mMenuView, availableWidth,
                    childSpecHeight, 0);
            availableWidth = measureChildView(mMenuView, availableWidth, exactHeightSpec, 0);
            rightOfCenter = Math.max(0, rightOfCenter - mMenuView.getMeasuredWidth());
        }