本文整理了Java中android.view.SubMenu.setGroupCheckable()
方法的一些代码示例,展示了SubMenu.setGroupCheckable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SubMenu.setGroupCheckable()
方法的具体详情如下:
包路径:android.view.SubMenu
类名称:SubMenu
方法名:setGroupCheckable
暂无
代码示例来源:origin: alexvasilkov/GestureViews
private <T> void addSubMenu(Menu menu, T[] items, T selected, @StringRes int titleId) {
SubMenu sub = menu.addSubMenu(titleId);
sub.setGroupCheckable(Menu.NONE, true, true);
for (int i = 0; i < items.length; i++) {
MenuItem item = sub.add(Menu.NONE, titleId, i, items[i].toString());
item.setCheckable(true);
item.setChecked(items[i] == selected);
}
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.optionsmenu, menu);
SubMenu menu4 = menu.addSubMenu(Menu.NONE, MENU4, 4,"Menu No. 4");
menu4.add(GROUP1, SUBMENU1, 1, "SubMenu No. 1");
menu4.add(GROUP1, SUBMENU2, 2, "SubMenu No. 2");
menu4.setGroupCheckable(GROUP1,true,true);
return true;
}
代码示例来源:origin: stackoverflow.com
Menu menu = navigationView.getMenu();
MenuItem menuItem = menu.getItem(0);
SubMenu subMenu = menuItem.getSubMenu();
subMenu.add(R.id.gr, Menu.NONE, 2, "A2");
subMenu.setGroupCheckable(R.id.gr, true, true);
代码示例来源:origin: towavephone/MemoryCleaner
@Override public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_ignore_setting, menu);
SubMenu subMenu = menu.addSubMenu(GROUP_ID, BASE_ID, 0, "排序");
subMenu.setIcon(R.drawable.ic_sort_white_24dp);
subMenu.add(GROUP_ID + 1, BASE_ID + 1, 0, "应用名");
subMenu.add(GROUP_ID + 1, BASE_ID + 2, 1, "选中");
subMenu.add(GROUP_ID + 2, BASE_ID + 3, 2, "降序")
.setCheckable(true)
.setChecked(true);
subMenu.setGroupCheckable(GROUP_ID + 1, true, true);
mMenuItem = menu.findItem(R.id.allcheck);
ActionItemBadge.update(this, mMenuItem, FontAwesome.Icon.faw_check,
ActionItemBadge.BadgeStyles.DARK_GREY, 0);
return true;
}
代码示例来源:origin: towavephone/MemoryCleaner
@Override public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_memory_clean, menu);
SubMenu subMenu = menu.addSubMenu(GROUP_ID, BASE_ID, 0, "排序");
subMenu.setIcon(R.drawable.ic_sort_white_24dp);
subMenu.add(GROUP_ID + 1, BASE_ID + 1, 0, "应用名");
subMenu.add(GROUP_ID + 1, BASE_ID + 2, 1, "大小");
subMenu.add(GROUP_ID + 1, BASE_ID + 3, 2, "选中");
subMenu.add(GROUP_ID + 2, BASE_ID + 4, 3, "降序")
.setCheckable(true)
.setChecked(true);
subMenu.setGroupCheckable(GROUP_ID + 1, true, true);
mMenuItem = menu.findItem(R.id.allcheck);
ActionItemBadge.update(this, mMenuItem, FontAwesome.Icon.faw_check,
ActionItemBadge.BadgeStyles.DARK_GREY, 0);
return true;
}
代码示例来源:origin: 8enet/AppOpsX
userSub.setGroupCheckable(R.id.action_users,true,true);
代码示例来源:origin: stackoverflow.com
sub.setGroupCheckable(R.id.locale, true, true);
if(this.countryCode.equals("uk"))
代码示例来源:origin: com.actionbarsherlock/actionbarsherlock
nativeSub.setGroupCheckable(subItem.getGroupId(), true, true);
代码示例来源:origin: com.willowtreeapps/oak-demos
nativeSub.setGroupCheckable(subItem.getGroupId(), true, true);
内容来源于网络,如有侵权,请联系作者删除!