Android ActionBar - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ActionBar class.

This code example shows how to use the following methods: setBackgroundDrawable, setCustomView, setDisplayShowCustomEnabled, setDisplayShowTitleEnabled
     * @param title The title for the action bar 
     * @param subtitle The subtitle for the action bar. 
     */ 
    public void themeActionBar(final ActionBar actionBar, final String title) {
        // Set the custom layout 
        actionBar.setCustomView(mActionBarLayout);
        actionBar.setDisplayShowCustomEnabled(true);
        actionBar.setDisplayShowTitleEnabled(false);
 
        // Theme the action bar background 
        actionBar.setBackgroundDrawable(getDrawable("action_bar"));
 
        // Theme the title 
        setTitle(title);
    } 
 
    /** 
     * Themes the action bar subtitle 
     *  
     * @param subtitle The subtitle to use 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setDisplayHomeAsUpEnabled, setDisplayOptions, setIcon
 
		setContentView(getBaseLayout());
 
		bar = getActionBar();
		if (bar != null) {
			bar.setIcon(getIcon());
			bar.setDisplayOptions(0, ActionBar.DISPLAY_HOME_AS_UP);
			bar.setDisplayHomeAsUpEnabled(true);
		} 
		replace(); 
	} 
 
	public void replace() { 
		getFragmentManager().beginTransaction()
				.replace(getReplaceId(), replaceFragment()).commit();
	} 
 
	public abstract int getIcon(); 
 
	public abstract boolean getCondition(); 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setDisplayHomeAsUpEnabled, setDisplayShowTitleEnabled, setListNavigationCallbacks, setNavigationMode, setSelectedNavigationItem
        } 
    } 
 
    private void setupActionBar(Bundle savedInstanceState) {
        bar = getActionBar();
        bar.setDisplayHomeAsUpEnabled(true);
        bar.setDisplayShowTitleEnabled(false);
        bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
 
        adapter = new FilterAdapter(this);
        adapter.setTitle(Subreddits.getTitle(this, subreddit));
        bar.setListNavigationCallbacks(adapter, this);
        if (savedInstanceState != null) {
            bar.setSelectedNavigationItem(savedInstanceState.getInt(STATE_NAVIGATION_INDEX));
        } 
    } 
 
    public Loader<AccountResult> onCreateLoader(int id, Bundle args) {
        return new AccountLoader(this, true, false);
    } 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getNavigationMode, getSelectedNavigationIndex, setSelectedNavigationItem
        if (tab == mCurrentTab) {
            return; 
        } 
        mCurrentTab = tab;
 
        final int actionBarSelectedNavIndex = mActionBar.getSelectedNavigationIndex();
        switch(mActionBar.getNavigationMode()) {
            case ActionBar.NAVIGATION_MODE_TABS:
                if (mCurrentTab != actionBarSelectedNavIndex) {
                    mActionBar.setSelectedNavigationItem(mCurrentTab);
                } 
                break; 
            case ActionBar.NAVIGATION_MODE_LIST:
                if (mCurrentTab != getTabPositionFromNavigationItemPosition(
                        actionBarSelectedNavIndex)) {
                    mActionBar.setSelectedNavigationItem(
                            getNavigationItemPositionFromTabPosition(mCurrentTab));
                } 
                break; 
        } 
 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setDisplayHomeAsUpEnabled, setDisplayShowTitleEnabled
		// Must do this before super.onCreate 
		ActivityHelper.readAndSetSettings(this);
		super.onCreate(savedInstanceState);
 
		final ActionBar actionBar = getActionBar();
		actionBar.setDisplayShowTitleEnabled(true);
		actionBar.setDisplayHomeAsUpEnabled(true);
 
		handleIntent(getIntent()); 
	} 
	 
	/** 
	 * To allow child classes to override content 
	 */ 
	protected Fragment getFragment() {
		return FragmentSearch.getInstance(mQuery);
	} 
 
	@AfterViews 
	void loadContent() { 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android ActionBar Questions & Answers:

Other Android ActionBar Examples

0:	ActionBar actionBar = getActionBar();
1:	
2:	// set the icon

Read More

0:	ActionBar actionBar = getActionBar();
1:	// hide the action bar
2:	actionBar.hide();

Read More

12:	
13:			// get action bar	
14:			ActionBar actionBar = getActionBar();
15:	
16:			// Enabling Up / Back navigation

Read More

See Code Examples for Android ActionBar Methods: