Loading core/java/android/app/ActionBar.java +5 −0 Original line number Diff line number Diff line Loading @@ -1056,6 +1056,11 @@ public abstract class ActionBar { return false; } /** @hide */ public boolean onKeyShortcut(int keyCode, KeyEvent event) { return false; } /** @hide */ public boolean collapseActionView() { return false; Loading core/java/android/app/Activity.java +3 −1 Original line number Diff line number Diff line Loading @@ -2469,7 +2469,9 @@ public class Activity extends ContextThemeWrapper * @return True if the key shortcut was handled. */ public boolean onKeyShortcut(int keyCode, KeyEvent event) { return false; // Let the Action Bar have a chance at handling the shortcut. ActionBar actionBar = getActionBar(); return (actionBar != null && actionBar.onKeyShortcut(keyCode, event)); } /** Loading core/java/com/android/internal/app/ToolbarActionBar.java +12 −0 Original line number Diff line number Diff line Loading @@ -463,6 +463,18 @@ public class ToolbarActionBar extends ActionBar { return true; } @Override public boolean onKeyShortcut(int keyCode, KeyEvent event) { Menu menu = mDecorToolbar.getMenu(); if (menu != null) { menu.performShortcut(keyCode, event, 0); } // This action bar always returns true for handling keyboard shortcuts. // This will block the window from preparing a temporary panel to handle // keyboard shortcuts. return true; } public void addOnMenuVisibilityListener(OnMenuVisibilityListener listener) { mMenuVisibilityListeners.add(listener); } Loading Loading
core/java/android/app/ActionBar.java +5 −0 Original line number Diff line number Diff line Loading @@ -1056,6 +1056,11 @@ public abstract class ActionBar { return false; } /** @hide */ public boolean onKeyShortcut(int keyCode, KeyEvent event) { return false; } /** @hide */ public boolean collapseActionView() { return false; Loading
core/java/android/app/Activity.java +3 −1 Original line number Diff line number Diff line Loading @@ -2469,7 +2469,9 @@ public class Activity extends ContextThemeWrapper * @return True if the key shortcut was handled. */ public boolean onKeyShortcut(int keyCode, KeyEvent event) { return false; // Let the Action Bar have a chance at handling the shortcut. ActionBar actionBar = getActionBar(); return (actionBar != null && actionBar.onKeyShortcut(keyCode, event)); } /** Loading
core/java/com/android/internal/app/ToolbarActionBar.java +12 −0 Original line number Diff line number Diff line Loading @@ -463,6 +463,18 @@ public class ToolbarActionBar extends ActionBar { return true; } @Override public boolean onKeyShortcut(int keyCode, KeyEvent event) { Menu menu = mDecorToolbar.getMenu(); if (menu != null) { menu.performShortcut(keyCode, event, 0); } // This action bar always returns true for handling keyboard shortcuts. // This will block the window from preparing a temporary panel to handle // keyboard shortcuts. return true; } public void addOnMenuVisibilityListener(OnMenuVisibilityListener listener) { mMenuVisibilityListeners.add(listener); } Loading