OSDN Git Service

Scroll to placeholder in gallery filmstrip launches camera
authorBobby Georgescu <georgescu@google.com>
Mon, 22 Oct 2012 20:49:35 +0000 (13:49 -0700)
committerBobby Georgescu <georgescu@google.com>
Mon, 22 Oct 2012 22:10:42 +0000 (15:10 -0700)
Bug: 7368079
Change-Id: I50323b6b4d64672486cdca785b9f1e1ae2f02a97

src/com/android/gallery3d/app/PhotoPage.java

index d6c8ef4..fb4e88b 100644 (file)
@@ -345,13 +345,22 @@ public class PhotoPage extends ActivityState implements
                                 mMediaSet.getMediaItemCount() > 1) {
                             mPhotoView.switchToImage(1);
                         } else {
-                            mPhotoView.setFilmMode(false);
+                            if (mAppBridge != null) mPhotoView.setFilmMode(false);
                             stayedOnCamera = true;
                         }
 
                         if (stayedOnCamera) {
-                            updateBars();
-                            updateCurrentPhoto(mModel.getMediaItem(0));
+                            if (mAppBridge == null) {
+                                GalleryUtils.startCameraActivity(mActivity);
+                                /* We got here by swiping from photo 1 to the
+                                   placeholder, so make it be the thing that
+                                   is in focus when the user presses back from
+                                   the camera app */
+                                mPhotoView.switchToImage(1);
+                            } else {
+                                updateBars();
+                                updateCurrentPhoto(mModel.getMediaItem(0));
+                            }
                         }
                         break;
                     }
@@ -579,6 +588,7 @@ public class PhotoPage extends ActivityState implements
 
     @Override
     public void onPictureCenter(boolean isCamera) {
+        isCamera = isCamera || (mInCameraRoll && mAppBridge == null);
         mPhotoView.setWantPictureCenterCallbacks(false);
         mHandler.removeMessages(MSG_ON_CAMERA_CENTER);
         mHandler.removeMessages(MSG_ON_PICTURE_CENTER);