Small improvements

master
M66B 3 months ago
parent 1d5fdf77e6
commit b48fde4540

@ -276,7 +276,7 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
break; break;
} }
if (!found) if (!found)
uris.add(new UriType(stream, streams.size() == 1 ? intent.getType() : null, this)); uris.add(new UriType(stream, intent.getType(), this));
} }
} }
} }

@ -393,7 +393,7 @@ public class FragmentCompose extends FragmentBase {
pickImages = pickImages =
registerForActivityResult(new ActivityResultContracts.PickMultipleVisualMedia(max), uris -> { registerForActivityResult(new ActivityResultContracts.PickMultipleVisualMedia(max), uris -> {
if (!uris.isEmpty()) if (!uris.isEmpty())
onAddImageFile(UriType.getList(uris, getContext()), false); onAddImageFile(UriType.getList(uris, null), false);
}); });
} }
@ -655,7 +655,7 @@ public class FragmentCompose extends FragmentBase {
int resize = prefs.getInt("resize", FragmentCompose.REDUCED_IMAGE_SIZE); int resize = prefs.getInt("resize", FragmentCompose.REDUCED_IMAGE_SIZE);
boolean resize_width_only = prefs.getBoolean("resize_width_only", false); boolean resize_width_only = prefs.getBoolean("resize_width_only", false);
onAddAttachment( onAddAttachment(
Arrays.asList(new UriType(uri, type, etBody.getContext())), Arrays.asList(new UriType(uri, type, null)),
true, true,
resize_paste ? resize : 0, resize_paste ? resize : 0,
resize_width_only, resize_width_only,
@ -3382,7 +3382,7 @@ public class FragmentCompose extends FragmentBase {
case REQUEST_TAKE_PHOTO: case REQUEST_TAKE_PHOTO:
if (resultCode == RESULT_OK) { if (resultCode == RESULT_OK) {
if (photoURI != null) if (photoURI != null)
onAddImageFile(Arrays.asList(new UriType(photoURI, (String) null, getContext())), false); onAddImageFile(Arrays.asList(new UriType(photoURI, (String) null, null)), false);
} }
break; break;
case REQUEST_ATTACHMENT: case REQUEST_ATTACHMENT:
@ -3961,7 +3961,7 @@ public class FragmentCompose extends FragmentBase {
if (result.size() == 0 && data.hasExtra("media-uri-list")) if (result.size() == 0 && data.hasExtra("media-uri-list"))
try { try {
List<Uri> uris = data.getParcelableArrayListExtra("media-uri-list"); List<Uri> uris = data.getParcelableArrayListExtra("media-uri-list");
result.addAll(UriType.getList(uris, getContext())); result.addAll(UriType.getList(uris, null));
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(ex);
} }

Loading…
Cancel
Save