summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/PhotoDataAdapter.java
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-04-26 10:10:49 +0800
committerChih-Chung Chang <chihchung@google.com>2012-04-30 16:16:26 +0800
commitbd141b5a51c96f6fcaddfa547f0928ce69cf0755 (patch)
tree61bfe751ed08445400977f7c2a2ec3092b43888c /src/com/android/gallery3d/app/PhotoDataAdapter.java
parent23a5e6f233f688f2e1ca2b10b5d1c615a263e83d (diff)
downloadandroid_packages_apps_Gallery2-bd141b5a51c96f6fcaddfa547f0928ce69cf0755.tar.gz
android_packages_apps_Gallery2-bd141b5a51c96f6fcaddfa547f0928ce69cf0755.tar.bz2
android_packages_apps_Gallery2-bd141b5a51c96f6fcaddfa547f0928ce69cf0755.zip
Support drawing in different orientation in Gallery.
Bug 6312994: Swipe UX: do not directly show the camera roll when camera starts Bug 6313191: Swipe UX: Change swipe direction after the user rotated the device Bug 6313192: Swiping UX: make Gallery display in rotated mode Bug 6399447: Filmstrip: in Gallery, pressing Back from filmstrip doesn't perform the right animation Bug 6399974: Filmstrip: when swiping from full-screen photo to filmstrip mode, camera view and the photo-roll don't align correctly Bug 6400014: Swiping UX: in Camera portrait mode, tapping on the Thumbnail doesn't align camera view and the photo-roll correctly Bug 6401075: Able to scroll through the gallery pics while capturing video. Bug 6405087: Filmstrip does not change with orientation Change-Id: I8c479d87800c63b7a95c199c0c1c3bc512d66d42
Diffstat (limited to 'src/com/android/gallery3d/app/PhotoDataAdapter.java')
-rw-r--r--src/com/android/gallery3d/app/PhotoDataAdapter.java26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java
index d0fde246f..86ef04d17 100644
--- a/src/com/android/gallery3d/app/PhotoDataAdapter.java
+++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java
@@ -143,6 +143,7 @@ public class PhotoDataAdapter implements PhotoPage.Model {
private long mSourceVersion = MediaObject.INVALID_DATA_VERSION;
private int mSize = 0;
private Path mItemPath;
+ private int mCameraIndex;
private boolean mIsActive;
private boolean mNeedFullImage;
@@ -158,12 +159,13 @@ public class PhotoDataAdapter implements PhotoPage.Model {
// If mItemPath is not null, mCurrentIndex is only a hint for where we
// can find the item. If mItemPath is null, then we use the mCurrentIndex to
// find the image being viewed.
- public PhotoDataAdapter(GalleryActivity activity,
- PhotoView view, MediaSet mediaSet, Path itemPath, int indexHint) {
+ public PhotoDataAdapter(GalleryActivity activity, PhotoView view,
+ MediaSet mediaSet, Path itemPath, int indexHint, int cameraIndex) {
mSource = Utils.checkNotNull(mediaSet);
mPhotoView = Utils.checkNotNull(view);
mItemPath = Utils.checkNotNull(itemPath);
mCurrentIndex = indexHint;
+ mCameraIndex = cameraIndex;
mThreadPool = activity.getThreadPool();
mNeedFullImage = true;
@@ -312,6 +314,7 @@ public class PhotoDataAdapter implements PhotoPage.Model {
}
private void updateCurrentIndex(int index) {
+ if (mCurrentIndex == index) return;
mCurrentIndex = index;
updateSlidingWindow();
@@ -330,18 +333,8 @@ public class PhotoDataAdapter implements PhotoPage.Model {
}
@Override
- public void next() {
- updateCurrentIndex(mCurrentIndex + 1);
- }
-
- @Override
- public void previous() {
- updateCurrentIndex(mCurrentIndex - 1);
- }
-
- @Override
- public void moveToFirst() {
- updateCurrentIndex(0);
+ public void moveTo(int index) {
+ updateCurrentIndex(index);
}
@Override
@@ -373,6 +366,11 @@ public class PhotoDataAdapter implements PhotoPage.Model {
mMainHandler.sendEmptyMessage(MSG_UPDATE_IMAGE_REQUESTS);
}
+ @Override
+ public boolean isCamera(int offset) {
+ return mCurrentIndex + offset == mCameraIndex;
+ }
+
public ScreenNail getScreenNail() {
return mTileProvider.getScreenNail();
}