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:org.zeroxlab.zeroxbenchmark.Benchmark.java
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuItem item1 = menu.add(GROUP_DEFAULT, SETTINGS_ID, Menu.NONE, R.string.menu_settings); return true; }//from w ww. j av a2 s.co m
From source file:net.zionsoft.obadiah.ui.fragments.TranslationListFragment.java
@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { if (v != mTranslationListView) { super.onCreateContextMenu(menu, v, menuInfo); return;//from w ww . j a va2s . co m } final TranslationInfo translationInfo = getTranslationInfo((AdapterView.AdapterContextMenuInfo) menuInfo); if (translationInfo == null || mCurrentTranslation.equals(translationInfo.name)) { return; } menu.setHeaderTitle(translationInfo.name); menu.add(Menu.NONE, CONTEXT_MENU_ITEM_DELETE, Menu.NONE, R.string.action_delete_translation); }
From source file:org.alfresco.mobile.android.application.fragments.fileexplorer.FileExplorerAdapter.java
public void getMenu(Menu menu, File f) { MenuItem mi;/*www . ja v a2s .c o m*/ if (f.isFile()) { mi = menu.add(Menu.NONE, R.id.menu_action_share, Menu.FIRST, R.string.share); mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); mi = menu.add(Menu.NONE, R.id.menu_upload, Menu.FIRST + 30, R.string.upload); mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); } if (f.canWrite() && downloadPath != null && f.getPath().startsWith(downloadPath)) { mi = menu.add(Menu.NONE, R.id.menu_action_edit, Menu.FIRST + 50, R.string.action_rename); mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); mi = menu.add(Menu.NONE, R.id.menu_action_delete, Menu.FIRST + 100, R.string.delete); mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); } if (DataProtectionManager.getInstance(getContext()).isEncryptionEnable()) { if (DataProtectionManager.getInstance(getContext()).isEncrypted(f.getPath())) { mi = menu.add(Menu.NONE, R.id.menu_file_decrypt, Menu.FIRST + 70, R.string.decrypt_action); mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); } else { mi = menu.add(Menu.NONE, R.id.menu_file_encrypt, Menu.FIRST + 70, R.string.encrypt_action); mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); } } }
From source file:com.crystal.CrystalBeanWallpapers.Wallpaper.java
@Override public boolean onCreateOptionsMenu(Menu menu) { menu.add(Menu.NONE, MENU_APPLY, 0, R.string.action_apply).setIcon(android.R.drawable.ic_menu_set_as) .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); return super.onCreateOptionsMenu(menu); }
From source file:com.mahali.gpslogger.MainActivity.java
@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { if (v.getId() == R.id.sessionListView) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; menu.setHeaderTitle(sessionList.get(info.position).getFileName()); String[] menuItems = getResources().getStringArray(R.array.sessionLongMenu); for (int i = 0; i < menuItems.length; i++) { menu.add(Menu.NONE, i, i, menuItems[i]); }/* w w w .java 2 s . c o m*/ } }
From source file:org.puder.trs80.MainActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); MenuItem mediaRouteItem = menu.findItem(R.id.action_cast_trs80); MediaRouteButton mediaRouteButton = (MediaRouteButton) MenuItemCompat.getActionView(mediaRouteItem); mediaRouteButton.setRouteSelector(castMessageSender.getRouteSelector()); if (!romManager.hasAllRoms()) { downloadMenuItem = menu.add(Menu.NONE, MENU_OPTION_DOWNLOAD, Menu.NONE, this.getString(R.string.menu_download)); downloadMenuItem.setIcon(R.drawable.download_icon); MenuItemCompat.setShowAsAction(downloadMenuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS); }//from www . ja v a2 s . c o m MenuItemCompat.setShowAsAction( menu.add(Menu.NONE, MENU_OPTION_ADD_CONFIGURATION, Menu.NONE, this.getString(R.string.menu_add_configuration)).setIcon(R.drawable.add_icon), MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); MenuItemCompat.setShowAsAction( menu.add(Menu.NONE, MENU_OPTION_HELP, Menu.NONE, this.getString(R.string.menu_help)) .setIcon(R.drawable.help_icon), MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); return true; }
From source file:com.mifos.mifosxdroid.online.LoanAccountSummaryFragment.java
@Override public void onPrepareOptionsMenu(Menu menu) { menu.clear();//ww w .j a va2 s. c o m menu.addSubMenu(Menu.NONE, MENU_ITEM_DATA_TABLES, Menu.NONE, Constants.DATA_TABLE_LOAN_NAME); menu.add(Menu.NONE, MENU_ITEM_LOAN_TRANSACTIONS, Menu.NONE, getResources().getString(R.string.transactions)); menu.add(Menu.NONE, MENU_ITEM_REPAYMENT_SCHEDULE, Menu.NONE, getResources().getString(R.string.loan_repayment_schedule)); menu.add(Menu.NONE, MENU_ITEM_DOCUMENTS, Menu.NONE, getResources().getString(R.string.documents)); menu.add(Menu.NONE, MENU_ITEM_CHARGES, Menu.NONE, getResources().getString(R.string.charges)); int SUBMENU_ITEM_ID = 0; // Create a Sub Menu that holds a link to all data tables SubMenu dataTableSubMenu = menu.getItem(1).getSubMenu(); if (dataTableSubMenu != null && loanDataTables != null && loanDataTables.size() > 0) { Iterator<DataTable> dataTableIterator = loanDataTables.iterator(); while (dataTableIterator.hasNext()) { dataTableSubMenu.add(Menu.NONE, SUBMENU_ITEM_ID, Menu.NONE, dataTableIterator.next().getRegisteredTableName()); SUBMENU_ITEM_ID++; } } super.onPrepareOptionsMenu(menu); }
From source file:com.koushikdutta.superuser.FragmentMain.java
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); MenuItem mode = menu.add(Menu.NONE, Menu.NONE, 100, R.string.list_mode); mode.setTitle(pref.getBoolean("grid_mode", true) ? R.string.list_mode : R.string.grid_mode); mode.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); mode.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override/*from w w w.j a v a 2s .c o m*/ public boolean onMenuItemClick(MenuItem menuItem) { if (pref.edit().putBoolean("grid_mode", !pref.getBoolean("grid_mode", true)).commit()) getActivity().recreate(); return true; } }); if (!gridMode) return; MenuItem gridSize = menu.add(Menu.NONE, Menu.NONE, 101, R.string.grid_size); gridSize.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); gridSize.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem menuItem) { int sizePort = pref.getInt("grid_size_port", 3); int sizeLand = pref.getInt("grid_size_land", 4); final AlertDialog.Builder builder = new AlertDialog.Builder(context); View parent = LayoutInflater.from(context).inflate(R.layout.dialog_settings_grid_size, null); final AppCompatSeekBar seekPort = (AppCompatSeekBar) parent.findViewById(R.id.seek_port); seekPort.setProgress(sizePort - 3); final AppCompatSeekBar seekLand = (AppCompatSeekBar) parent.findViewById(R.id.seek_land); seekLand.setProgress(sizeLand - 3); builder.setView(parent); builder.setPositiveButton("?", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { SharedPreferences.Editor editor = pref.edit(); editor.putInt("grid_size_port", seekPort.getProgress() + 3); editor.putInt("grid_size_land", seekLand.getProgress() + 3).apply(); if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { int val = seekPort.getProgress() + 3; layoutManager.setSpanCount(val); callback.onGridSpanChanged(type, val); } else if (getResources() .getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { int val = seekLand.getProgress() + 3; layoutManager.setSpanCount(val); callback.onGridSpanChanged(type, val); } } }); builder.show(); return true; } }); }
From source file:br.com.GUI.perfil.MeusAlunos.java
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.adicionar_aluno_actions, menu); final SearchView searchView = new SearchView(getActivity().getActionBar().getThemedContext()); searchView.setQueryHint("Search"); menu.add(Menu.NONE, Menu.NONE, 1, "@string").setIcon(android.R.drawable.ic_menu_search) .setActionView(searchView)/*from w w w . j a va 2s .c o m*/ .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); searchView.setOnQueryTextListener(new OnQueryTextListener() { @Override public boolean onQueryTextChange(String newText) { if (newText.length() > 0) { // Search atualizarMeusAlunos(newText.toString()); } else { // Do something when there's no input atualizarMeusAlunos(newText.toString()); } return false; } @Override public boolean onQueryTextSubmit(String arg0) { // TODO Auto-generated method stub atualizarMeusAlunos(arg0.toString()); return false; } }); }