summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2012-08-27 00:10:38 +0800
committerWu-cheng Li <wuchengli@google.com>2012-08-28 15:44:17 +0800
commit1cbddfcb7d1f5ab087a1ee0d2dc98331bd6d4998 (patch)
tree4207d0ddcaf43ea28771038b3b69bc1f8964c77e /src
parent862f237b9ccef1ed5a7b2e9e1b8d5d291709d7e0 (diff)
downloadandroid_packages_apps_Snap-1cbddfcb7d1f5ab087a1ee0d2dc98331bd6d4998.tar.gz
android_packages_apps_Snap-1cbddfcb7d1f5ab087a1ee0d2dc98331bd6d4998.tar.bz2
android_packages_apps_Snap-1cbddfcb7d1f5ab087a1ee0d2dc98331bd6d4998.zip
Disable action bar home button and menu items in secure album.
All menu items are disabled except delete. bug:5955016 Change-Id: Ibf947b0c50b0591a774d298fbfbe692c9a88575d
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 2d2375bd3..4b4817943 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -416,7 +416,8 @@ public class PhotoPage extends ActivityState implements
if (mShowDetails) {
mDetailsHelper.reloadDetails();
}
- if ((photo.getSupportedOperations() & MediaItem.SUPPORT_SHARE) != 0) {
+ if ((mSecureAlbum == null)
+ && (photo.getSupportedOperations() & MediaItem.SUPPORT_SHARE) != 0) {
updateShareURI(photo.getPath());
}
}
@@ -434,10 +435,12 @@ public class PhotoPage extends ActivityState implements
private void updateMenuOperations() {
MenuItem item = mActionBar.findMenuItem(R.id.action_slideshow);
- item.setVisible(canDoSlideShow());
+ item.setVisible((mSecureAlbum == null) && canDoSlideShow());
if (mCurrentPhoto == null) return;
int supportedOperations = mCurrentPhoto.getSupportedOperations();
- if (!GalleryUtils.isEditorAvailable((Context) mActivity, "image/*")) {
+ if (mSecureAlbum != null) {
+ supportedOperations = supportedOperations & MediaObject.SUPPORT_DELETE;
+ } else if (!GalleryUtils.isEditorAvailable(mActivity, "image/*")) {
supportedOperations &= ~MediaObject.SUPPORT_EDIT;
}
MenuExecutor.updateMenuOperation(mActionBar.getMenu(), supportedOperations);
@@ -659,7 +662,7 @@ public class PhotoPage extends ActivityState implements
return true;
}
case R.id.action_crop: {
- Activity activity = (Activity) mActivity;
+ Activity activity = mActivity;
Intent intent = new Intent(CropImage.CROP_ACTION);
intent.setClass(activity, CropImage.class);
intent.setData(manager.getContentUri(path));
@@ -706,7 +709,7 @@ public class PhotoPage extends ActivityState implements
new ImportCompleteListener(mActivity));
return true;
case R.id.action_share:
- Activity activity = (Activity) mActivity;
+ Activity activity = mActivity;
Intent intent = createShareIntent(mCurrentPhoto.getPath());
activity.startActivity(Intent.createChooser(intent,
activity.getString(R.string.share)));
@@ -750,8 +753,8 @@ public class PhotoPage extends ActivityState implements
return;
}
- boolean playVideo =
- (item.getSupportedOperations() & MediaItem.SUPPORT_PLAY) != 0;
+ boolean playVideo = (mSecureAlbum == null) &&
+ ((item.getSupportedOperations() & MediaItem.SUPPORT_PLAY) != 0);
if (playVideo) {
// determine if the point is at center (1/6) of the photo view.
@@ -763,7 +766,7 @@ public class PhotoPage extends ActivityState implements
}
if (playVideo) {
- playVideo((Activity) mActivity, item.getPlayUri(), item.getName());
+ playVideo(mActivity, item.getPlayUri(), item.getName());
} else {
toggleBars();
}
@@ -960,7 +963,8 @@ public class PhotoPage extends ActivityState implements
mModel.resume();
mPhotoView.resume();
- mActionBar.setDisplayOptions(mSetPathString != null, true);
+ mActionBar.setDisplayOptions(
+ ((mSecureAlbum == null) && (mSetPathString != null)), true);
mActionBar.addOnMenuVisibilityListener(mMenuVisibilityListener);
if (mAppBridge != null && !mHasActivityResult) {