diff options
author | lihai <lihai@codeaurora.org> | 2015-08-20 08:54:29 +0800 |
---|---|---|
committer | Michael Bestas <mikeioannina@gmail.com> | 2016-12-30 20:34:16 +0200 |
commit | e2ffe2e98caddf47fce8cda4727dea567b44be6c (patch) | |
tree | 9515b7284d571860cbf3566cc4e3c1922c1f123d /src | |
parent | e1f95f864b6ef1937706b6a4ecbcc8f49ecca31a (diff) | |
download | android_packages_apps_Gallery2-e2ffe2e98caddf47fce8cda4727dea567b44be6c.tar.gz android_packages_apps_Gallery2-e2ffe2e98caddf47fce8cda4727dea567b44be6c.tar.bz2 android_packages_apps_Gallery2-e2ffe2e98caddf47fce8cda4727dea567b44be6c.zip |
Gallery2: cut some menu items if current page is single item
There is no need to show those items in the menu when we
view this picture in the Mms
Cut some menu items if current page is single item
Change-Id: Ifc04b80d844e1cd424c7b091d0933101194fc711
CRs-Fixed: 889082
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/app/GalleryActivity.java | 2 | ||||
-rwxr-xr-x | src/com/android/gallery3d/app/PhotoPage.java | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/GalleryActivity.java b/src/com/android/gallery3d/app/GalleryActivity.java index 2d39f3c73..286f2e641 100644 --- a/src/com/android/gallery3d/app/GalleryActivity.java +++ b/src/com/android/gallery3d/app/GalleryActivity.java @@ -303,7 +303,7 @@ public final class GalleryActivity extends AbstractGalleryActivity implements On data.putBoolean(PhotoPage.KEY_TREAT_BACK_AS_UP, true); } } - + data.putBoolean("SingleItemOnly", singleItemOnly); getStateManager().startState(SinglePhotoPage.class, data); } } diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 4e2b4aee5..f31e188a1 100755 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -832,6 +832,16 @@ public abstract class PhotoPage extends ActivityState implements if (!mHaveImageEditor) { supportedOperations &= ~MediaObject.SUPPORT_EDIT; } + // If current photo page is single item only, to cut some menu items + boolean singleItemOnly = mData.getBoolean("SingleItemOnly", false); + if (singleItemOnly) { + supportedOperations &= ~MediaObject.SUPPORT_DELETE; + supportedOperations &= ~MediaObject.SUPPORT_ROTATE; + supportedOperations &= ~MediaObject.SUPPORT_SHARE; + supportedOperations &= ~MediaObject.SUPPORT_CROP; + supportedOperations &= ~MediaObject.SUPPORT_INFO; + supportedOperations &= ~MediaObject.SUPPORT_SETAS; + } } MenuExecutor.updateMenuOperation(menu, supportedOperations); } |