Exemplo n.º 1
0
 public void setTabContainer(ScrollingTabContainerView tabView) {
   if (this.mTabContainer != null) {
     removeView(this.mTabContainer);
   }
   this.mTabContainer = tabView;
   if (tabView != null) {
     addView(tabView);
     LayoutParams lp = tabView.getLayoutParams();
     lp.width = -1;
     lp.height = -2;
     tabView.setAllowCollapse(false);
   }
 }
 @Override
 public void setEmbeddedTabView(ScrollingTabContainerView tabView) {
   if (mTabView != null && mTabView.getParent() == mToolbar) {
     mToolbar.removeView(mTabView);
   }
   mTabView = tabView;
   if (tabView != null && mNavigationMode == ActionBar.NAVIGATION_MODE_TABS) {
     mToolbar.addView(mTabView, 0);
     Toolbar.LayoutParams lp = (Toolbar.LayoutParams) mTabView.getLayoutParams();
     lp.width = ViewGroup.LayoutParams.WRAP_CONTENT;
     lp.height = ViewGroup.LayoutParams.WRAP_CONTENT;
     lp.gravity = Gravity.START | Gravity.BOTTOM;
     tabView.setAllowCollapse(true);
   }
 }