Java Code Examples for android.app.ActionBar#Tab

The following examples show how to use android.app.ActionBar#Tab . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Utility.java    From iBeebo with GNU General Public License v3.0 6 votes vote down vote up
public static void buildTabCount(ActionBar.Tab tab, String tabStrRes, int count) {
    if (tab == null) {
        return;
    }
    String content = tab.getText().toString();
    int value = 0;
    int start = content.indexOf("(");
    int end = content.lastIndexOf(")");
    if (start > 0) {
        String result = content.substring(start + 1, end);
        value = Integer.valueOf(result);
    }
    if (value <= count) {
        tab.setText(tabStrRes + "(" + count + ")");
    }
}
 
Example 2
Source File: TitlesFragment.java    From codeexamples-android with Eclipse Public License 1.0 5 votes vote down vote up
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
    TitlesFragment titleFrag = (TitlesFragment) getFragmentManager()
            .findFragmentById(R.id.titles_frag);
    titleFrag.populateTitles(tab.getPosition());
    
    if (mDualFragments) {
        titleFrag.selectPosition(0);
    }
}
 
Example 3
Source File: TitlesFragment.java    From codeexamples-android with Eclipse Public License 1.0 5 votes vote down vote up
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
    TitlesFragment titleFrag = (TitlesFragment) getFragmentManager()
            .findFragmentById(R.id.titles_frag);
    titleFrag.populateTitles(tab.getPosition());
    
    if (mDualFragments) {
        titleFrag.selectPosition(0);
    }
}
 
Example 4
Source File: MainActivity.java    From aard2-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onTabUnselected(ActionBar.Tab tab,
        FragmentTransaction fragmentTransaction) {
    Fragment frag = appSectionsPagerAdapter.getItem(tab.getPosition());
    if (frag instanceof BaseListFragment) {
        ((BaseListFragment)frag).finishActionMode();
    }
    if (tab.getPosition() == 0) {
        View v = this.getCurrentFocus();
        if (v != null){
            InputMethodManager mgr = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
            mgr.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
        }
    }
}
 
Example 5
Source File: RetroWatchActivity.java    From retrowatch with Apache License 2.0 4 votes vote down vote up
@Override
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
}
 
Example 6
Source File: ChallengeActivity.java    From android-crackme-challenge with MIT License 4 votes vote down vote up
@Override
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
    mViewPager.setCurrentItem(tab.getPosition()); // Tell ViewPager to change fragments
}
 
Example 7
Source File: ChallengeActivity.java    From android-crackme-challenge with MIT License 4 votes vote down vote up
@Override
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {}
 
Example 8
Source File: ActivityMain.java    From ploggy with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
}
 
Example 9
Source File: ChallengeActivity.java    From android-crackme-challenge with MIT License 4 votes vote down vote up
@Override
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {}
 
Example 10
Source File: TitlesFragment.java    From codeexamples-android with Eclipse Public License 1.0 4 votes vote down vote up
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {
}
 
Example 11
Source File: ChallengeActivity.java    From android-crackme-challenge with MIT License 4 votes vote down vote up
@Override
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {}
 
Example 12
Source File: MainActivity.java    From GeoLog with Apache License 2.0 4 votes vote down vote up
@Override
public void onTabSelected(ActionBar.Tab tab,
		FragmentTransaction fragmentTransaction) {
	mViewPager.setCurrentItem(tab.getPosition());
}
 
Example 13
Source File: ChallengeActivity.java    From android-crackme-challenge with MIT License 4 votes vote down vote up
@Override
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {}
 
Example 14
Source File: ChallengeActivity.java    From android-crackme-challenge with MIT License 4 votes vote down vote up
@Override
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
    mViewPager.setCurrentItem(tab.getPosition()); // Tell ViewPager to change fragments
}
 
Example 15
Source File: MainActivity.java    From android-HorizontalPaging with Apache License 2.0 4 votes vote down vote up
/**
 * Unused. Required for {@link android.app.ActionBar.TabListener}.
 */
@Override
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
}
 
Example 16
Source File: ChallengeActivity.java    From android-crackme-challenge with MIT License 4 votes vote down vote up
@Override
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
    mViewPager.setCurrentItem(tab.getPosition()); // Tell ViewPager to change fragments
}
 
Example 17
Source File: RetroWatchActivity.java    From retrowatch with Apache License 2.0 4 votes vote down vote up
/**
 * Implements TabListener
 */
@Override
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
	// When the given tab is selected, switch to the corresponding page in the ViewPager.
	mViewPager.setCurrentItem(tab.getPosition());
}
 
Example 18
Source File: QuickReturnListViewActivity.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
@Override
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
    mPager.setCurrentItem(tab.getPosition());
}
 
Example 19
Source File: QuickReturnFacebookActivity.java    From QuickReturn with Apache License 2.0 4 votes vote down vote up
@Override
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
}
 
Example 20
Source File: ChallengeActivity.java    From android-crackme-challenge with MIT License 4 votes vote down vote up
@Override
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {}