List of usage examples for android.view Menu FLAG_PERFORM_NO_CLOSE
int FLAG_PERFORM_NO_CLOSE
To view the source code for android.view Menu FLAG_PERFORM_NO_CLOSE.
Click Source Link
From source file:android.support.v7.app.AppCompatDelegateImplV7.java
@Override boolean onKeyShortcut(int keyCode, KeyEvent ev) { // Let the Action Bar have a chance at handling the shortcut ActionBar ab = getSupportActionBar(); if (ab != null && ab.onKeyShortcut(keyCode, ev)) { return true; }/*from ww w.ja v a2 s .c o m*/ // If the panel is already prepared, then perform the shortcut using it. boolean handled; if (mPreparedPanel != null) { handled = performPanelShortcut(mPreparedPanel, ev.getKeyCode(), ev, Menu.FLAG_PERFORM_NO_CLOSE); if (handled) { if (mPreparedPanel != null) { mPreparedPanel.isHandled = true; } return true; } } // If the panel is not prepared, then we may be trying to handle a shortcut key // combination such as Control+C. Temporarily prepare the panel then mark it // unprepared again when finished to ensure that the panel will again be prepared // the next time it is shown for real. if (mPreparedPanel == null) { PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, true); preparePanel(st, ev); handled = performPanelShortcut(st, ev.getKeyCode(), ev, Menu.FLAG_PERFORM_NO_CLOSE); st.isPrepared = false; if (handled) { return true; } } return false; }
From source file:android.support.v7.app.AppCompatDelegateImplV7.java
private boolean performPanelShortcut(PanelFeatureState st, int keyCode, KeyEvent event, int flags) { if (event.isSystem()) { return false; }//from www . j a v a2 s . c om boolean handled = false; // Only try to perform menu shortcuts if preparePanel returned true (possible false // return value from application not wanting to show the menu). if ((st.isPrepared || preparePanel(st, event)) && st.menu != null) { // The menu is prepared now, perform the shortcut on it handled = st.menu.performShortcut(keyCode, event, flags); } if (handled) { // Only close down the menu if we don't have an action bar keeping it open. if ((flags & Menu.FLAG_PERFORM_NO_CLOSE) == 0 && mDecorContentParent == null) { closePanel(st, true); } } return handled; }