summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/AlbumPage.java4
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java10
-rw-r--r--src/com/android/gallery3d/util/GalleryUtils.java6
3 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java
index 30682a115..a19798f2b 100644
--- a/src/com/android/gallery3d/app/AlbumPage.java
+++ b/src/com/android/gallery3d/app/AlbumPage.java
@@ -214,7 +214,9 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
}
private void onUpPressed() {
- if (mActivity.getStateManager().getStateCount() > 1) {
+ if (mInCameraApp) {
+ GalleryUtils.startGalleryActivity(mActivity);
+ } else if (mActivity.getStateManager().getStateCount() > 1) {
super.onBackPressed();
} else if (mParentMediaSetString != null) {
Bundle data = new Bundle(getData());
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 29211ffee..760c96d58 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -659,7 +659,8 @@ public class PhotoPage extends ActivityState implements
}
private void onUpPressed() {
- if (mStartInFilmstrip && !mPhotoView.getFilmMode()) {
+ if ((mStartInFilmstrip || mAppBridge != null)
+ && !mPhotoView.getFilmMode()) {
mPhotoView.setFilmMode(true);
return;
}
@@ -681,12 +682,7 @@ public class PhotoPage extends ActivityState implements
DataManager.INCLUDE_ALL));
mActivity.getStateManager().switchState(this, AlbumPage.class, data);
} else {
- // Start the real gallery activity to view the camera roll.
- Uri uri = Uri.parse("content://media/external/file?bucketId="
- + MediaSetUtils.CAMERA_BUCKET_ID);
- Intent intent = new Intent(Intent.ACTION_VIEW);
- intent.setDataAndType(uri, ContentResolver.CURSOR_DIR_BASE_TYPE + "/image");
- ((Activity) mActivity).startActivity(intent);
+ GalleryUtils.startGalleryActivity(mActivity);
}
}
diff --git a/src/com/android/gallery3d/util/GalleryUtils.java b/src/com/android/gallery3d/util/GalleryUtils.java
index f04a5ccff..6639c55f0 100644
--- a/src/com/android/gallery3d/util/GalleryUtils.java
+++ b/src/com/android/gallery3d/util/GalleryUtils.java
@@ -37,6 +37,7 @@ import android.util.Log;
import android.view.WindowManager;
import com.android.gallery3d.R;
+import com.android.gallery3d.app.Gallery;
import com.android.gallery3d.app.PackagesMonitor;
import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.data.DataManager;
@@ -240,6 +241,11 @@ public class GalleryUtils {
context.startActivity(intent);
}
+ public static void startGalleryActivity(Context context) {
+ Intent intent = new Intent(context, Gallery.class);
+ context.startActivity(intent);
+ }
+
public static boolean isValidLocation(double latitude, double longitude) {
// TODO: change || to && after we fix the default location issue
return (latitude != MediaItem.INVALID_LATLNG || longitude != MediaItem.INVALID_LATLNG);