Android ActionBar.Tab - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ActionBar.Tab class.

This code example shows how to use the following methods:setTabListener, setTag
            mViewPager.setOnPageChangeListener(this);
        } 
 
        public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
        } 
 
        @Override 
        public int getCount() { 
            return mTabs.size();
        } 
 
        @Override 
        public Fragment getItem(int position) {
            TabInfo info = mTabs.get(position);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTabListener, setTag
            mViewPager.setOnPageChangeListener(this);
        } 
 
        public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
        } 
 
        @Override 
        public int getCount() { 
            return mTabs.size();
        } 
 
        @Override 
        public Fragment getItem(int position) {
            TabInfo info = mTabs.get(position);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getTag
    onTabSelected(tab, ft);
  } 
 
  @Override 
  public void onTabSelected(Tab tab, FragmentTransaction ft) {
    switch ((Tabs)tab.getTag()) {
      case TAB_SIMPLE:
        showSimple(ft);
        break; 
      case TAB_CUSTOM_TASK:
        showCustom(ft);
        break; 
    } 
  } 
 
  @Override 
  public void onTabUnselected(Tab tab, FragmentTransaction ft) {
    // no-op 
  } 
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTabListener, setTag
            mViewPager.setOnPageChangeListener(this);
        } 
 
        public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
        } 
 
        @Override 
        public int getCount() { 
            return mTabs.size();
        } 
 
        @Override 
        public Fragment getItem(int position) {
            TabInfo info = mTabs.get(position);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTabListener, setTag
            mViewPager.setOnPageChangeListener(this);
        } 
 
        public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
        } 
 
        @Override 
        public int getCount() { 
            return mTabs.size();
        } 
 
        @Override 
        public Fragment getItem(int position) {
            TabInfo info = mTabs.get(position);
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTabListener, setTag
            mViewPager.setOnPageChangeListener(this);
        } 
 
        public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
        } 
 
        @Override 
        public int getCount() { 
            return mTabs.size();
        } 
 
        @Override 
        public Fragment getItem(int position) {
            TabInfo info = mTabs.get(position);
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTabListener
    } 
 
    @Override 
    public CompatTab setTabListener(CompatTabListener callback) {
        mCallback = callback;
        mTab.setTabListener(this);
        return this;
    } 
 
    @Override 
    public CharSequence getText() {
        return mTab.getText();
    } 
 
    @Override 
    public Drawable getIcon() {
        return mTab.getIcon();
    } 
 
    @Override 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getPosition
     * This will cause a navigation event to be delivered to the configured listener. 
     */ 
    @Override 
    public void onTabSelected(Tab tab, FragmentTransaction ft) {
        // TODO Auto-generated method stub 
        mNavListener.onCategorySelected(tab.getPosition());
    } 
 
    /** 
     * Called by framework when a item on the navigation menu is selected. 
     * 
     * This will cause a navigation event to be delivered to the configured listener. 
     */ 
    @Override 
    public boolean onNavigationItemSelected(int itemPosition, long itemId) {
        mNavListener.onCategorySelected(itemPosition);
        return true; 
    } 
 
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getPosition, setContentDescription, setIcon, setTabListener, setText
        mListener = listener;
    } 
 
    private void addTab(int expectedTabIndex, int icon, int description) {
        final Tab tab = mActionBar.newTab();
        tab.setTabListener(mTabListener);
        if (mShowTabsAsText) {
            tab.setText(description);
        } else { 
            tab.setIcon(icon);
            tab.setContentDescription(description);
        } 
        mActionBar.addTab(tab);
        if (expectedTabIndex != tab.getPosition()) {
            throw new IllegalStateException("Tabs must be created in the right order");
        } 
    } 
 
    private class MyTabListener implements ActionBar.TabListener {
        /** 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTabListener
    } 
 
    @Override 
    public CompatTab setTabListener(CompatTabListener callback) {
        mCallback = callback;
        mTab.setTabListener(this);
        return this;
    } 
 
    @Override 
    public CharSequence getText() {
        return mTab.getText();
    } 
 
    @Override 
    public Drawable getIcon() {
        return mTab.getIcon();
    } 
 
    @Override 
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android ActionBar.Tab Questions & Answers:

Other Android ActionBar.Tab Examples

62:	
63:		@Override
64:		public void onTabReselected(Tab tab, FragmentTransaction ft) {
65:		}
66:	
-
66:	
67:		@Override
68:		public void onTabSelected(Tab tab, FragmentTransaction ft) {
69:			// on tab selected
70:			// show respected fragment view
-
73:	
74:		@Override
75:		public void onTabUnselected(Tab tab, FragmentTransaction ft) {
76:		}
77:

Read More

See Code Examples for Android ActionBar.Tab Methods: