Warn when forwarding if not all attachments are downloaded

Fixes #137
pull/145/head
M66B 6 years ago
parent 2888217c29
commit 1226acd11a

@ -729,9 +729,40 @@ public class FragmentMessage extends FragmentEx {
}
private void onMenuForward() {
startActivity(new Intent(getContext(), ActivityCompose.class)
.putExtra("action", "forward")
.putExtra("reference", message.id));
Bundle args = new Bundle();
args.putLong("id", message.id);
new SimpleTask<Boolean>() {
@Override
protected Boolean onLoad(Context context, Bundle args) {
long id = args.getLong("id");
List<EntityAttachment> attachments = DB.getInstance(context).attachment().getAttachments(id);
for (EntityAttachment attachment : attachments)
if (!attachment.available)
return false;
return true;
}
@Override
protected void onLoaded(Bundle args, Boolean available) {
final Intent forward = new Intent(getContext(), ActivityCompose.class)
.putExtra("action", "forward")
.putExtra("reference", message.id);
if (available)
startActivity(forward);
else
new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner())
.setMessage(R.string.title_attachment_unavailable)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startActivity(forward);
}
})
.setNegativeButton(android.R.string.cancel, null)
.show();
}
}.load(this, args);
}
private void onMenuReplyAll() {

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -176,6 +176,7 @@
<string name="title_moving">نقل الرسالة إلى %1$s</string>
<string name="title_no_viewer">لا يوجد عارض التطبيق متاح ل %1$s</string>
<string name="title_attachment_saved">حفظ المرفقات</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">هل تريد حذف الرسالة بشكل دائم؟</string>
<string name="title_ask_spam">رسالة التقرير كالبريد المزعج؟</string>
<string name="title_compose">إنشاء</string>

@ -176,6 +176,7 @@
<string name="title_moving">نقل الرسالة إلى %1$s</string>
<string name="title_no_viewer">لا يوجد عارض التطبيق متاح ل %1$s</string>
<string name="title_attachment_saved">حفظ المرفقات</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">هل تريد حذف الرسالة بشكل دائم؟</string>
<string name="title_ask_spam">رسالة التقرير كالبريد المزعج؟</string>
<string name="title_compose">إنشاء</string>

@ -176,6 +176,7 @@
<string name="title_moving">نقل الرسالة إلى %1$s</string>
<string name="title_no_viewer">لا يوجد عارض التطبيق متاح ل %1$s</string>
<string name="title_attachment_saved">حفظ المرفقات</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">هل تريد حذف الرسالة بشكل دائم؟</string>
<string name="title_ask_spam">رسالة التقرير كالبريد المزعج؟</string>
<string name="title_compose">إنشاء</string>

@ -176,6 +176,7 @@
<string name="title_moving">نقل الرسالة إلى %1$s</string>
<string name="title_no_viewer">لا يوجد عارض التطبيق متاح ل %1$s</string>
<string name="title_attachment_saved">حفظ المرفقات</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">هل تريد حذف الرسالة بشكل دائم؟</string>
<string name="title_ask_spam">رسالة التقرير كالبريد المزعج؟</string>
<string name="title_compose">إنشاء</string>

@ -176,6 +176,7 @@
<string name="title_moving">نقل الرسالة إلى %1$s</string>
<string name="title_no_viewer">لا يوجد عارض التطبيق متاح ل %1$s</string>
<string name="title_attachment_saved">حفظ المرفقات</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">هل تريد حذف الرسالة بشكل دائم؟</string>
<string name="title_ask_spam">رسالة التقرير كالبريد المزعج؟</string>
<string name="title_compose">إنشاء</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -168,6 +168,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">Flytter besked til %1$s</string>
<string name="title_no_viewer">Ingen viewer app til rådighed for %1$s</string>
<string name="title_attachment_saved">Vedhæftet fil gemt</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Slet meddelelsen permanent?</string>
<string name="title_ask_spam">Rapportér meddelelse som spam?</string>
<string name="title_compose">Ny meddelelse</string>

@ -160,6 +160,7 @@
<string name="title_moving">Verschiebe E-Mail nach %1$s</string>
<string name="title_no_viewer">Keine App zum Betrachten von %1$s</string>
<string name="title_attachment_saved">Anhang gespeichert</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">E-Mail dauerhaft löschen?</string>
<string name="title_ask_spam">Nachricht als Spam melden?</string>
<string name="title_compose">Verfassen</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moviendo mensaje a %1$s</string>
<string name="title_no_viewer">No hay app disponible para visualizar %1$s</string>
<string name="title_attachment_saved">Adjunto guardado</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">¿Eliminar mensaje permanentemente?</string>
<string name="title_ask_spam">¿Reportar mensaje como spam?</string>
<string name="title_compose">Redactar</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">Déplacement du message vers %1$s</string>
<string name="title_no_viewer">Aucune application disponible pour visionner %1$s</string>
<string name="title_attachment_saved">Pièce jointe enregistrée</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Supprimer ce message définitivement ?</string>
<string name="title_ask_spam">Signaler le message comme spam ?</string>
<string name="title_compose">Rédiger</string>

@ -168,6 +168,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">Spostamento messaggio in %1$s</string>
<string name="title_no_viewer">Nessuna app di visualizzazione disponibile per %1$s</string>
<string name="title_attachment_saved">Allegato salvato</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Eliminare il messaggio permanentemente?</string>
<string name="title_ask_spam">Segnalare il messaggio come posta indesiderata?</string>
<string name="title_compose">Scrivi</string>

@ -168,6 +168,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -156,6 +156,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -156,6 +156,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -168,6 +168,7 @@
<string name="title_moving">Przenoszenie wiadomości do %1$s</string>
<string name="title_no_viewer">Brak aplikacji do podglądu %1$s</string>
<string name="title_attachment_saved">Załącznik zapisany</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Usunąć wiadomość bezpowrotnie?</string>
<string name="title_ask_spam">Zgłosić wiadomość jako spam?</string>
<string name="title_compose">Napisz</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Deletar mensagem permanentemente?</string>
<string name="title_ask_spam">Reportar mensagem com spam?</string>
<string name="title_compose">Escrever</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -164,6 +164,7 @@
<string name="title_moving">Mesajul se mută în %1$s</string>
<string name="title_no_viewer">Nici o aplicație nu poate deschide %1$s</string>
<string name="title_attachment_saved">Atașament salvat</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Ștergeți definitiv mesajul?</string>
<string name="title_ask_spam">Raportați mesajul drept spam?</string>
<string name="title_compose">Compune</string>

@ -168,6 +168,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -164,6 +164,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -160,6 +160,7 @@
<string name="title_moving">İleti şuraya taşınıyor %1$s</string>
<string name="title_no_viewer">%1$s için kullanılabilir hiçbir görüntüleme uygulaması yok</string>
<string name="title_attachment_saved">Ek kaydedildi</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">İletiyi kalıcı olarak sil?</string>
<string name="title_ask_spam">İletiyi spam olarak raporla?</string>
<string name="title_compose">Oluştur</string>

@ -168,6 +168,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -156,6 +156,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -156,6 +156,7 @@
<string name="title_moving">移动邮件至%1$s</string>
<string name="title_no_viewer">未找到能打开%1$s的应用程序</string>
<string name="title_attachment_saved">附件已保存</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">确定要永久删除邮件吗?</string>
<string name="title_ask_spam">确定将邮件标为垃圾邮件吗?</string>
<string name="title_compose">新邮件</string>

@ -156,6 +156,7 @@
<string name="title_moving">Moving message to %1$s</string>
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>
<string name="title_compose">Compose</string>

@ -186,6 +186,7 @@
<string name="title_no_viewer">No viewer app available for %1$s</string>
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be forwarded, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_spam">Report message as spam?</string>

Loading…
Cancel
Save