private void ensureTabsExist() { if (mTabScrollView != null) { return; } [email protected] tabScroller = new [email protected] (mContext); if (mHasEmbeddedTabs) { tabScroller.setVisibility(android.view.View.VISIBLE); mActionView.setEmbeddedTabView(tabScroller); } else { tabScroller.setVisibility(getNavigationMode() == NAVIGATION_MODE_TABS ? android.view.View .VISIBLE : android.view.View.GONE); mContainerView.setTabContainer(tabScroller); } mTabScrollView = tabScroller; }
private void setHasEmbeddedTabs(bool hasEmbeddedTabs) { mHasEmbeddedTabs = hasEmbeddedTabs; // Switch tab layout configuration if needed if (!mHasEmbeddedTabs) { mActionView.setEmbeddedTabView(null); mContainerView.setTabContainer(mTabScrollView); } else { mContainerView.setTabContainer(null); mActionView.setEmbeddedTabView(mTabScrollView); } bool isInTabMode = getNavigationMode() == NAVIGATION_MODE_TABS; if (mTabScrollView != null) { mTabScrollView.setVisibility(isInTabMode ? android.view.View.VISIBLE : android.view.View .GONE); } mActionView.setCollapsable(!mHasEmbeddedTabs && isInTabMode); }