|
|
@ -1163,9 +1163,9 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
case REQUEST_TAKE_PHOTO:
|
|
|
|
case REQUEST_TAKE_PHOTO:
|
|
|
|
if (resultCode == RESULT_OK)
|
|
|
|
if (resultCode == RESULT_OK)
|
|
|
|
if (requestCode == REQUEST_TAKE_PHOTO)
|
|
|
|
if (requestCode == REQUEST_TAKE_PHOTO)
|
|
|
|
onAddMedia(new Intent().setData(photoURI), true);
|
|
|
|
onAddMedia(new Intent().setData(photoURI));
|
|
|
|
else if (data != null)
|
|
|
|
else if (data != null)
|
|
|
|
onAddMedia(data, false);
|
|
|
|
onAddMedia(data);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case REQUEST_ENCRYPT:
|
|
|
|
case REQUEST_ENCRYPT:
|
|
|
|
if (resultCode == RESULT_OK && data != null) {
|
|
|
|
if (resultCode == RESULT_OK && data != null) {
|
|
|
@ -1346,21 +1346,18 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
}.execute(this, args, "compose:attachment:add");
|
|
|
|
}.execute(this, args, "compose:attachment:add");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void onAddMedia(Intent data, boolean image) {
|
|
|
|
private void onAddMedia(Intent data) {
|
|
|
|
Log.i("Add media data=" + data);
|
|
|
|
|
|
|
|
Log.logExtras(data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ClipData clipData = data.getClipData();
|
|
|
|
ClipData clipData = data.getClipData();
|
|
|
|
if (clipData == null) {
|
|
|
|
if (clipData == null) {
|
|
|
|
Uri uri = data.getData();
|
|
|
|
Uri uri = data.getData();
|
|
|
|
if (uri != null)
|
|
|
|
if (uri != null)
|
|
|
|
onAddAttachment(uri, image);
|
|
|
|
onAddAttachment(uri, false);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
for (int i = 0; i < clipData.getItemCount(); i++) {
|
|
|
|
for (int i = 0; i < clipData.getItemCount(); i++) {
|
|
|
|
ClipData.Item item = clipData.getItemAt(i);
|
|
|
|
ClipData.Item item = clipData.getItemAt(i);
|
|
|
|
Uri uri = item.getUri();
|
|
|
|
Uri uri = item.getUri();
|
|
|
|
if (uri != null)
|
|
|
|
if (uri != null)
|
|
|
|
onAddAttachment(uri, image);
|
|
|
|
onAddAttachment(uri, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|