Example usage for android.app ActionBar setDisplayUseLogoEnabled

List of usage examples for android.app ActionBar setDisplayUseLogoEnabled

Introduction

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

Prototype

public abstract void setDisplayUseLogoEnabled(boolean useLogo);

Source Link

Document

Set whether to display the activity logo rather than the activity icon.

Usage

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

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

    String statusIdAsString = getIntent().getStringExtra(STATUS_ID_KEY);
    if (statusIdAsString != null) {
        long statusId = Long.parseLong(statusIdAsString);

        mGetStatusCallback = TwitterManager.get().getFetchStatusInstance().new FinishedCallback() {

            @Override/*from   w w w . ja v a2s .  c  o m*/
            public void finished(TwitterFetchResult result, TwitterStatus status) {
                // TODO: handle error properly
                if (result.isSuccessful() && status != null) {
                    if (mTweetSpotlightAdapter != null) {
                        onGetStatus(status);
                    }
                } else {
                    finish();
                }
                mGetStatusCallback = null;
            }
        };

        // TODO: Look at using a cached value
        TwitterManager.get().getStatus(statusId, mGetStatusCallback);

    } else {
        finish();
        return;
    }

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayUseLogoEnabled(true);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);

    mViewSwitcher = (ViewSwitcher) findViewById(R.id.rootViewSwitcher);
    updateViewVisibility();
}

From source file:com.tweetlanes.android.core.view.ProfileActivity.java

void configureActionBarView() {

    if (mScreenName != null) {

        final ActionBar actionBar = getActionBar();
        actionBar.setDisplayUseLogoEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle("@" + mScreenName);

        final LayoutInflater inflator = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        final int layout = R.layout.profile_title_thin;
        /*/* w w  w.  j av  a2s . c  om*/
         * // TODO: This is messy, and likely won't work for large screen
         * devices. Need to come up with a better solution int layout; if
         * (getResources().getConfiguration().orientation ==
         * Configuration.ORIENTATION_LANDSCAPE) { layout=
         * R.layout.profile_title_thin; } else { layout =
         * R.layout.profile_title; }
         */

        final View abView = inflator.inflate(layout, null);
        final ImageView verified = (ImageView) abView.findViewById(R.id.verifiedImage);
        verified.setVisibility(mUser != null && mUser.getVerified() ? View.VISIBLE : View.GONE);

        actionBar.setDisplayShowCustomEnabled(true);
        actionBar.setCustomView(abView);
    }
}

From source file:activities.PaintingActivity.java

public void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayUseLogoEnabled(true);
    actionBar.setLogo(R.drawable.navbar_logo);
    actionBar.setIcon(R.drawable.ic_drawer);
}

From source file:com.tweetlanes.android.core.view.DirectMessageActivity.java

void configureActionBarView() {

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(getString(R.string.dm_title) + getOtherUserScreenName());
    actionBar.setDisplayUseLogoEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
}

From source file:com.tweetlanes.android.core.view.TweetSpotlightActivity.java

void onGetStatus(TwitterStatus status) {
    mStatus = new TwitterStatus(status);
    updateViewVisibility();/*  w ww. j  a  v  a 2s  .  c o  m*/

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayUseLogoEnabled(true);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);

    invalidateOptionsMenu();
    setComposeDefault();
}

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

/** Called when the activity is first created. */
@Override/*w ww . jav  a  2 s  .co  m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_PROGRESS);

    setContentView(R.layout.main);
    final ActionBar ab = getActionBar();

    // set defaults for logo & home up
    ab.setDisplayHomeAsUpEnabled(showHomeUp);
    ab.setDisplayUseLogoEnabled(useLogo);

    // set up tabs nav
    for (int i = 1; i < 4; i++) {
        ab.addTab(ab.newTab().setText("Tab " + i).setTabListener(this));
    }

    // set up list nav
    ab.setListNavigationCallbacks(
            ArrayAdapter.createFromResource(ab.getThemedContext(), R.array.sections,
                    android.R.layout.simple_spinner_dropdown_item),
            //              .createFromResource(this, R.array.sections,
            //                      android.R.layout.simple_spinner_dropdown_item),
            new OnNavigationListener() {
                @Override
                public boolean onNavigationItemSelected(int itemPosition, long itemId) {
                    // FIXME add proper implementation
                    //rotateLeftFrag();
                    return false;
                }
            });

    // default to tab navigation
    showTabsNav();

    // create a couple of simple fragments as placeholders
    //        final int MARGIN = 16;
    //        leftFrag = new RoundedColourFragment(getResources().getColor(
    //                R.color.android_green), 1f, MARGIN, MARGIN / 2, MARGIN, MARGIN);
    //        rightFrag = new RoundedColourFragment(getResources().getColor(
    //                R.color.honeycombish_blue), 2f, MARGIN / 2, MARGIN, MARGIN,
    //                MARGIN);
    //
    //        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    //        ft.add(R.id.root, leftFrag);
    //        ft.add(R.id.root, rightFrag);
    //        ft.commit();

    ((Button) findViewById(R.id.start)).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mMode = startActionMode(new AnActionModeOfEpicProportions());
        }
    });
    ((Button) findViewById(R.id.cancel)).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (mMode != null) {
                mMode.finish();
            }
        }
    });

    ((Button) findViewById(R.id.progress)).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (mProgress == 100) {
                mProgress = 0;
                mProgressRunner.run();
            }
        }
    });

}

From source file:edu.ufl.cise.android.MainActivity.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

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

    // Set up the action bar.
    final ActionBar actionBar = getActionBar();

    // Specify that the Home/Up button should not be enabled, since there is no hierarchical
    // parent./*from w  w w.java  2  s. c  o m*/
    actionBar.setHomeButtonEnabled(false);

    // Specify that we will be displaying tabs in the action bar.
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayUseLogoEnabled(false);

    // Set up the ViewPager, attaching the adapter and setting up a listener for when the
    // user swipes between sections.
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mAppSectionsPagerAdapter);
    mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
        @Override
        public void onPageSelected(int position) {
            // When swiping between different app sections, select the corresponding tab.
            // We can also use ActionBar.Tab#select() to do this if we have a reference to the
            // Tab.
            actionBar.setSelectedNavigationItem(position);
        }
    });

    // For each of the sections in the app, add a tab to the action bar.
    for (int i = 0; i < mAppSectionsPagerAdapter.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
        // listener for when this tab is selected.
        actionBar.addTab(
                actionBar.newTab().setText(mAppSectionsPagerAdapter.getPageTitle(i)).setTabListener(this));
    }
}

From source file:org.catrobat.catroid.ui.MainMenuActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (!Utils.checkForExternalStorageAvailableAndDisplayErrorIfNot(this)) {
        return;//from  w w  w. j ava2  s.  com
    }
    initializeFacebookSdk();

    PreferenceManager.setDefaultValues(this, R.xml.preferences, true);
    UtilUi.updateScreenWidthAndHeight(this);

    if (STANDALONE_MODE) {
        /*requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
           WindowManager.LayoutParams.FLAG_FULLSCREEN);*/
        getActionBar().hide();
        setContentView(R.layout.activity_main_menu_splashscreen);
        unzipProgram();
    } else {
        setContentView(R.layout.activity_main_menu);

        final ActionBar actionBar = getActionBar();
        actionBar.setDisplayUseLogoEnabled(true);
        actionBar.setHomeButtonEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(false);
        actionBar.setTitle(R.string.app_name);

        findViewById(R.id.main_menu_button_continue).setEnabled(false);

        // Load external project from URL or local file system.
        Uri loadExternalProjectUri = getIntent().getData();
        getIntent().setData(null);

        if (loadExternalProjectUri != null) {
            loadProgramFromExternalSource(loadExternalProjectUri);
        }
    }
}

From source file:com.google.samples.apps.iosched.ui.BaseScheduleActivity.java

private void updateActionBarNavigation() {
    boolean show = !isNavDrawerOpen();
    if (getLPreviewUtils().shouldChangeActionBarForDrawer()) {
        ActionBar ab = getActionBar();
        ab.setDisplayShowTitleEnabled(show);
        ab.setDisplayUseLogoEnabled(!show);
    }/*from ww  w .  j  av  a 2 s. c om*/
}

From source file:com.example.gangzhang.myapplication.VideoPlayerActivity.java

public void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(getTitle());//  ww  w .  j  a  v  a 2 s. c o  m
    actionBar.setIcon(null);
    actionBar.setDisplayUseLogoEnabled(false);
}