diff options
| author | Bobby Georgescu <georgescu@google.com> | 2012-09-26 14:22:57 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-26 14:47:01 -0700 |
| commit | 833f775afc9515567dc5aaf0cafe20e006e77545 (patch) | |
| tree | 5fcc084e3ea278e7d4a3475002e668584a22f664 /src | |
| parent | 726cbd1af44cf7b0f795c4f0639b9b358be960c1 (diff) | |
| download | android_packages_apps_Gallery2-833f775afc9515567dc5aaf0cafe20e006e77545.tar.gz android_packages_apps_Gallery2-833f775afc9515567dc5aaf0cafe20e006e77545.tar.bz2 android_packages_apps_Gallery2-833f775afc9515567dc5aaf0cafe20e006e77545.zip | |
Fix behavior of up button in Camera app
Bug: 7233448
- Up button now goes to gallery root when appropriate.
Change-Id: Ib474335b2ac4139e7c5a213bda3efa481b24f224
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/app/AlbumPage.java | 4 | ||||
| -rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 10 | ||||
| -rw-r--r-- | src/com/android/gallery3d/util/GalleryUtils.java | 6 |
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); |
