From d5c545b45ac938dd358f0eb3af40a574a6e96a09 Mon Sep 17 00:00:00 2001 From: Angus Kong Date: Wed, 16 May 2012 19:15:56 -0700 Subject: Support Panorama preview. The panorama preview doesn't consider display rotation. bug:6305152 Change-Id: I6b87c18ed8eadf1b2bf5e64437c5b290d111cbba --- src/com/android/gallery3d/app/PhotoDataAdapter.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/com/android/gallery3d/app/PhotoDataAdapter.java') diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java index d88b72ca8..c92f7ed43 100644 --- a/src/com/android/gallery3d/app/PhotoDataAdapter.java +++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java @@ -147,6 +147,7 @@ public class PhotoDataAdapter implements PhotoPage.Model { private int mSize = 0; private Path mItemPath; private int mCameraIndex; + private boolean mIsPanorama; private boolean mIsActive; private boolean mNeedFullImage; @@ -164,12 +165,14 @@ public class PhotoDataAdapter implements PhotoPage.Model { // find the image being viewed. cameraIndex is the index of the camera // preview. If cameraIndex < 0, there is no camera preview. public PhotoDataAdapter(GalleryActivity activity, PhotoView view, - MediaSet mediaSet, Path itemPath, int indexHint, int cameraIndex) { + MediaSet mediaSet, Path itemPath, int indexHint, int cameraIndex, + boolean isPanorama) { mSource = Utils.checkNotNull(mediaSet); mPhotoView = Utils.checkNotNull(view); mItemPath = Utils.checkNotNull(itemPath); mCurrentIndex = indexHint; mCameraIndex = cameraIndex; + mIsPanorama = isPanorama; mThreadPool = activity.getThreadPool(); mNeedFullImage = true; @@ -428,6 +431,11 @@ public class PhotoDataAdapter implements PhotoPage.Model { return mCurrentIndex + offset == mCameraIndex; } + @Override + public boolean isPanorama(int offset) { + return isCamera(offset) && mIsPanorama; + } + @Override public boolean isVideo(int offset) { MediaItem item = getItem(mCurrentIndex + offset); -- cgit v1.2.3