示例#1
0
 public TabView() {
   this.add(tabbedPane);
   setLayout(new GridLayout(1, 1));
   contextMenu = new JPopupMenu();
   init();
   setupMenu();
 }
示例#2
0
  private void addTab(String text, Drawable icon, int index) {
    // Workaround for not being able to pass a defStyle on pre-3.0
    final TabView tabView = (TabView) mInflater.inflate(R.layout.vpi__tab, null);
    tabView.init(this, text, icon, index);
    tabView.setFocusable(true);
    tabView.setOnClickListener(mTabClickListener);

    mTabLayout.addView(tabView, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1));
  }
  private TabView createTabView(ActionBar.Tab tab, boolean forAdapter) {
    // Workaround for not being able to pass a defStyle on pre-3.0
    final TabView tabView = (TabView) mInflater.inflate(R.layout.abs__action_bar_tab, null);
    tabView.init(this, tab, forAdapter);

    if (forAdapter) {
      tabView.setBackgroundDrawable(null);
      tabView.setLayoutParams(
          new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, mContentHeight));
    } else {
      tabView.setFocusable(true);

      if (mTabClickListener == null) {
        mTabClickListener = new TabClickListener();
      }
      tabView.setOnClickListener(mTabClickListener);
    }
    return tabView;
  }