Search in sources :

Example 11 with MenuInflater

use of com.actionbarsherlock.view.MenuInflater in project Libraries-for-Android-Developers by eoecn.

the class MainActivity method onCreateOptionsMenu.

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

Example 12 with MenuInflater

use of com.actionbarsherlock.view.MenuInflater in project cw-omnibus by commonsguy.

the class Watson method onCreatePanelMenu.

///////////////////////////////////////////////////////////////////////////
// Sherlock menu handling
///////////////////////////////////////////////////////////////////////////
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
    if (BuildConfig.DEBUG)
        Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        boolean result = onCreateOptionsMenu(menu);
        if (BuildConfig.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 (BuildConfig.DEBUG)
            Log.d(TAG, "[onCreatePanelMenu] fragments create result: " + show);
        result |= show;
        if (BuildConfig.DEBUG)
            Log.d(TAG, "[onCreatePanelMenu] returning " + result);
        return result;
    }
    return false;
}
Also used : MenuInflater(com.actionbarsherlock.view.MenuInflater)

Example 13 with MenuInflater

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

the class GameActivity method onCreateOptionsMenu.

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

Example 14 with MenuInflater

use of com.actionbarsherlock.view.MenuInflater in project mobile-android by photo.

the class UploadManagerFragment method onItemClick.

@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
    TrackerUtils.trackButtonClickEvent("upload_manager_item", UploadManagerFragment.this);
    mSelectedItem = mAdapter.getItem(position);
    PopupMenu contextMenu = new PopupMenu(getActivity(), view);
    contextMenu.setOnMenuItemClickListener(mOnMenuItemClickListener);
    MenuInflater inflater = getSupportActivity().getSupportMenuInflater();
    Menu menu = contextMenu.getMenu();
    inflater.inflate(R.menu.upload_manager_item, menu);
    UploadStatus uploadStatus = mSelectedItem.getUploadStatus();
    if (uploadStatus == UploadStatus.DONE) {
        menu.findItem(R.id.menu_cancel).setVisible(false);
    } else {
        menu.findItem(R.id.menu_clear).setVisible(false);
    }
    contextMenu.show();
}
Also used : MenuInflater(com.actionbarsherlock.view.MenuInflater) UploadStatus(com.trovebox.android.common.fragment.upload.UploadManagerFragment.PhotoUploadWrapper.UploadStatus) Menu(com.actionbarsherlock.view.Menu) PopupMenu(org.holoeverywhere.widget.PopupMenu) PopupMenu(org.holoeverywhere.widget.PopupMenu)

Example 15 with MenuInflater

use of com.actionbarsherlock.view.MenuInflater in project howabout-android by recomio.

the class RecommendedTrackListActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    MenuInflater inflater = getSupportMenuInflater();
    inflater.inflate(R.menu.recommended_track_list, menu);
    return super.onCreateOptionsMenu(menu);
}
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