summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorChih-Chung Chang <>2009-03-27 16:07:25 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-27 16:07:25 -0700
commiteb9d8a271a8c16514cc75a0ba1c54cfcf5d311fd (patch)
tree8d4b6e98ccbfc016f680da05e97661ceb409e778 /src/com
parentd9deeb594acff415552eb0a80f902dd83196c344 (diff)
downloadLegacyCamera-eb9d8a271a8c16514cc75a0ba1c54cfcf5d311fd.zip
LegacyCamera-eb9d8a271a8c16514cc75a0ba1c54cfcf5d311fd.tar.gz
LegacyCamera-eb9d8a271a8c16514cc75a0ba1c54cfcf5d311fd.tar.bz2
AI 143170: am: CL 142872 Remove the share button if the image is shared from MMS.
This is based on CL 142524. Original author: chihchung Merged from: //branches/cupcake/... Automated import of CL 143170
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/MenuHelper.java9
-rw-r--r--src/com/android/camera/VideoCamera.java1
-rw-r--r--src/com/android/camera/ViewImage.java3
3 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java
index 17d3edb..a88f020 100644
--- a/src/com/android/camera/MenuHelper.java
+++ b/src/com/android/camera/MenuHelper.java
@@ -133,6 +133,14 @@ public class MenuHelper {
uri.getAuthority().equals("mms");
}
+ public static void enableShareMenuItem(Menu menu, boolean enabled) {
+ MenuItem item = menu.findItem(MENU_IMAGE_SHARE);
+ if (item != null) {
+ item.setVisible(enabled);
+ item.setEnabled(enabled);
+ }
+ }
+
static MenuItemsResult addImageMenuItems(
Menu menu,
int inclusions,
@@ -238,7 +246,6 @@ public class MenuHelper {
onInvoke.run(new MenuCallback() {
public void run(Uri u, ImageManager.IImage image) {
if (image == null) return;
- if (isMMSUri(u)) return;
if (!isImage && getImageFileSize(image) > SHARE_FILE_LENGTH_LIMIT ) {
Toast.makeText(activity,
R.string.too_large_to_attach, Toast.LENGTH_LONG).show();
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index c8d5f7d..186d827 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -295,7 +295,6 @@ public class VideoCamera extends Activity implements View.OnClickListener,
}
private void startShareVideoActivity() {
- if (MenuHelper.isMMSUri(mCurrentVideoUri)) return;
if (mCurrentVideoFileLength > SHARE_FILE_LENGTH_LIMIT) {
Toast.makeText(VideoCamera.this,
R.string.too_large_to_attach, Toast.LENGTH_LONG).show();
diff --git a/src/com/android/camera/ViewImage.java b/src/com/android/camera/ViewImage.java
index 5004774..f1f25b7 100644
--- a/src/com/android/camera/ViewImage.java
+++ b/src/com/android/camera/ViewImage.java
@@ -603,6 +603,9 @@ public class ViewImage extends Activity implements View.OnClickListener
mImageMenuRunnable.gettingReadyToOpen(menu, mAllImages.getImageAt(mCurrentPosition));
}
+ Uri uri = mAllImages.getImageAt(mCurrentPosition).fullSizeImageUri();
+ MenuHelper.enableShareMenuItem(menu, !MenuHelper.isMMSUri(uri));
+
return true;
}