private int mSize = 0;
private Path mItemPath;
private int mCameraIndex;
+ private boolean mIsPanorama;
private boolean mIsActive;
private boolean mNeedFullImage;
// 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;
}
@Override
+ public boolean isPanorama(int offset) {
+ return isCamera(offset) && mIsPanorama;
+ }
+
+ @Override
public boolean isVideo(int offset) {
MediaItem item = getItem(mCurrentIndex + offset);
return (item == null)
}
PhotoDataAdapter pda = new PhotoDataAdapter(
mActivity, mPhotoView, mMediaSet, itemPath, mCurrentIndex,
- mAppBridge == null ? -1 : 0);
+ mAppBridge == null ? -1 : 0,
+ mAppBridge == null ? false : mAppBridge.isPanorama());
mModel = pda;
mPhotoView.setModel(mModel);
// Returns true if the item is the Camera preview.
public boolean isCamera(int offset);
+ // Returns true if the item is the Panorama.
+ public boolean isPanorama(int offset);
+
// Returns true if the item is a Video.
public boolean isVideo(int offset);
}
return (mCompensation - mDisplayRotation + 360) % 360;
}
+ private int getPanoramaRotation() {
+ return mCompensation;
+ }
+
////////////////////////////////////////////////////////////////////////////
// Pictures
////////////////////////////////////////////////////////////////////////////
class FullPicture implements Picture {
private int mRotation;
private boolean mIsCamera;
+ private boolean mIsPanorama;
private boolean mIsVideo;
private boolean mWasCameraCenter;
mTileView.notifyModelInvalidated();
mIsCamera = mModel.isCamera(0);
+ mIsPanorama = mModel.isPanorama(0);
mIsVideo = mModel.isVideo(0);
setScreenNail(mModel.getScreenNail(0));
updateSize(false);
@Override
public void updateSize(boolean force) {
- if (mIsCamera) {
+ if (mIsPanorama) {
+ mRotation = getPanoramaRotation();
+ } else if (mIsCamera) {
mRotation = getCameraRotation();
} else {
mRotation = mModel.getImageRotation(0);
private ScreenNail mScreenNail;
private Size mSize = new Size();
private boolean mIsCamera;
+ private boolean mIsPanorama;
private boolean mIsVideo;
public ScreenNailPicture(int index) {
@Override
public void reload() {
mIsCamera = mModel.isCamera(mIndex);
+ mIsPanorama = mModel.isPanorama(mIndex);
mIsVideo = mModel.isVideo(mIndex);
setScreenNail(mModel.getScreenNail(mIndex));
}
@Override
public void updateSize(boolean force) {
- if (mIsCamera) {
+ if (mIsPanorama) {
+ mRotation = getPanoramaRotation();
+ } else if (mIsCamera) {
mRotation = getCameraRotation();
} else {
mRotation = mModel.getImageRotation(mIndex);