本文整理了Java中android.view.SubMenu.clear()
方法的一些代码示例,展示了SubMenu.clear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SubMenu.clear()
方法的具体详情如下:
包路径:android.view.SubMenu
类名称:SubMenu
方法名:clear
暂无
代码示例来源:origin: ankidroid/Anki-Android
@Override
public void onPrepareSubMenu(SubMenu subMenu) {
subMenu.clear();
getMenuInflater().inflate(R.menu.reviewer_schedule, subMenu);
for (int i = 0; i < subMenu.size(); i++) {
subMenu.getItem(i).setOnMenuItemClickListener(this);
}
}
代码示例来源:origin: ankidroid/Anki-Android
@Override
public void onPrepareSubMenu(SubMenu subMenu) {
subMenu.clear();
getMenuInflater().inflate(R.menu.reviewer_suspend, subMenu);
for (int i = 0; i < subMenu.size(); i++) {
subMenu.getItem(i).setOnMenuItemClickListener(this);
}
}
代码示例来源:origin: ankidroid/Anki-Android
@Override
public void onPrepareSubMenu(SubMenu subMenu) {
subMenu.clear();
getMenuInflater().inflate(R.menu.reviewer_bury, subMenu);
for (int i = 0; i < subMenu.size(); i++) {
subMenu.getItem(i).setOnMenuItemClickListener(this);
}
}
代码示例来源:origin: konradrenner/kolabnotes-android
public void overrideTags(OnDrawerSelectionChangedListener listener, Collection<Tag> tags){
final Menu overview = view.getMenu();
final SubMenu tagSubmenu = overview.findItem(R.id.navigation_tags).getSubMenu();
tagSubmenu.clear();
for(Tag tag : tags){
addTag(tagSubmenu, listener, tag);
}
}
代码示例来源:origin: billthefarmer/editor
sub.clear();
代码示例来源:origin: konradrenner/kolabnotes-android
public void overrideNotebooks(OnDrawerSelectionChangedListener listener, Collection<Notebook> notebooks){
final Menu overview = view.getMenu();
final SubMenu notebookSubmenu = overview.findItem(R.id.navigation_notebooks).getSubMenu();
notebookSubmenu.clear();
for(Notebook book : notebooks){
addNotebook(view.getContext(), notebookSubmenu, listener, book);
}
}
代码示例来源:origin: andresth/Kandroid
private void populateProjectsMenu() {
if (mProjectList == null) {
if (BuildConfig.DEBUG) Log.d("Kandroid", "Tried to populate drawer, but mDashboard was null");
return;
}
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this.getBaseContext());
List<KanboardProject> projList = mProjectList;
if (preferences.getBoolean("projects_sort_alphabetic", false))
Collections.sort(projList);
NavigationView nav = (NavigationView) findViewById(R.id.nav_view);
SubMenu projMenu = nav.getMenu().findItem(R.id.projects).getSubMenu();
projMenu.clear();
for (KanboardProject item: projList)
projMenu.add(Menu.NONE, item.getId(), Menu.NONE, item.getName())
.setIcon(R.drawable.project);
}
代码示例来源:origin: PuffOpenSource/Puff-Android
private void loadCategoriesInNavigation() {
categoriesMenu.clear();
for (Category category : CategoryHelper.getInstance(null).getAllCategory()) {
try {
categoriesMenu.add(category.getName()).setIcon(new BitmapDrawable(getResources(),
ResUtil.getInstance(null).getBmp(category.getIcon())));
} catch (IOException e) {
e.printStackTrace();
}
}
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.single_product, menu);
menu.addSubMenu(Menu.NONE, R.id.extra_options, Menu.NONE,"Menu1");
SubMenu themeMenu = menu.findItem(R.id.extra_options).getSubMenu();
themeMenu.clear();
themeMenu.add(0, R.id.theme_auto, Menu.NONE, "Automatic");
themeMenu.add(0, R.id.theme_day, Menu.NONE, "Default");
themeMenu.add(0, R.id.theme_night, Menu.NONE, "Night");
themeMenu.add(0, R.id.theme_batsave, Menu.NONE, "Battery Saving");
return true;
}
代码示例来源:origin: stackoverflow.com
super.onPrepareSubMenu(subMenu);
subMenu.clear();
代码示例来源:origin: Sea-n/Android-TG-Bot
final File dir = createDir();
if (subMenu.size() > 0) {
subMenu.clear();
代码示例来源:origin: stackoverflow.com
super.onPrepareSubMenu(subMenu);
subMenu.clear();
代码示例来源:origin: PrivacyApps/document-viewer
protected void createFileMenu(final ContextMenu menu, final String path) {
final BookSettings bs = SettingsManager.getBookSettings(path);
final MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.book_menu, menu);
menu.setHeaderTitle(path);
menu.findItem(R.id.bookmenu_recentgroup).setVisible(bs != null);
menu.findItem(R.id.bookmenu_openbookshelf).setVisible(false);
menu.findItem(R.id.bookmenu_openbookfolder).setVisible(false);
final MenuItem om = menu.findItem(R.id.bookmenu_open);
final SubMenu osm = om != null ? om.getSubMenu() : null;
if (osm == null) {
return;
}
osm.clear();
final List<Bookmark> list = new ArrayList<Bookmark>();
list.add(new Bookmark(true, getString(R.string.bookmark_start), PageIndex.FIRST, 0, 0));
list.add(new Bookmark(true, getString(R.string.bookmark_end), PageIndex.LAST, 0, 1));
if (bs != null) {
if (LengthUtils.isNotEmpty(bs.bookmarks)) {
list.addAll(bs.bookmarks);
}
list.add(new Bookmark(true, getString(R.string.bookmark_current), bs.currentPage, bs.offsetX, bs.offsetY));
}
Collections.sort(list);
for (final Bookmark b : list) {
addBookmarkMenuItem(osm, b);
}
}
代码示例来源:origin: PrivacyApps/document-viewer
return;
osm.clear();
代码示例来源:origin: stackoverflow.com
public void onPrepareSubMenu(SubMenu subMenu) {
subMenu.clear();
内容来源于网络,如有侵权,请联系作者删除!