Fix handling of the back key on Home in the gestures panel.

Previously, pressing back in a dialog on top of the gestures panel would
always dismiss the gestures panel. This is because the UP event for the
BACK key is sent to the underlying window after dismissing a dialog.
This fix simply checks for DOWN events only.
This commit is contained in:
Romain Guy
2009-06-17 10:28:43 -07:00
parent ded9ec91f6
commit c665672acb
+4 -1
View File
@@ -37,8 +37,11 @@ public class GesturesPanel extends RelativeLayout {
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK &&
event.getAction() == KeyEvent.ACTION_DOWN) {
((Launcher) mContext).hideGesturesPanel();
return true;
}