Close floating panels on Launcher when using Escape
This change will make the Escape key close floating panels in Launcher. Bug: 280801803 Test: Flashed on device, tried with physical keyboard and panels will close. Change-Id: Ie09e57716a7be74638037abe6272b47eec1b8a6c
This commit is contained in:
@@ -3159,6 +3159,16 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
return super.onKeyShortcut(keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_ESCAPE) {
|
||||
// Close any open floating views.
|
||||
closeOpenViews();
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_MENU) {
|
||||
|
||||
Reference in New Issue
Block a user