Example usage for android.support.v4.app ActionBar setDisplayShowHomeEnabled

List of usage examples for android.support.v4.app ActionBar setDisplayShowHomeEnabled

Introduction

In this page you can find the example usage for android.support.v4.app ActionBar setDisplayShowHomeEnabled.

Prototype

public abstract void setDisplayShowHomeEnabled(boolean showHome);

Source Link

Document

Set whether to include the application home affordance in the action bar.

Usage

From source file:org.pixmob.droidlink.ui.AccountsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.accounts);/*w  w  w.  jav  a  2  s.  c om*/

    // Customize action bar.
    final ActionBar actionBar = getSupportActionBar();
    actionBar.setCustomView(R.layout.nav);
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.nav_background));
}

From source file:org.pixmob.fm2.ui.FM2.java

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

    final ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setCustomView(R.layout.nav);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);

    setContentView(R.layout.main);/*from w ww. j  a v a  2 s.co  m*/

    // Setup BugSense framework.
    BugSenseUtils.setup(this);
}

From source file:org.pixmob.fm2.ui.AccountDetails.java

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

    final ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setCustomView(R.layout.nav);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);

    final Account account = (Account) getIntent().getSerializableExtra(EXTRA_ACCOUNT);
    if (account == null) {
        throw new IllegalStateException("Missing account");
    }//from  ww  w . j  ava2s. c  om

    if (savedInstanceState == null) {
        final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        final AccountDetailsFragment f = AccountDetailsFragment.newInstance(account);
        ft.add(android.R.id.content, f);
        ft.commit();
    }
}

From source file:org.pixmob.droidlink.ui.EventDetailsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.event_details);

    // Customize action bar.
    final ActionBar actionBar = getSupportActionBar();
    actionBar.setCustomView(R.layout.nav);
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.nav_background));

    notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
}

From source file:com.abcvoipsip.ui.prefs.Codecs.java

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

    setContentView(R.layout.codecs_pager);

    final ActionBar ab = getSupportActionBar();
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    ab.setDisplayShowHomeEnabled(true);
    ab.setDisplayShowTitleEnabled(true);

    mViewPager = (ViewPager) findViewById(R.id.pager);
    TabsAdapter tabAdapter = new TabsAdapter(this, ab, mViewPager);

    Tab audioNb = ab.newTab().setText(R.string.narrow_band).setIcon(R.drawable.ic_prefs_media);
    Tab audioWb = ab.newTab().setText(R.string.wide_band).setIcon(R.drawable.ic_prefs_media);
    Tab videoNb = ab.newTab().setText(R.string.narrow_band).setIcon(R.drawable.ic_prefs_media_video);
    Tab videoWb = ab.newTab().setText(R.string.wide_band).setIcon(R.drawable.ic_prefs_media_video);

    tabAdapter.addTab(audioWb, CodecsFragment.class);
    tabAdapter.addTab(audioNb, CodecsFragment.class);
    tabAdapter.addTab(videoWb, CodecsFragment.class);
    tabAdapter.addTab(videoNb, CodecsFragment.class);
}

From source file:org.pixmob.droidlink.ui.EventsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(android.view.Window.FEATURE_PROGRESS);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.events);/*from w  w  w .j  a v  a 2  s . co  m*/

    // A spinner is displayed when events are synchronizing.
    setProgressBarIndeterminateVisibility(Boolean.FALSE);
    setProgressBarVisibility(false);

    // Customize action bar.
    final ActionBar actionBar = getSupportActionBar();
    actionBar.setCustomView(R.layout.nav);
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.nav_background));

    syncActionReceiver = new SyncActionReceiver();

    prefsEditor = getSharedPreferences(SHARED_PREFERENCES_FILE, MODE_PRIVATE).edit();
    notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

    // The details fragment is hidden until an event is selected.
    final Fragment details = getSupportFragmentManager().findFragmentById(R.id.event_details);
    if (details != null) {
        final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.hide(details);
        ft.commit();
    }
}

From source file:com.actionbarsherlock.sample.hcgallery.MainActivity.java

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

    if (savedInstanceState != null && savedInstanceState.getInt("theme", -1) != -1) {
        mThemeId = savedInstanceState.getInt("theme");
        this.setTheme(mThemeId);
    }//from w  ww  . j  a v  a2 s.co  m

    setContentView(R.layout.main);

    Directory.initializeDirectory();

    ActionBar bar = getSupportActionBar();

    int i;
    for (i = 0; i < Directory.getCategoryCount(); i++) {
        bar.addTab(bar.newTab().setText(Directory.getCategory(i).getName()).setTabListener(this));
    }

    mActionBarView = getLayoutInflater().inflate(R.layout.action_bar_custom, null);

    bar.setCustomView(mActionBarView);
    bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_USE_LOGO);
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayShowHomeEnabled(true);

    // If category is not saved to the savedInstanceState,
    // 0 is returned by default.
    if (savedInstanceState != null) {
        int category = savedInstanceState.getInt("category");
        bar.selectTab(bar.getTabAt(category));
    }
}

From source file:com.abcvoipsip.ui.SipHome.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    //prefWrapper = new PreferencesWrapper(this);
    prefProviderWrapper = new PreferencesProviderWrapper(this);

    /*/*from  www  .ja  v  a2 s  .c  o  m*/
     * Resources r; try { r =
     * getPackageManager().getResourcesForApplication("com.etatgere"); int
     * rThemeId = r.getIdentifier("com.etatgere:style/LightTheme", null,
     * null); Log.e(THIS_FILE, "Remote theme " + rThemeId); Theme t =
     * r.newTheme(); t.applyStyle(rThemeId, false); //getTheme().setTo(t); }
     * catch (NameNotFoundException e) { Log.e(THIS_FILE,
     * "Not found app etatgere"); }
     */
    if (USE_LIGHT_THEME) {
        setTheme(R.style.LightTheme_noTopActionBar);
    }

    super.onCreate(savedInstanceState);

    setContentView(R.layout.sip_home);

    final ActionBar ab = getSupportActionBar();
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    // ab.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

    // showAbTitle = Compatibility.hasPermanentMenuKey

    ab.setDisplayShowHomeEnabled(false);
    ab.setDisplayShowTitleEnabled(false);

    Tab dialerTab = ab.newTab()
            // .setText(R.string.dial_tab_name_text)
            .setIcon(R.drawable.ic_ab_dialer_holo_dark);
    Tab callLogTab = ab.newTab()
            // .setText(R.string.calllog_tab_name_text)
            .setIcon(R.drawable.ic_ab_history_holo_dark);

    Tab favoritesTab = ab.newTab()
            // .setText(R.string.messages_tab_name_text)
            .setIcon(R.drawable.ic_ab_favourites_holo_dark);

    Tab messagingTab = null;
    if (CustomDistribution.supportMessaging()) {
        messagingTab = ab.newTab()
                // .setText(R.string.messages_tab_name_text)
                .setIcon(R.drawable.ic_ab_text_holo_dark);
    }

    mDualPane = getResources().getBoolean(R.bool.use_dual_panes);

    mViewPager = (ViewPager) findViewById(R.id.pager);
    mTabsAdapter = new TabsAdapter(this, getSupportActionBar(), mViewPager);
    mTabsAdapter.addTab(dialerTab, DialerFragment.class);
    mTabsAdapter.addTab(callLogTab, CallLogListFragment.class);
    mTabsAdapter.addTab(favoritesTab, FavListFragment.class);
    if (messagingTab != null) {
        mTabsAdapter.addTab(messagingTab, ConversationsListFragment.class);
    }

    hasTriedOnceActivateAcc = false;

    if (!prefProviderWrapper.getPreferenceBooleanValue(SipConfigManager.PREVENT_SCREEN_ROTATION)) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
    }

    selectTabWithAction(getIntent());
    Log.setLogLevel(prefProviderWrapper.getLogLevel());

    // Async check
    asyncSanityCheker = new Thread() {
        public void run() {
            asyncSanityCheck();
        };
    };
    asyncSanityCheker.start();
}