diff options
author | Chih-Chung Chang <chihchung@google.com> | 2012-04-20 20:06:19 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2012-04-24 18:51:07 +0800 |
commit | 210934990196deeea0d19a148e85b3c1c136eb40 (patch) | |
tree | d21a9cc140ccf2d89bf8d8031442322be12c4aab /src/com/android/gallery3d/app/PhotoPage.java | |
parent | 337624b3d7a9eab0da9f2829f3f95ef5f101fefc (diff) | |
download | android_packages_apps_Snap-210934990196deeea0d19a148e85b3c1c136eb40.tar.gz android_packages_apps_Snap-210934990196deeea0d19a148e85b3c1c136eb40.tar.bz2 android_packages_apps_Snap-210934990196deeea0d19a148e85b3c1c136eb40.zip |
Add capture animation in Gallery.
Change-Id: Ibf95cc64f37a4518377e64124af6606c4f14cdaa
Diffstat (limited to 'src/com/android/gallery3d/app/PhotoPage.java')
-rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 6be302b24..6617ce668 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -403,11 +403,18 @@ public class PhotoPage extends ActivityState protected void onBackPressed() { if (mShowDetails) { hideDetails(); - } else { + } else if (!switchWithCaptureAnimation(-1)) { super.onBackPressed(); } } + // Switch to the previous or next picture using the capture animation. + // The offset is -1 to switch to the previous picture, 1 to switch to + // the next picture. + public boolean switchWithCaptureAnimation(int offset) { + return mPhotoView.switchWithCaptureAnimation(offset); + } + @Override protected boolean onCreateActionBar(Menu menu) { MenuInflater inflater = ((Activity) mActivity).getMenuInflater(); |