diff options
author | Dianne Hackborn <hackbod@google.com> | 2009-09-14 21:21:52 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2009-09-14 21:21:52 -0700 |
commit | 8d37426c754e9822feaa8c6cc0b7c13e8523e217 (patch) | |
tree | 188470dc3254756b9a6bc345f9cf39171a6b3725 /core/java/android/widget/ZoomButtonsController.java | |
parent | 83fe3f559249451706957b1a5f660b2b8272f114 (diff) | |
download | frameworks_base-8d37426c754e9822feaa8c6cc0b7c13e8523e217.zip frameworks_base-8d37426c754e9822feaa8c6cc0b7c13e8523e217.tar.gz frameworks_base-8d37426c754e9822feaa8c6cc0b7c13e8523e217.tar.bz2 |
Various fixed for back key handling.
My last change was far from perfect. Hopefully this gets us
a little closer.
Change-Id: I413e55b6af42400b565de3040859d25d668bc9d2
Diffstat (limited to 'core/java/android/widget/ZoomButtonsController.java')
-rw-r--r-- | core/java/android/widget/ZoomButtonsController.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/widget/ZoomButtonsController.java b/core/java/android/widget/ZoomButtonsController.java index a41e2e3..760b8ff 100644 --- a/core/java/android/widget/ZoomButtonsController.java +++ b/core/java/android/widget/ZoomButtonsController.java @@ -476,7 +476,21 @@ public class ZoomButtonsController implements View.OnTouchListener { if (isInterestingKey(keyCode)) { if (keyCode == KeyEvent.KEYCODE_BACK) { - setVisible(false); + if (event.getAction() == KeyEvent.ACTION_DOWN + && event.getRepeatCount() == 0) { + if (mOwnerView != null) { + KeyEvent.DispatcherState ds = mOwnerView.getKeyDispatcherState(); + if (ds != null) { + ds.startTracking(event, this); + } + } + return true; + } else if (event.getAction() == KeyEvent.ACTION_UP + && event.isTracking() && !event.isCanceled()) { + setVisible(false); + return true; + } + } else { dismissControlsDelayed(ZOOM_CONTROLS_TIMEOUT); } |