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

Commit 0e23ab70 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Support custom themes in TabHost.

CL 76118 introduced style customized tab layout. However, applications
which tabWidgetStyle has been overriden and does not inherit from
Widget.TabWidget will not be able to access tabLayout. Use the default
holo layout for these.

Bug 3235944

Change-Id: I5666c5ef2886060a2175a3d642b012cdaf0a1d50
parent 7dddf275
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -79,12 +79,14 @@ public class TabHost extends FrameLayout implements ViewTreeObserver.OnTouchMode
                com.android.internal.R.attr.tabWidgetStyle, 0);

        mTabLayoutId = a.getResourceId(R.styleable.TabWidget_tabLayout, 0);
        a.recycle();

        if (mTabLayoutId == 0) {
            throw new IllegalArgumentException("Invalid TabWidget tabLayout id");
            // In case the tabWidgetStyle does not inherit from Widget.TabWidget and tabLayout is
            // not defined.
            mTabLayoutId = R.layout.tab_indicator_holo;
        }

        a.recycle();

        initTabHost();
    }