diff options
-rw-r--r-- | res/values/strings.xml | 11 | ||||
-rw-r--r-- | src/com/android/camera/ImageGallery.java | 55 |
2 files changed, 44 insertions, 22 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index f80be7a..1bdb3a6 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -186,10 +186,13 @@ <string name="camera_crop">Crop</string> <!-- Toast after trying to share a picture indicating that there are no applications which are capable of so doing. --> - <string name="no_way_to_share_image">This picture cannot be shared.</string> + <string name="no_way_to_share_image">No application available to share the picture.</string> <!-- Toast after trying to share a video indicating that there are no applications which are capable of so doing. --> - <string name="no_way_to_share_video">This video cannot be shared.</string> + <string name="no_way_to_share_video">No application available to share the video.</string> + + <!-- Toast after trying to share multiple media files indicating that there are no applications which are capable of so doing. --> + <string name="no_way_to_share">No application available to share the media file(s).</string> <!-- Menu item for playing the video. --> <string name="video_play">Play</string> @@ -530,6 +533,10 @@ is to be sent to another application. --> <string name="sendVideo">Share video via</string> + <!-- Displayed in the title of the dialog for things to do with media files that + are to be sent to another application: --> + <string name="send_media_files">Share media files via</string> + <!-- Activity label. This might show up in the activity-picker --> <string name="movieviewlabel">Movies</string> <!-- shown in the video player view while the video is being loaded, before it starts playing --> diff --git a/src/com/android/camera/ImageGallery.java b/src/com/android/camera/ImageGallery.java index 0e749eb..6f0f801 100644 --- a/src/com/android/camera/ImageGallery.java +++ b/src/com/android/camera/ImageGallery.java @@ -1014,26 +1014,41 @@ public class ImageGallery extends Activity implements } private void onShareMultipleClicked() { - Intent intent = new Intent(); - intent.setAction(Intent.ACTION_SEND_MULTIPLE); - - String mimeType = getShareMultipleMimeType(); - intent.setType(mimeType); - ArrayList<Parcelable> list = new ArrayList<Parcelable>(); - for (IImage image : mMultiSelected) { - list.add(image.fullSizeImageUri()); - } - intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, list); - - boolean isImage = ImageManager.isImageMimeType(mimeType); - try { - startActivity(Intent.createChooser(intent, getText( - isImage ? R.string.sendImage : R.string.sendVideo))); - } catch (android.content.ActivityNotFoundException ex) { - Toast.makeText(this, isImage - ? R.string.no_way_to_share_image - : R.string.no_way_to_share_video, - Toast.LENGTH_SHORT).show(); + if (mMultiSelected.size() > 1) { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_SEND_MULTIPLE); + + String mimeType = getShareMultipleMimeType(); + intent.setType(mimeType); + ArrayList<Parcelable> list = new ArrayList<Parcelable>(); + for (IImage image : mMultiSelected) { + list.add(image.fullSizeImageUri()); + } + intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, list); + try { + startActivity(Intent.createChooser( + intent, getText(R.string.send_media_files))); + } catch (android.content.ActivityNotFoundException ex) { + Toast.makeText(this, R.string.no_way_to_share, + Toast.LENGTH_SHORT).show(); + } + } else if (mMultiSelected.size() == 1) { + IImage image = mMultiSelected.iterator().next(); + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_SEND); + String mimeType = image.getMimeType(); + intent.setType(mimeType); + intent.putExtra(Intent.EXTRA_STREAM, image.fullSizeImageUri()); + boolean isImage = ImageManager.isImage(image); + try { + startActivity(Intent.createChooser(intent, getText( + isImage ? R.string.sendImage : R.string.sendVideo))); + } catch (android.content.ActivityNotFoundException ex) { + Toast.makeText(this, isImage + ? R.string.no_way_to_share_image + : R.string.no_way_to_share_video, + Toast.LENGTH_SHORT).show(); + } } } |