Search in sources :

Example 6 with MenuInflater

use of com.actionbarsherlock.view.MenuInflater in project KeepScore by nolanlawson.

the class OrganizePlayersActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getSupportMenuInflater();
    inflater.inflate(R.menu.organize_players_menu, menu);
    return true;
}
Also used : MenuInflater(com.actionbarsherlock.view.MenuInflater)

Example 7 with MenuInflater

use of com.actionbarsherlock.view.MenuInflater in project KeepScore by nolanlawson.

the class MainActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getSupportMenuInflater();
    inflater.inflate(R.menu.main_menu, menu);
    return true;
}
Also used : MenuInflater(com.actionbarsherlock.view.MenuInflater)

Example 8 with MenuInflater

use of com.actionbarsherlock.view.MenuInflater in project ActionBarSherlock by JakeWharton.

the class Watson method onCreatePanelMenu.

///////////////////////////////////////////////////////////////////////////
// Sherlock menu handling
///////////////////////////////////////////////////////////////////////////
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
    if (ActionBarSherlock.DEBUG)
        Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        boolean result = onCreateOptionsMenu(menu);
        if (ActionBarSherlock.DEBUG)
            Log.d(TAG, "[onCreatePanelMenu] activity create result: " + result);
        MenuInflater inflater = getSupportMenuInflater();
        boolean show = false;
        ArrayList<Fragment> newMenus = null;
        if (mFragments.mAdded != null) {
            for (int i = 0; i < mFragments.mAdded.size(); i++) {
                Fragment f = mFragments.mAdded.get(i);
                if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnCreateOptionsMenuListener) {
                    show = true;
                    ((OnCreateOptionsMenuListener) f).onCreateOptionsMenu(menu, inflater);
                    if (newMenus == null) {
                        newMenus = new ArrayList<Fragment>();
                    }
                    newMenus.add(f);
                }
            }
        }
        if (mCreatedMenus != null) {
            for (int i = 0; i < mCreatedMenus.size(); i++) {
                Fragment f = mCreatedMenus.get(i);
                if (newMenus == null || !newMenus.contains(f)) {
                    f.onDestroyOptionsMenu();
                }
            }
        }
        mCreatedMenus = newMenus;
        if (ActionBarSherlock.DEBUG)
            Log.d(TAG, "[onCreatePanelMenu] fragments create result: " + show);
        result |= show;
        if (ActionBarSherlock.DEBUG)
            Log.d(TAG, "[onCreatePanelMenu] returning " + result);
        return result;
    }
    return false;
}
Also used : MenuInflater(com.actionbarsherlock.view.MenuInflater)

Example 9 with MenuInflater

use of com.actionbarsherlock.view.MenuInflater in project ActionBarSherlock by JakeWharton.

the class Issue659 method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getSupportMenuInflater();
    inflater.inflate(R.menu.issue659, menu);
    // Get the SearchView and set the searchable configuration
    SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
    SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
    return true;
}
Also used : SearchView(com.actionbarsherlock.widget.SearchView) MenuInflater(com.actionbarsherlock.view.MenuInflater) SearchManager(android.app.SearchManager)

Example 10 with MenuInflater

use of com.actionbarsherlock.view.MenuInflater in project little-bear-dictionary by daimajia.

the class Watson method onCreatePanelMenu.

///////////////////////////////////////////////////////////////////////////
// Sherlock menu handling
///////////////////////////////////////////////////////////////////////////
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
    if (DEBUG)
        Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        boolean result = onCreateOptionsMenu(menu);
        if (DEBUG)
            Log.d(TAG, "[onCreatePanelMenu] activity create result: " + result);
        MenuInflater inflater = getSupportMenuInflater();
        boolean show = false;
        ArrayList<Fragment> newMenus = null;
        if (mFragments.mAdded != null) {
            for (int i = 0; i < mFragments.mAdded.size(); i++) {
                Fragment f = mFragments.mAdded.get(i);
                if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnCreateOptionsMenuListener) {
                    show = true;
                    ((OnCreateOptionsMenuListener) f).onCreateOptionsMenu(menu, inflater);
                    if (newMenus == null) {
                        newMenus = new ArrayList<Fragment>();
                    }
                    newMenus.add(f);
                }
            }
        }
        if (mCreatedMenus != null) {
            for (int i = 0; i < mCreatedMenus.size(); i++) {
                Fragment f = mCreatedMenus.get(i);
                if (newMenus == null || !newMenus.contains(f)) {
                    f.onDestroyOptionsMenu();
                }
            }
        }
        mCreatedMenus = newMenus;
        if (DEBUG)
            Log.d(TAG, "[onCreatePanelMenu] fragments create result: " + show);
        result |= show;
        if (DEBUG)
            Log.d(TAG, "[onCreatePanelMenu] returning " + result);
        return result;
    }
    return false;
}
Also used : MenuInflater(com.actionbarsherlock.view.MenuInflater)

Aggregations

MenuInflater (com.actionbarsherlock.view.MenuInflater)20 SearchView (com.actionbarsherlock.widget.SearchView)2 SearchManager (android.app.SearchManager)1 Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 View (android.view.View)1 Menu (com.actionbarsherlock.view.Menu)1 UploadStatus (com.trovebox.android.common.fragment.upload.UploadManagerFragment.PhotoUploadWrapper.UploadStatus)1 SearchedTrackListActivity (io.recom.howabout.category.music.activity.SearchedTrackListActivity)1 PopupMenu (org.holoeverywhere.widget.PopupMenu)1