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:cn.jasonlv.siri.activity.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // ??? ???//  w  w w .j  a  v  a  2 s .  co  m
    musicManager = new MusicManager(getApplicationContext());

    // ??
    initImageLoader(getApplicationContext());

    /* get the installed package list*/
    // ??
    mPackageManager = new NativePackageManager(getApplicationContext());

    // ?
    setVolumeControlStream(AudioManager.STREAM_MUSIC);

    // ?
    mSynthesizer = new Synthesizer(getApplicationContext());

    //mSynthesizer.speak("EDI");

    //  ?
    mContactManager = new ContactsManager(getApplicationContext());

    mContactManager.getContactList();

    // ??
    detactor = new LocationDetactor(getApplicationContext());
    info = detactor.getLocationInfo();

    Log.d("location info", info.lat + ", " + info.lon);

    //for(Object o : mPackageManager.getPackageList()){
    //    System.out.println(o.toString());

    setContentView(R.layout.sdk2_api);

    //txtLog = (TextView) findViewById(R.id.txtLog);
    btn = (ActionButton) findViewById(R.id.btn);

    // ?
    speechRecognizer = SpeechRecognizer.createSpeechRecognizer(this,
            new ComponentName(this, VoiceRecognitionService.class));

    speechRecognizer.setRecognitionListener(this);

    btn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
            boolean api = sp.getBoolean("api", false);
            if (api) {
                switch (status) {
                case STATUS_None:
                    start();
                    //btn.setText("?");
                    status = STATUS_WaitingReady;
                    break;
                case STATUS_WaitingReady:
                    cancel();
                    status = STATUS_None;
                    //btn.setText("");
                    break;
                case STATUS_Ready:
                    cancel();
                    status = STATUS_None;
                    //btn.setText("");
                    break;
                case STATUS_Speaking:
                    stop();
                    status = STATUS_Recognition;
                    //btn.setText("");
                    break;
                case STATUS_Recognition:
                    cancel();
                    status = STATUS_None;
                    //btn.setText("");
                    break;
                }
            } else {
                start();
            }
        }
    });

    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(true);

    container = (LinearLayout) findViewById(R.id.container);
    scrollView = (ScrollView) findViewById(R.id.scroll);

    scrollView.fullScroll(View.FOCUS_DOWN);
}

From source file:blackman.matt.infinitebrowser.InfinityBrowser.java

/**
 * Restores the action bar when called./*from   w  w  w . j  a  v  a 2 s  . c o  m*/
 */
void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    assert actionBar != null;
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(true);
}

From source file:com.untappedkegg.rally.home.ActivityMain.java

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

    if (actionBar != null) {
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle(mActionBarDrawer[curPosition]);
    }/*from w w w  .  j a  va 2 s .  co  m*/
}

From source file:com.albertcbraun.wifidlitedemoapp.fragments.NavigationDrawerFragment.java

/**
 * Per the navigation drawer design guidelines, updates the action bar to show the global app
 * 'context', rather than just what's in the current screen.
 */// w  w  w. ja  va  2 s. c o m
private void showGlobalContextActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setTitle(R.string.app_name);
}

From source file:org.dmfs.webcal.fragments.PagerFragment.java

/**
 * Configures the tabs on the action bar.
 *//*from   w  w  w  .  ja v  a  2  s. c  o m*/
private void setupActionBarTabs() {
    ActionBar actionBar = getActivity().getActionBar();

    int tabCount = actionBar.getTabCount();
    int pageCount = mAdapter.getCount();

    // replace titles and listeners of existing tabs
    int i = 0;
    for (; i < tabCount && i < pageCount; ++i) {
        final Tab tab = actionBar.getTabAt(i);
        tab.setText(mAdapter.getPageTitle(i));
        tab.setTabListener(this);
    }

    // add missing tabs
    for (; i < pageCount; ++i) {
        actionBar.addTab(actionBar.newTab().setText(mAdapter.getPageTitle(i)).setTabListener(this));
    }

    // remove remaining tabs
    for (; i < tabCount; --tabCount) {
        actionBar.removeTabAt(i);
    }

    if (pageCount > 1) {
        int selection = mSelectedTab;
        // changing the navigation mode might trigger a call to onTabSelected overriding mSelectedTab with a wrong value, so save it
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        mSelectedTab = selection;
        if (selection < pageCount) {
            mViewPager.setCurrentItem(selection, false);
        }
    } else {
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    }
}

From source file:com.semaphore.sm.MainActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    boolean darktheme = prefs.getBoolean("darktheme", false);
    if (darktheme)
        setTheme(android.R.style.Theme_Holo);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);// w w w.  j a  v  a 2s.  c  o  m
    // setup action bar for tabs

    try {
        ViewConfiguration config = ViewConfiguration.get(this);
        Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
        if (menuKeyField != null) {
            menuKeyField.setAccessible(true);
            menuKeyField.setBoolean(config, false);
        }
    } catch (Exception ex) {
        // Ignore
    }

    if ("mako".equals(android.os.Build.DEVICE))
        Device = SemaDevices.Mako;
    else
        Device = SemaDevices.I9000;

    if (Device == SemaDevices.Mako)
        sp = new SemaN4Properties();
    else
        sp = new SemaI9000Properties();

    checkSU_BB();
    unpackScripts();

    checkFirstRun();

    mPagerAdapter = new PagerAdapter(getSupportFragmentManager(), this);
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mPagerAdapter);

    PagerTabStrip pagerTitleStrip = (PagerTabStrip) findViewById(R.id.pager_title_strip);
    pagerTitleStrip.setDrawFullUnderline(true);
    pagerTitleStrip.setTabIndicatorColor(0x33b5e5);

    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(true);

    actionBar.setTitle("Semaphore Manager");

    actionBar.setSubtitle(SemaphoreVer);

    updateSummaries();

}

From source file:fr.cph.chicago.activity.MainActivity.java

/**
 * Restore action bar/*  w w w. j av  a2  s . co  m*/
 */
public final void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(mTitle);
}

From source file:com.ternup.caddisfly.fragment.NavigationDrawerFragment.java

/**
 * Per the navigation drawer design guidelines, updates the action bar to show the global app
 * 'context', rather than just what's in the current screen.
 *//*w ww .ja  v a  2 s.c  o  m*/
private void showGlobalContextActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setTitle(R.string.appName);
}

From source file:org.dmfs.webcal.fragments.CalendarItemFragment.java

@Override
public void onAttach(final Activity activity) {
    super.onAttach(activity);
    mActionBar = activity.getActionBar();
    mActionBar.removeAllTabs();//from ww  w  . ja v a2  s . com
    mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
}

From source file:com.veggies.android.todoList.MainActivity.java

private void hideActionMenu() {
    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
}