Merge "Allow ToolbarActionBar to pass-through unhandled keyShortcuts" into oc-dev
This commit is contained in:
@@ -2740,6 +2740,10 @@ public class Activity extends ContextThemeWrapper
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else if (keyCode == KeyEvent.KEYCODE_TAB) {
|
||||
// Don't consume TAB here since it's used for navigation. Arrow keys
|
||||
// aren't considered "typing keys" so they already won't get consumed.
|
||||
return false;
|
||||
} else {
|
||||
// Common code for DEFAULT_KEYS_DIALER & DEFAULT_KEYS_SEARCH_*
|
||||
boolean clearSpannable = false;
|
||||
|
||||
@@ -477,12 +477,9 @@ public class ToolbarActionBar extends ActionBar {
|
||||
final KeyCharacterMap kmap = KeyCharacterMap.load(
|
||||
event != null ? event.getDeviceId() : KeyCharacterMap.VIRTUAL_KEYBOARD);
|
||||
menu.setQwertyMode(kmap.getKeyboardType() != KeyCharacterMap.NUMERIC);
|
||||
menu.performShortcut(keyCode, event, 0);
|
||||
return 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;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -525,6 +522,17 @@ public class ToolbarActionBar extends ActionBar {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreatePanelView(int featureId) {
|
||||
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
|
||||
// This gets called by PhoneWindow.preparePanel. Since this already manages
|
||||
// its own panel, we return a dummy view here to prevent PhoneWindow from
|
||||
// preparing a default one.
|
||||
return new View(mDecorToolbar.getContext());
|
||||
}
|
||||
return super.onCreatePanelView(featureId);
|
||||
}
|
||||
}
|
||||
|
||||
private final class ActionMenuPresenterCallback implements MenuPresenter.Callback {
|
||||
|
||||
Reference in New Issue
Block a user