Nick0703

NotificationPanel.java

Mar 20th, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. @Override
  2.     public boolean dispatchKeyEvent(KeyEvent event) {
  3.     final int keyCode = event.getKeyCode();
  4.         switch (keyCode) {
  5.             // We exclusively handle the back key by hiding this panel.
  6.             case KeyEvent.KEYCODE_BACK: {
  7.                 if (event.getAction() == KeyEvent.ACTION_UP) {
  8.                     mBar.animateCollapsePanels();
  9.                 }
  10.                 return true;
  11.             }
  12.             // We react to the home key but let the system handle it.
  13.             case KeyEvent.KEYCODE_HOME: {
  14.                 if (event.getAction() == KeyEvent.ACTION_UP) {
  15.                     mBar.animateCollapsePanels();
  16.                 }
  17.             } break;
  18.         }
  19.         return super.dispatchKeyEvent(event);
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment