diff options
| author | Wu-cheng Li <wuchengli@google.com> | 2012-04-18 17:10:02 +0800 |
|---|---|---|
| committer | Wu-cheng Li <wuchengli@google.com> | 2012-04-18 19:51:38 +0800 |
| commit | 014d9586d8145a33f4e99eaad570587f6d650026 (patch) | |
| tree | 5007215f64e76bdaa01014a87bc0d0faf1bc223a | |
| parent | 29763f7a278c5d894f3590db1809c56e5a2b9a0a (diff) | |
| download | android_packages_apps_Gallery2-014d9586d8145a33f4e99eaad570587f6d650026.tar.gz android_packages_apps_Gallery2-014d9586d8145a33f4e99eaad570587f6d650026.tar.bz2 android_packages_apps_Gallery2-014d9586d8145a33f4e99eaad570587f6d650026.zip | |
Add page tap listener.
Camera needs this for touch focus and video snapshot.
bug:6313318
Change-Id: Ie0b8129160c2a79d4b20fab2173027cddfee7a79
| -rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 8797f84e5..2bdf970d3 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -103,6 +103,7 @@ public class PhotoPage extends ActivityState private boolean mShowBars = true; private GalleryActionBar mActionBar; private MyMenuVisibilityListener mMenuVisibilityListener; + private PageTapListener mPageTapListener; private boolean mIsMenuVisible; private boolean mIsInteracting; private MediaItem mCurrentPhoto = null; @@ -131,6 +132,15 @@ public class PhotoPage extends ActivityState } } + public interface PageTapListener { + // Return true if the tap is consumed. + public boolean onSingleTapUp(int x, int y); + } + + public void setPageTapListener(PageTapListener listener) { + mPageTapListener = listener; + } + private final GLView mRootPane = new GLView() { @Override @@ -515,6 +525,10 @@ public class PhotoPage extends ActivityState } public void onSingleTapUp(int x, int y) { + if (mPageTapListener != null) { + if (mPageTapListener.onSingleTapUp(x, y)) return; + } + MediaItem item = mModel.getCurrentMediaItem(); if (item == null) { // item is not ready, ignore |
