本文整理汇总了Java中android.view.Menu.setGroupVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Menu.setGroupVisible方法的具体用法?Java Menu.setGroupVisible怎么用?Java Menu.setGroupVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.Menu
的用法示例。
在下文中一共展示了Menu.setGroupVisible方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPrepareOptionsMenu
import android.view.Menu; //导入方法依赖的package包/类
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
if (mState == STATE_EDIT) {
menu.setGroupVisible(R.id.menu_group_edit, true);
menu.setGroupVisible(R.id.menu_group_insert, false);
// Check if note has changed and enable/disable the revert option
String savedNote = mCursor.getString(COLUMN_INDEX_NOTE);
String currentNote = mText.getText().toString();
if (savedNote.equals(currentNote)) {
menu.findItem(R.id.menu_revert).setEnabled(false);
} else {
menu.findItem(R.id.menu_revert).setEnabled(true);
}
} else {
menu.setGroupVisible(R.id.menu_group_edit, false);
menu.setGroupVisible(R.id.menu_group_insert, true);
}
return super.onPrepareOptionsMenu(menu);
}
示例2: onCreateOptionsMenu
import android.view.Menu; //导入方法依赖的package包/类
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.setGroupVisible(R.id.main_menu_group_share, true);
final ShareActionProvider shareActionProvider = (ShareActionProvider) menu.findItem(R.id.menu_share).getActionProvider();
shareActionProvider.setShareIntent(getShareIntent());
shareActionProvider.setOnShareTargetSelectedListener(new OnShareTargetSelectedListener() {
@Override
public boolean onShareTargetSelected(ShareActionProvider actionProvider, Intent intent) {
Analytics.getInstance().logEvent(TAG, "share","");
takeScreenShotWithCheck();
return false;
}
});
}
示例3: accept
import android.view.Menu; //导入方法依赖的package包/类
@Override
public void accept(UserInfo userInfo) throws Exception {
if (!userInfo.getNotice()) {
ToastUtils.showShort(R.string.new_reply);
}
View notice_badge = navigationView.getMenu().findItem(R.id.nav_notice).getActionView();
notice_badge.setVisibility(!userInfo.getNotice() ? View.VISIBLE : View.INVISIBLE);
if (UserState.isLogin()) {
return;
}
if (userInfo.getUsername() != null) {
UserState.setLogin(true);
UserState.setUserInfo(userInfo);
Glide.with(context).load(userInfo.getAvatar()).into(nav_avatar);
nav_username.setText(userInfo.getUsername());
if (!userInfo.getSign()) {
ApiManager.getDefault().Signin();
}
} else {
nav_username.setText(R.string.not_log_in);
}
Menu menu = navigationView.getMenu();
menu.setGroupVisible(R.id.user_root, UserState.isLogin());
menu.findItem(R.id.nav_login).setVisible(!UserState.isLogin());
menu.findItem(R.id.nav_logout).setVisible(UserState.isLogin());
fab.setVisibility(UserState.isLogin() ? View.VISIBLE : View.INVISIBLE);
}
示例4: hideSubMenu
import android.view.Menu; //导入方法依赖的package包/类
private void hideSubMenu(Menu menu) {
// Check if there is at least one video file in the current folder
boolean video = false;
if (mItemList != null) {
for (Object itemData : mItemList) {
if (itemData instanceof Video) {
video = true;
break;
}
}
}
menu.setGroupVisible(MENU_SUBLOADER_GROUP, video);
}
示例5: onCreateOptionsMenu
import android.view.Menu; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.finalizar_menu, menu);
if(pedido.finalizado == 0)
menu.setGroupVisible(R.id.group_finalizar, true);
else
menu.setGroupVisible(R.id.group_reabrir, true);
return true;
}
示例6: onPrepareOptionsMenu
import android.view.Menu; //导入方法依赖的package包/类
@Override
public void onPrepareOptionsMenu(Menu menu) {
//hiding overflow menu
menu.setGroupVisible(R.id.menu_overflow, false);
super.onPrepareOptionsMenu(menu);
}
示例7: onCreateOptionsMenu
import android.view.Menu; //导入方法依赖的package包/类
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
// Not possible to share anything from this fragment
menu.setGroupVisible(R.id.main_menu_group_share, false);
}
示例8: onCreateOptionsMenu
import android.view.Menu; //导入方法依赖的package包/类
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.setGroupVisible(R.id.manage_book_group, false);
}
示例9: onPrepareOptionsMenu
import android.view.Menu; //导入方法依赖的package包/类
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
menu.setGroupVisible(MENU_HIDE_WATCHED_GROUP, mHideOption);
}