Example usage for android.app ActionBar NAVIGATION_MODE_STANDARD

List of usage examples for android.app ActionBar NAVIGATION_MODE_STANDARD

Introduction

In this page you can find the example usage for android.app ActionBar NAVIGATION_MODE_STANDARD.

Prototype

int NAVIGATION_MODE_STANDARD

To view the source code for android.app ActionBar NAVIGATION_MODE_STANDARD.

Click Source Link

Document

Standard navigation mode.

Usage

From source file:com.yangtsaosoftware.pebblemessenger.activities.NavigationActivity.java

public void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle(mTitle);// www. j  ava2s. c om
    }

}

From source file:com.github.pennyfive.cinemafinlando.ui.activity.generic.DrawerActivity.java

protected void updateNavigationMode(int mode) {
    getActionBar().setNavigationMode(mode);
    getActionBar().setDisplayShowTitleEnabled(mode == ActionBar.NAVIGATION_MODE_STANDARD);
}

From source file:com.albertcbraun.wifidlitedemoapp.MainActivity.java

void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    //noinspection deprecation
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(mTitle);/*from www .j  a  va 2 s  .  c o m*/
}

From source file:com.SpitsinStafichuk.vkazam_remastered.DrawerActivity.java

public void restoreActionBar() {
    ActionBar actionBar = getActionBar();

    if (actionBar != null) {
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle(mTitle);//from w w  w  . ja v  a  2s  .  c  om
    }
}

From source file:com.klokisoft.mathdokuext.ui.ArchiveFragmentActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.archive_activity_fragment);

    // Create an adapter that when requested, will return a fragment
    // representing an object in the collection.
    // ViewPager and its adapters use support library fragments, so we must
    // use getSupportFragmentManager.
    mArchiveFragmentStatePagerAdapter = new ArchiveFragmentStatePagerAdapter(getSupportFragmentManager(), this);

    // Get preferences for displaying the filter.
    mShowStatusFilter = mMathDokuPreferences.isArchiveStatusFilterVisible();
    mShowSizeFilter = mMathDokuPreferences.isArchiveSizeFilterVisible();
    mArchiveFragmentStatePagerAdapter/* w  w  w  . ja  v a  2s.  com*/
            .setStatusFilter(mMathDokuPreferences.getArchiveStatusFilterLastValueUsed());
    mArchiveFragmentStatePagerAdapter.setSizeFilter(mMathDokuPreferences.getArchiveSizeFilterLastValueUsed());

    mActionBar = getActionBar();
    if (mActionBar != null) {
        mActionBar.setDisplayHomeAsUpEnabled(true);
        mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        mActionBar.setTitle(getResources().getString(R.string.archive_action_bar_title));
        mActionBar.setDisplayShowCustomEnabled(true);

        mActionBar.setCustomView(R.layout.archive_action_bar_custom);

        setStatusSpinner();
        setSizeSpinner();
    }

    // Set up the ViewPager, attaching the adapter.
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mArchiveFragmentStatePagerAdapter);

    // Set up the pager tab strip
    final PagerTabStrip pagerTabStrip = (PagerTabStrip) findViewById(R.id.pager_tab_strip);
    pagerTabStrip.setDrawFullUnderline(false);

    // This pager contains a maximum of 3 visible items. The selected tab
    // will always be displayed in the middle. Hide the tab indicator by
    // setting color identical to background color.
    PagerTabStripPainter pagerTabStripPainter = Painter.getInstance().getPagerTabStripPainter();
    pagerTabStrip.setTabIndicatorColor(pagerTabStripPainter.getBackgroundColor());
    pagerTabStrip.setBackgroundColor(pagerTabStripPainter.getBackgroundColor());
    pagerTabStrip.setTextColor(pagerTabStripPainter.getTextColor());
    pagerTabStrip.setTextSize(TypedValue.COMPLEX_UNIT_SP,
            getResources().getDimension(com.klokisoft.mathdokuext.R.dimen.text_size_default)
                    / getResources().getDisplayMetrics().density);
    pagerTabStrip.setGravity(Gravity.BOTTOM);

    // Non primary items are semi transparent.
    pagerTabStrip.setNonPrimaryAlpha(0.75f);

    // In case a solving attempt has been specified in the bundle, this
    // solving attempt will be showed as selected grid as long as it does
    // meet the selection criteria of the filters.
    Intent intent = getIntent();
    if (intent != null) {
        Bundle bundle = intent.getExtras();
        if (bundle != null) {
            int solvingAttemptId = bundle.getInt(BUNDLE_KEY_SOLVING_ATTEMPT_ID);
            if (solvingAttemptId >= 0
                    && mArchiveFragmentStatePagerAdapter.getPositionOfGridId(solvingAttemptId) >= 0) {
                mMathDokuPreferences.setArchiveGridIdLastShowed(solvingAttemptId);
            }
        }
    }
}

From source file:net.cactii.mathdoku.ui.ArchiveFragmentActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.archive_activity_fragment);

    // Create an adapter that when requested, will return a fragment
    // representing an object in the collection.
    // ViewPager and its adapters use support library fragments, so we must
    // use getSupportFragmentManager.
    mArchiveFragmentStatePagerAdapter = new ArchiveFragmentStatePagerAdapter(getSupportFragmentManager(), this);

    // Get preferences for displaying the filter.
    mShowStatusFilter = mMathDokuPreferences.isArchiveStatusFilterVisible();
    mShowSizeFilter = mMathDokuPreferences.isArchiveSizeFilterVisible();
    mArchiveFragmentStatePagerAdapter/*from w  ww  .  j  av  a  2 s .  c  o m*/
            .setStatusFilter(mMathDokuPreferences.getArchiveStatusFilterLastValueUsed());
    mArchiveFragmentStatePagerAdapter.setSizeFilter(mMathDokuPreferences.getArchiveSizeFilterLastValueUsed());

    mActionBar = getActionBar();
    if (mActionBar != null) {
        mActionBar.setDisplayHomeAsUpEnabled(true);
        mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        mActionBar.setTitle(getResources().getString(R.string.archive_action_bar_title));
        mActionBar.setDisplayShowCustomEnabled(true);

        mActionBar.setCustomView(R.layout.archive_action_bar_custom);

        setStatusSpinner();
        setSizeSpinner();
    }

    // Set up the ViewPager, attaching the adapter.
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mArchiveFragmentStatePagerAdapter);

    // Set up the pager tab strip
    final PagerTabStrip pagerTabStrip = (PagerTabStrip) findViewById(R.id.pager_tab_strip);
    pagerTabStrip.setDrawFullUnderline(false);

    // This pager contains a maximum of 3 visible items. The selected tab
    // will always be displayed in the middle. Hide the tab indicator by
    // setting color identical to background color.
    PagerTabStripPainter pagerTabStripPainter = Painter.getInstance().getPagerTabStripPainter();
    pagerTabStrip.setTabIndicatorColor(pagerTabStripPainter.getBackgroundColor());
    pagerTabStrip.setBackgroundColor(pagerTabStripPainter.getBackgroundColor());
    pagerTabStrip.setTextColor(pagerTabStripPainter.getTextColor());
    pagerTabStrip.setTextSize(TypedValue.COMPLEX_UNIT_SP,
            getResources().getDimension(net.cactii.mathdoku.R.dimen.text_size_default)
                    / getResources().getDisplayMetrics().density);
    pagerTabStrip.setGravity(Gravity.BOTTOM);

    // Non primary items are semi transparent.
    pagerTabStrip.setNonPrimaryAlpha(0.75f);

    // In case a solving attempt has been specified in the bundle, this
    // solving attempt will be showed as selected grid as long as it does
    // meet the selection criteria of the filters.
    Intent intent = getIntent();
    if (intent != null) {
        Bundle bundle = intent.getExtras();
        if (bundle != null) {
            int solvingAttemptId = bundle.getInt(BUNDLE_KEY_SOLVING_ATTEMPT_ID);
            if (solvingAttemptId >= 0
                    && mArchiveFragmentStatePagerAdapter.getPositionOfGridId(solvingAttemptId) >= 0) {
                mMathDokuPreferences.setArchiveGridIdLastShowed(solvingAttemptId);
            }
        }
    }
}

From source file:com.github.hobbe.android.openkarotz.fragment.RadioFragment.java

@Override
public void onPause() {
    Log.v(LOG_TAG, "onPause");
    super.onPause();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
}

From source file:fm.krui.kruifm.StreamContainer.java

/**
 * Styles the ActionBar appropriately based on the fragment to be loaded
 * @param fragmentId Integer identifier of fragment
 *///from www  .  j a  v  a2 s.  c o  m
private void applyActionBarParameters(int fragmentId) {
    // Default params
    ActionBar actionBar = getActionBar();
    String title = "";
    String subTitle = "";
    int navigationMode = ActionBar.NAVIGATION_MODE_STANDARD;

    // Set params based on opening tab
    switch (fragmentId) {
    case STREAM_TAB:
        //navigationMode = ActionBar.NAVIGATION_MODE_LIST;
        break;
    case PLAYLIST_TAB:
        title = getString(R.string.extended_playlist_title);
        subTitle = getString(R.string.extended_playlist_subtitle);
        break;
    case DJ_TAB:
        title = getString(R.string.dj_info_tab);
        break;
    case FAVORITE_TRACKS_TAB:
        title = getString(R.string.favorite_tracks_title);
        subTitle = getString(R.string.favorite_tracks_subtitle);
        break;
    case MUSIC_ARTICLES_TAB:
        title = getString(R.string.music_content_sidebar);
        break;
    case NEWS_ARTICLES_TAB:
        title = getString(R.string.news_content_sidebar);
        break;
    case SPORTS_ARTICLES_TAB:
        title = getString(R.string.sports_content_sidebar);
        break;
    }

    // Apply parameters
    actionBar.setNavigationMode(navigationMode);
    actionBar.setTitle(title);
    actionBar.setSubtitle(subTitle);
}

From source file:com.ternup.caddisfly.activity.MainActivity.java

/**
 *
 *//*from  ww w . j  a v  a2 s.com*/
void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle(mTitle);
    }
}

From source file:com.github.pennyfive.cinemafinlando.ui.activity.generic.DrawerActivity.java

@Override
public void onDrawerOpened(View drawerView) {
    drawerToggle.onDrawerOpened(drawerView);
    updateNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    updateActionBarTitle(getString(R.string.app_name));
    invalidateOptionsMenu();/*from  w w w  . j  a  v  a2s .c  om*/
}