summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java14
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