List of usage examples for android.view Menu NONE
int NONE
To view the source code for android.view Menu NONE.
Click Source Link
From source file:com.esri.android.mapsapp.tools.MeasuringTool.java
@Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { mMode = mode;/*from w w w .ja va 2 s. c o m*/ init(); MenuItem item; item = menu.add(Menu.NONE, MENU_UNDO, 1, "undo"); item.setIcon(android.R.drawable.ic_menu_revert); item.setVisible(false); item = menu.add(Menu.NONE, MENU_DELETE, 2, "clear"); item.setIcon(android.R.drawable.ic_menu_delete); item.setVisible(false); item = menu.add(Menu.NONE, MENU_PREF, 3, "preferences"); item.setIcon(android.R.drawable.ic_menu_manage); item.setActionProvider(new Preferences(mContext)); return true; }
From source file:org.mythdroid.activities.Main.java
/** Populate the pop-up menu */ @Override/*from www . j a v a2 s.co m*/ public boolean onCreateOptionsMenu(Menu menu) { MenuItemCompat.setShowAsAction( menu.add(Menu.NONE, MENU_NAV, Menu.NONE, R.string.remote).setIcon(drawable.ic_menu_compass), MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, MENU_SETTINGS, Menu.NONE, R.string.settings) .setIcon(drawable.ic_menu_preferences), MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); addFrontendChooser(menu); menu.add(Menu.NONE, MENU_WAKE, Menu.NONE, R.string.wakeFe).setIcon(drawable.ic_lock_power_off); menu.add(Menu.NONE, MENU_MDD, Menu.NONE, R.string.mddCmds).setIcon(drawable.ic_menu_agenda); return true; }
From source file:com.gmail.at.faint545.fragments.QueueFragment.java
@Override public void onPrepareOptionsMenu(Menu menu) { menu.clear();/*from ww w . j a va 2 s.c o m*/ /* Only show these options if there are jobs to delete */ if (mSelectedPositions.size() > 0 && mJobs.size() > 0) { menu.add(Menu.NONE, DELETE, Menu.NONE, "Delete selected"); menu.add(Menu.NONE, PAUSE, Menu.NONE, "Pause selected"); menu.add(Menu.NONE, RESUME, Menu.NONE, "Resume selected"); } else if (mJobs.size() > 0) { menu.add(Menu.NONE, DELETE, Menu.NONE, "Delete all"); menu.add(Menu.NONE, PAUSE, Menu.NONE, "Pause all"); menu.add(Menu.NONE, RESUME, Menu.NONE, "Resume all"); } super.onPrepareOptionsMenu(menu); }
From source file:org.webinos.android.app.wrt.ui.WidgetListActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { /* inflate the menu items for use in the action bar */ MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.widget_list_activity_actions, menu); if (stores != null) { for (int i = 0; i < stores.length; i++) { Store store = stores[i];/* ww w . j a v a 2s . c o m*/ menu.add(Menu.NONE, STORES_MENUITEM_BASE + i, i + 1, store.name).setIcon(store.icon) .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); } } else { Log.i(TAG, "Unable to add app store"); } return super.onCreateOptionsMenu(menu); }
From source file:com.mifos.mifosxdroid.online.clientcharge.ClientChargeFragment.java
@Override public void onPrepareOptionsMenu(Menu menu) { menu.clear();/*www .j ava 2s . c om*/ MenuItem menuItemAddNewDocument = menu.add(Menu.NONE, MENU_ITEM_ADD_NEW_CHARGES, Menu.NONE, getString(R.string.add_new)); menuItemAddNewDocument .setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_add_white_24dp, null)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) menuItemAddNewDocument.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); super.onPrepareOptionsMenu(menu); }
From source file:com.keithandthegirl.ui.activity.GuestsDashboardFragment.java
@Override @TargetApi(11)/* w w w . ja v a 2s. c o m*/ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { Log.v(TAG, "onCreateOptionsMenu : enter"); super.onCreateOptionsMenu(menu, inflater); MenuItem refresh = menu.add(Menu.NONE, REFRESH_ID, Menu.NONE, getResources().getString(R.string.menu_refresh)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { refresh.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); } MenuItem mostRecent = menu.add(Menu.NONE, MOST_RECENT_ID, Menu.NONE, getResources().getString(R.string.menu_most_recent)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { mostRecent.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); } MenuItem topCount = menu.add(Menu.NONE, TOP_COUNT_ID, Menu.NONE, getResources().getString(R.string.menu_top_count)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { topCount.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); } MenuItem name = menu.add(Menu.NONE, NAME_ID, Menu.NONE, getResources().getString(R.string.menu_name)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { name.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); } Log.v(TAG, "onCreateOptionsMenu : exit"); }
From source file:com.money.manager.ex.currency.list.CurrencyListFragment.java
@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; // take cursor and move into position Cursor cursor = ((CurrencyListAdapter) getListAdapter()).getCursor(); cursor.moveToPosition(info.position); // set currency name menu.setHeaderTitle(cursor.getString(cursor.getColumnIndex(Currency.CURRENCYNAME))); // compose context menu String[] menuItems = getResources().getStringArray(R.array.context_menu_currencies); for (int i = 0; i < menuItems.length; i++) { menu.add(Menu.NONE, i, i, menuItems[i]); }//w w w .ja v a2 s . co m }
From source file:moe.johnny.tombstone.ui.PreventFragment.java
private void updatePreventMenu(Menu menu, String packageName) { if (mActivity.getPreventPackages().containsKey(packageName)) { menu.add(Menu.NONE, R.string.remove, Menu.NONE, R.string.remove); } else {// w w w.j a va2 s. com menu.add(Menu.NONE, R.string.prevent, Menu.NONE, R.string.prevent); } }
From source file:org.spinsuite.view.T_Menu.java
@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { if (m_MenuType.equals(LookupMenu.MAIN_MENU)) { return;/*w ww . jav a 2s. com*/ } // Standard Option menu.add(Menu.NONE, O_NO_FORCED, Menu.NONE, getString(R.string.Action_SyncNoForced)); // Forced Option menu.add(Menu.NONE, O_FORCED, Menu.NONE, getString(R.string.Action_SyncForced)); // Delete Before menu.add(Menu.NONE, O_DELETE_BEFORE, Menu.NONE, getString(R.string.Action_SyncDeleteBefore)); }
From source file:com.googlecode.android_scripting.activity.ApiBrowser.java
@Override public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) { if (!mIsLanguageSupported) { return;//from w w w . ja va 2 s . c o m } menu.add(Menu.NONE, ContextMenuId.INSERT_TEXT.getId(), Menu.NONE, getResources().getString(R.string.s_Insert)); menu.add(Menu.NONE, ContextMenuId.PROMPT_PARAMETERS.getId(), Menu.NONE, getResources().getString(R.string.s_Prompt)); if (Help.checkApiHelp(this)) { menu.add(Menu.NONE, ContextMenuId.HELP.getId(), Menu.NONE, getResources().getString(R.string.s_Help)); } }