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

Commit 0357e5b2 authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "Scrollable tabs are correctly displayed."

parents 857447f1 52a5e658
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -172,6 +172,11 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {

    @Override
    void measureHorizontal(int widthMeasureSpec, int heightMeasureSpec) {
        if (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.UNSPECIFIED) {
            super.measureHorizontal(widthMeasureSpec, heightMeasureSpec);
            return;
        }

        // First, measure with no constraint
        final int unspecifiedWidth = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
        mImposedTabsHeight = -1;
@@ -208,10 +213,8 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
        }

        // Measure again, this time with imposed tab widths and respecting initial spec request
        if (mImposedTabsHeight >= 0 || unspecifiedWidth != widthMeasureSpec) {
        super.measureHorizontal(widthMeasureSpec, heightMeasureSpec);
    }
    }

    /**
     * Returns the tab indicator view at the given index.