Example usage for android.app ActionBar setTitle

List of usage examples for android.app ActionBar setTitle

Introduction

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

Prototype

public abstract void setTitle(@StringRes int resId);

Source Link

Document

Set the action bar's title.

Usage

From source file:org.deviceconnect.android.deviceplugin.irkit.settings.activity.IRKitAbstractSettingActivity.java

/**
 * ViewPager????. ????? setContentView//  ww w  .  ja  v  a2s.  c  om
 * <strong>?????</strong>
 * 
 * @param savedInstanceState 
 * @see android.app.Activity#onCreate(android.os.Bundle)
 */
@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.irkit_activity_setting_page);

    mViewPager = (ViewPager) findViewById(R.id.setting_pager);
    DConnectFragmentPagerAdapter adapter = new DConnectFragmentPagerAdapter(getSupportFragmentManager(), this);
    mViewPager.setAdapter(adapter);

    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_HOME);
        actionBar.setTitle(R.string.setting_page_title);
    }
}

From source file:com.shafiq.mytwittle.view.DirectMessageActivity.java

boolean configureActionBarView() {

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(getString(R.string.dm_title) + getOtherUserScreenName());
    actionBar.setDisplayUseLogoEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    return true;/* w  ww .  j  a  v a 2  s.c  o m*/
}

From source file:com.deange.textfaker.ui.activity.ConversationActivity.java

private void setupActionBar() {

    final ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.action_bar_title);
    }//from  ww w  .ja  v  a2s . c  o m

}

From source file:org.mythtv.client.ui.frontends.MythmoteActivity.java

@Override
protected void setupActionBar() {
    super.setupActionBar();
    Log.v(TAG, "MythmoteActivity.setupActionBar : enter");

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        ActionBar actionBar = getActionBar();
        actionBar.setTitle(R.string.frontends_title);
    }/* ww  w.j a  v a  2 s.co  m*/

    Log.v(TAG, "MythmoteActivity.setupActionBar : exit");
}

From source file:com.nihaskalam.sample.MainActivity.java

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

    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.IndeterminateProgressSample);
    }/*from w w  w . j  a  v  a2 s. c  o m*/
    circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setIndeterminateProgressMode(true);
    circularButton1.setStrokeColor(ContextCompat.getColor(this, R.color.colorStroke));

    circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setIndeterminateProgressMode(false);
    circularButton2.setStrokeColor(ContextCompat.getColor(this, R.color.colorStroke));
    final int factor = sweepDuration / 100;
    circularButton2.setSweepDuration(sweepDuration);
    percentageTV = (TextView) findViewById(R.id.timeTV);
    circularButton2.setOnAnimationUpdateTimeListener(new OnAnimationUpdateTimeListener() {
        @Override
        public void onAnimationTimeUpdate(int timeElapsed) {
            fixedTimeProgressPercentage = hasConfigurarationChanged
                    ? fixedTimeProgressPercentage + timeElapsed / factor
                    : timeElapsed / factor;
            percentageTV.setText(String.format("%s : %s", "Percentage completed",
                    Integer.toString(fixedTimeProgressPercentage)));
            hasConfigurarationChanged = false;
        }
    });

    circularButton3 = (CircularProgressButton) findViewById(R.id.circularButton3);
    circularButton3.setIndeterminateProgressMode(false);
    circularButton3.setStrokeColor(ContextCompat.getColor(this, R.color.colorStroke));
    circularButton3.setCustomProgressMode(true);

    setProgressBtn = (Button) findViewById(R.id.button);

    progressAmountTV = (TextView) findViewById(R.id.progressAmountTV);

    circularButton4 = (CircularProgressButton) findViewById(R.id.circularButton4);
    circularButton4.setIndeterminateProgressMode(true);
    circularButton4.setStrokeColor(ContextCompat.getColor(this, R.color.colorStroke));

    circularButton5 = (CircularProgressButton) findViewById(R.id.circularButton5);
    circularButton5.setIndeterminateProgressMode(true);
    circularButton5.setStrokeColor(ContextCompat.getColor(this, R.color.colorStroke));
}

From source file:net.sakuramilk.kbcupdater.MainFragmentActivity.java

/** Called when the activity is first created. */
@Override//from w  w w.  j  a v a  2  s  . c om
public 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);
    bar.setTitle(R.string.app_name);

    mPagerAdapter = new TabsFragmentAdapter(this, mViewPager);

    Bundle args = new Bundle();
    args.putString("url", Constant.LIST_URL_SC06D);
    mPagerAdapter.addTab(bar.newTab().setText("SC-06D"), DeviceFragmentActivity.class, args);

    /*
    args = new Bundle();
    args.putString("url", "https://github.com/kbc-developers/release/wiki/sc04d");
    mPagerAdapter.addTab(bar.newTab().setText("SC-04D"),
        DeviceFragmentActivity.class, args);
    */

    args = new Bundle();
    args.putString("url", Constant.LIST_URL_SC02C);
    mPagerAdapter.addTab(bar.newTab().setText("SC-02C"), DeviceFragmentActivity.class, args);

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

From source file:com.google.dartino.githubsample.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.
 *///  www  . j  a  va 2  s. com
private void showGlobalContextActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(getActivity().getTitle());
}

From source file:net.networksaremadeofstring.rhybudd.FirstRunSettings.java

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

    // Set up the action bar.
    final ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    actionBar.setTitle(getString(R.string.FirstRunTitle));
    actionBar.setSubtitle(getString(R.string.FirstRunSubtitle));

    // Create the adapter that will return a fragment for each of the three
    // primary sections of the app.
    mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

    // Set up the ViewPager with the sections adapter.
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mSectionsPagerAdapter);

    // When swiping between different sections, select the corresponding
    // tab. We can also use ActionBar.Tab#select() to do this if we have
    // a reference to the Tab.
    mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
        @Override//from   ww  w  .j  av a2s  . c o m
        public void onPageSelected(int position) {
            actionBar.setSelectedNavigationItem(position);
        }
    });

    // For each of the sections in the app, add a tab to the action bar.
    for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {
        // Create a tab with text corresponding to the page title defined by
        // the adapter. Also specify this Activity object, which implements
        // the TabListener interface, as the callback (listener) for when
        // this tab is selected.
        actionBar
                .addTab(actionBar.newTab().setText(mSectionsPagerAdapter.getPageTitle(i)).setTabListener(this));
    }
}

From source file:com.emotion.emotioncontrol.MainActivity.java

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

From source file:nz.ac.otago.psyanlab.common.designer.assets.ImportAssetActivity.java

@SuppressLint("NewApi")
@Override/*from   w  ww . j av  a2  s  . c  om*/
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_import);

    Resources resources = getResources();
    mFilePickerFragment = (FilePickerFragment) getSupportFragmentManager().findFragmentById(R.id.file_picker);
    if (savedInstanceState == null) {
        mFilePickerFragment.setRootDir(Environment.getExternalStorageDirectory());
        mFilePickerFragment.setColumnWidth(resources.getDimensionPixelSize(R.dimen.grid_column_width));
        mFilePickerFragment.setNumColumns(StickyGridHeadersGridView.AUTO_FIT);
        mFilePickerFragment.setMultiSelectEnabled(true);
    }
    ActionBar abs = getActionBar();
    abs.setDisplayUseLogoEnabled(false);
    abs.setDisplayShowHomeEnabled(false);
    abs.setTitle(R.string.title_import_asset);
}