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:Main.java

public static void setupActionBar(Activity activity) {
    ActionBar actionBar = activity.getActionBar();
    actionBar.setDisplayUseLogoEnabled(true);
}

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

@SuppressLint("NewApi")
@Override//from   w  ww. ja v  a  2s . com
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);
}

From source file:com.tweetlanes.android.view.SearchActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    mSearchTerm = getIntent().getStringExtra("query");
    if (mSearchTerm == null) {
        Uri data = getIntent().getData();
        if (data != null) {
            mSearchTerm = data.toString().replace("com.tweetlanes.android.search://", "");
        }//from  w w  w  .ja  v a 2 s  .c o m
    }

    super.onCreate(savedInstanceState);

    // This could be true if loading back into the app from Multitasking
    if (mSearchTerm == null) {
        restartApp();
        return;
    }

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayUseLogoEnabled(true);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(getString(R.string.action_bar_search_title) + " \"" + mSearchTerm + "\"");
    actionBar.setDisplayHomeAsUpEnabled(true);

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

From source file:nz.ac.otago.psyanlab.common.ImportPaleActivity.java

@SuppressLint("NewApi")
@Override/*from  w ww  .j a  va 2  s.c  o  m*/
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mUserDelegate = getIntent().getParcelableExtra(Args.USER_DELEGATE);
    mUserDelegate.init(this);

    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);
    // startActionMode(this);
}

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

@Override
protected void onCreate(Bundle savedInstanceState) {

    mSearchTerm = getIntent().getStringExtra("query");
    if (mSearchTerm == null) {
        Uri data = getIntent().getData();
        if (data != null) {
            mSearchTerm = data.toString().replace("com.shafiq.mytwittle.search://", "");
        }/*from   ww w .j  a v a2  s .  c om*/
    }

    super.onCreate(savedInstanceState);

    // This could be true if loading back into the app from Multitasking
    if (mSearchTerm == null) {
        restartApp();
        return;
    }

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayUseLogoEnabled(true);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(getString(R.string.action_bar_search_title) + " \"" + mSearchTerm + "\"");
    actionBar.setDisplayHomeAsUpEnabled(true);

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

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

@Override
protected void onCreate(Bundle savedInstanceState) {

    mSearchTerm = getIntent().getStringExtra("query");
    if (mSearchTerm == null) {
        Uri data = getIntent().getData();
        if (data != null) {
            mSearchTerm = data.toString().replace("com.tweetlanes.android.core.search://", "");
        }//w  w w  .j  a v a  2 s. co m
    }

    super.onCreate(savedInstanceState);

    // This could be true if loading back into the app from Multitasking
    if (mSearchTerm == null) {
        restartApp();
        return;
    }

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayUseLogoEnabled(true);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(getString(R.string.action_bar_search_title) + " \"" + mSearchTerm + "\"");
    actionBar.setDisplayHomeAsUpEnabled(true);

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

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;/*  www .jav  a2s.co  m*/
}

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

boolean configureActionBarView() {

    if (mScreenName != null) {

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

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

        int layout = R.layout.profile_title_thin;
        /*//from  w w w. j a v  a 2s .  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;
        }*/

        View profileTitleView = inflator.inflate(layout, null);
        ((TextView) profileTitleView.findViewById(R.id.screenname)).setText("@" + mScreenName);

        TextView fullNameTextView = (TextView) profileTitleView.findViewById(R.id.fullname);
        if (fullNameTextView != null && mUser != null) {
            fullNameTextView.setText(mUser.getName());
        }

        ImageView verifiedImage = (ImageView) profileTitleView.findViewById(R.id.verifiedImage);
        verifiedImage.setVisibility(mUser != null && mUser.getVerified() ? View.VISIBLE : View.GONE);

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

    return true;
}

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

boolean configureActionBarView() {

    if (mScreenName != null) {

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

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

        int layout = R.layout.profile_title_thin;
        /*/*from ww  w .j a  v a2  s. c o m*/
         * // 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; }
         */

        View profileTitleView = inflator.inflate(layout, null);
        ((TextView) profileTitleView.findViewById(R.id.screenname)).setText("@" + mScreenName);

        TextView fullNameTextView = (TextView) profileTitleView.findViewById(R.id.fullname);
        if (fullNameTextView != null && mUser != null) {
            fullNameTextView.setText(mUser.getName());
        }

        ImageView verifiedImage = (ImageView) profileTitleView.findViewById(R.id.verifiedImage);
        verifiedImage.setVisibility(mUser != null && mUser.getVerified() ? View.VISIBLE : View.GONE);

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

    return true;
}

From source file:com.tweetlanes.android.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 ww.  j  a  va 2 s .  c  om
            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();
}