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

Commit 52a5e658 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Scrollable tabs are correctly displayed.

Bug 3495561

Change-Id: I1fe4962ddbe2435c335c76769d37f57f4b30a3b3
parent ca93c1e4
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.