android.support.v7.widget.Toolbar.isOverflowMenuShowing()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中android.support.v7.widget.Toolbar.isOverflowMenuShowing()方法的一些代码示例,展示了Toolbar.isOverflowMenuShowing()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolbar.isOverflowMenuShowing()方法的具体详情如下:
包路径:android.support.v7.widget.Toolbar
类名称:Toolbar
方法名:isOverflowMenuShowing

Toolbar.isOverflowMenuShowing介绍

暂无

代码示例

代码示例来源:origin: AEFeinstein/mtg-familiar

/**
 * Called when a key was released and not handled by any of the views inside of the activity.
 * So, for example, key presses while the cursor is inside a TextView will not trigger the event
 * (unless it is a navigation to another object) because TextView handles its own key presses.
 * The default implementation handles KEYCODE_BACK to stop the activity and go back.
 * This has a dinky workaround for LG phones
 *
 * @param keyCode The value in event.getKeyCode().
 * @param event   Description of the key event.
 * @return If you handled the event, return true. If you want to allow the event to be handled
 * by the next receiver, return false.
 */
@Override
public boolean onKeyUp(int keyCode, @NotNull KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_MENU) {
    Toolbar toolbar = findViewById(R.id.toolbar);
    if (toolbar != null) {
      if (toolbar.isOverflowMenuShowing()) {
        toolbar.dismissPopupMenus();
      } else {
        toolbar.showOverflowMenu();
      }
    }
    return true;
  }
  return super.onKeyUp(keyCode, event);
}

代码示例来源:origin: jbruchanov/AnUitor

result.put("Title", view.getTitle());
result.put("HasExpandedActionView", view.hasExpandedActionView());
result.put("IsOverflowMenuShowing", view.isOverflowMenuShowing());
result.put("ContentInsetEndWithActions", view.getContentInsetEndWithActions());
result.put("ContentInsetStartWithNavigation", view.getContentInsetStartWithNavigation());

相关文章

Toolbar类方法