Example usage for android.app ActionBar setDisplayShowTitleEnabled

List of usage examples for android.app ActionBar setDisplayShowTitleEnabled

Introduction

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

Prototype

public abstract void setDisplayShowTitleEnabled(boolean showTitle);

Source Link

Document

Set whether an activity title/subtitle should be displayed.

Usage

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

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

From source file:com.actionbarsherlock.sample.styled.MainActivityICS.java

private void showDropDownNav() {
    ActionBar ab = getActionBar();
    if (ab.getNavigationMode() != ActionBar.NAVIGATION_MODE_LIST) {
        ab.setDisplayShowTitleEnabled(false);
        ab.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    }/*from  ww  w  . j  a va 2  s  .c  o  m*/
}

From source file:com.actionbarsherlock.sample.styled.MainActivityICS.java

private void showTabsNav() {
    ActionBar ab = getActionBar();
    if (ab.getNavigationMode() != ActionBar.NAVIGATION_MODE_TABS) {
        ab.setDisplayShowTitleEnabled(true);
        ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    }//  w w w  . ja v a 2 s .co  m
}

From source file:com.rastating.droidbeard.MainActivity.java

public void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(true);

    if (mTitle != null) {
        actionBar.setTitle(mTitle);/* www  . j ava2 s. co m*/
    }
}

From source file:com.actionbarsherlock.sample.styled.MainActivityICS.java

private void showStandardNav() {
    ActionBar ab = getActionBar();
    if (ab.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD) {
        ab.setDisplayShowTitleEnabled(true);
        ab.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    }/*from w  w  w  .j a va 2 s.  com*/
}

From source file:com.michellgaby.advsettings.DeviceSettings.java

@TargetApi(11)
@Override/*from   w  w  w .jav  a 2s .c om*/
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.viewPager);
    setContentView(mViewPager);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE);

    // Remove title and icon
    bar.setDisplayShowHomeEnabled(false);
    bar.setDisplayShowTitleEnabled(false);

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.general_settings_title), GeneralSettings.class, null);
    /**
     * mTabsAdapter.addTab(
     * bar.newTab().setText(R.string.category_mdnie_title),
     * mDNIeFragmentActivity.class, null); mTabsAdapter.addTab(
     * bar.newTab().setText(R.string.category_sensors_title),
     * SensorsFragmentActivity.class, null);
     */

    mTabsAdapter.addTab(bar.newTab().setText(R.string.system_settings_title), SystemSettings.class, null);

    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
    }
}

From source file:info.ipeanut.googletrainingcoursedemos.displayingbitmaps.ui.ImageDetailActivity.java

@TargetApi(VERSION_CODES.HONEYCOMB)
@Override//from   w ww  . j  av a  2s  . c om
public void onCreate(Bundle savedInstanceState) {
    if (BuildConfig.DEBUG) {
        Utils.enableStrictMode();
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.image_detail_pager);

    // Fetch screen height and width, to use as our max size when loading images as this
    // activity runs full screen
    final DisplayMetrics displayMetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
    final int height = displayMetrics.heightPixels;
    final int width = displayMetrics.widthPixels;

    // For this sample we'll use half of the longest width to resize our images. As the
    // image scaling ensures the image is larger than this, we should be left with a
    // resolution that is appropriate for both portrait and landscape. For best image quality
    // we shouldn't divide by 2, but this will use more memory and require a larger memory
    // cache.
    final int longest = (height > width ? height : width) / 2;

    ImageCache.ImageCacheParams cacheParams = new ImageCache.ImageCacheParams(this, IMAGE_CACHE_DIR);
    cacheParams.setMemCacheSizePercent(0.25f); // Set memory cache to 25% of app memory

    // The ImageFetcher takes care of loading images into our ImageView children asynchronously
    mImageFetcher = new ImageFetcher(this, longest);
    mImageFetcher.addImageCache(getSupportFragmentManager(), cacheParams);
    mImageFetcher.setImageFadeIn(false);

    // Set up ViewPager and backing adapter
    mAdapter = new ImagePagerAdapter(getSupportFragmentManager(), Images.imageUrls.length);
    mPager = (ViewPager) findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);
    mPager.setPageMargin((int) getResources().getDimension(R.dimen.horizontal_page_margin));
    mPager.setOffscreenPageLimit(2);

    // Set up activity to go full screen
    getWindow().addFlags(LayoutParams.FLAG_FULLSCREEN);

    // Enable some additional newer visibility and ActionBar features to create a more
    // immersive photo viewing experience
    if (Utils.hasHoneycomb()) {
        final ActionBar actionBar = getActionBar();

        if (null == actionBar) {
            return;
        }
        // Hide title text and set home as up
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(true);

        // Hide and show the ActionBar as the visibility changes
        mPager.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
            @Override
            public void onSystemUiVisibilityChange(int vis) {
                if ((vis & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0) {
                    actionBar.hide();
                } else {
                    actionBar.show();
                }
            }
        });

        // Start low profile mode and hide ActionBar
        mPager.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
        actionBar.hide();
    }

    // Set the current item based on the extra passed in to this activity
    final int extraCurrentItem = getIntent().getIntExtra(EXTRA_IMAGE, -1);
    if (extraCurrentItem != -1) {
        mPager.setCurrentItem(extraCurrentItem);
    }
}

From source file:com.xortech.multitag.TagAddMain.java

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

    // REMOVE THE TITLE FROM THE ACTIONBAR
    ActionBar actionbar = getActionBar();
    actionbar.setDisplayHomeAsUpEnabled(true);
    actionbar.setDisplayShowTitleEnabled(false);

    try {// w  w  w  .j  av  a  2s .c o m
        tagList = (ListView) findViewById(R.id.tagList);
        tagList.setItemsCanFocus(false);
        addBtn = (Button) findViewById(R.id.add_btn);

        Set_Referash_Data();

    } catch (Exception e) {
        Log.e("some error", "" + e);
    }

    addBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent addTag = new Intent(TagAddMain.this, TagAddUpdate.class);
            addTag.putExtra("called", "add");
            addTag.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(addTag);
            finish();
        }
    });

    /**
     * LISTENER TO OPEN/CLOSE THE EXPANSION OF EACH CLICKED ITEM IN THE LISTVIEW
     */
    tagList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, final View view, int position, long id) {

            View toolbar = view.findViewById(R.id.expandable2);

            // CREATE AND EXPAND ANIMATION FOR THE ITEM 
            ExpandAnimation expandAni = new ExpandAnimation(toolbar, 500);

            // START ANIMATION ON THE TOOLBAR
            toolbar.startAnimation(expandAni);
        }
    });
}

From source file:edu.pdx.cecs.orcycle.TabsConfig.java

@Override
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
    try {//  w  w w.jav  a  2  s.com
        // When the given tab is selected, switch to the corresponding page in
        // the ViewPager.
        // Toast.makeText(this, "TabSelected", Toast.LENGTH_LONG).show();
        mViewPager.setCurrentItem(tab.getPosition());
        final ActionBar actionBar = getActionBar();
        switch (tab.getPosition()) {
        case 0:
            actionBar.setDisplayShowTitleEnabled(false);
            actionBar.setDisplayShowHomeEnabled(false);
            break;
        case 1:
            actionBar.setDisplayShowTitleEnabled(true);
            actionBar.setDisplayShowHomeEnabled(true);
            actionBar.setTitle(R.string.app_name);
            break;
        case 2:
            actionBar.setDisplayShowTitleEnabled(true);
            actionBar.setDisplayShowHomeEnabled(true);
            actionBar.setTitle(R.string.app_name);
            break;
        case 3:
            actionBar.setDisplayShowTitleEnabled(true);
            actionBar.setDisplayShowHomeEnabled(true);
            actionBar.setTitle(R.string.app_name);
            break;
        }
    } catch (Exception ex) {
        Log.e(MODULE_TAG, ex.getMessage());
    }
}

From source file:blackman.matt.infinitebrowser.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.
 *///from w  w w.  j a v a  2  s. c  om
private void showGlobalContextActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    //actionBar.setTitle(R.string.app_name);
}