mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
fix the warning when attaching multiple files: images are recoded, only videos are not
This commit is contained in:
@@ -93,12 +93,16 @@ public abstract class BaseConversationListFragment extends Fragment implements A
|
||||
if (isForwarding(getActivity())) {
|
||||
message = String.format(Util.getLocale(), getString(R.string.ask_forward_multiple), selectedChats.size());
|
||||
} else if (!uris.isEmpty()) {
|
||||
message = String.format(Util.getLocale(), getString(R.string.share_multiple_attachments_multiple_chats), uris.size(), selectedChats.size());
|
||||
message = String.format(Util.getLocale(), getString(R.string.ask_send_files_to_selected_chats), uris.size(), selectedChats.size());
|
||||
} else {
|
||||
message = String.format(Util.getLocale(), getString(R.string.share_text_multiple_chats), selectedChats.size(), getSharedText(getActivity()));
|
||||
}
|
||||
|
||||
Context context = getContext();
|
||||
if (context != null) {
|
||||
if (SendRelayedMessageUtil.containsVideoType(context, uris)) {
|
||||
message += "\n\n" + getString(R.string.videos_sent_without_recoding);
|
||||
}
|
||||
new AlertDialog.Builder(context)
|
||||
.setMessage(message)
|
||||
.setCancelable(false)
|
||||
|
||||
@@ -669,7 +669,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
ArrayList<Uri> uriList = RelayUtil.getSharedUris(this);
|
||||
int sharedContactId = RelayUtil.getSharedContactId(this);
|
||||
if (uriList.size() > 1) {
|
||||
String message = String.format(getString(R.string.share_multiple_attachments), uriList.size());
|
||||
String message = String.format(getString(R.string.ask_send_files_to_selected_chat), uriList.size());
|
||||
if (SendRelayedMessageUtil.containsVideoType(context, uriList)) {
|
||||
message += "\n\n" + getString(R.string.videos_sent_without_recoding);
|
||||
}
|
||||
new AlertDialog.Builder(this)
|
||||
.setMessage(message)
|
||||
.setCancelable(false)
|
||||
|
||||
@@ -74,6 +74,16 @@ public class SendRelayedMessageUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean containsVideoType(Context context, ArrayList<Uri> uris) {
|
||||
for (final Uri uri : uris) {
|
||||
final String mimeType = MediaUtil.getMimeType(context, uri);
|
||||
if (MediaUtil.isVideoType(mimeType)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static DcMsg createMessage(Context context, Uri uri, String text) throws NullPointerException {
|
||||
DcContext dcContext = DcHelper.getContext(context);
|
||||
DcMsg message;
|
||||
|
||||
Reference in New Issue
Block a user