Show toast warning for duplicate attachments

This commit is contained in:
Naveen 2022-11-03 00:20:02 +05:30
parent ecdbc9036a
commit fedc52adc3
46 changed files with 107 additions and 16 deletions

View File

@ -907,6 +907,7 @@ class ThreadActivity : SimpleActivity() {
private fun addAttachment(uri: Uri) {
if (getAttachments().any { it.uri.toString() == uri.toString() }) {
toast(R.string.duplicate_item_warning)
return
}

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">ازالة التثبيت</string>
<string name="forward_message">اعادة ارسال</string>
<string name="compress_error">غير قادر على ضغط الصورة إلى الحجم المحدد</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="zero">و %d أخرى</item>
@ -99,4 +101,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Unpin</string>
<string name="forward_message">Forward</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Адмацаваць</string>
<string name="forward_message">Пераслаць</string>
<string name="compress_error">Немагчыма сціснуць выяву да выбранага памеру</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Откачване</string>
<string name="forward_message">Препращане</string>
<string name="compress_error">Невъзможно е да се компресира изображението до избрания размер</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">No fixis</string>
<string name="forward_message">Reenvia</string>
<string name="compress_error">No s\'ha pogut comprimir la imatge a la mida seleccionada</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">i %d altra</item>
@ -87,4 +89,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Unpin</string>
<string name="forward_message">Forward</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Odepnout</string>
<string name="forward_message">Přeposlat</string>
<string name="compress_error">Nepodařilo se komprimovat obrázek na požadovanou velikost</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">a %d další</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Frigør</string>
<string name="forward_message">Fremad</string>
<string name="compress_error">Billedet kan ikke komprimeres til den valgte størrelse</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Losheften</string>
<string name="forward_message">Weiterleiten</string>
<string name="compress_error">Bild kann nicht auf ausgewählte Größe komprimiert werden</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">und %d andere</item>
@ -87,4 +89,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Ξεκαρφίτσωμα</string>
<string name="forward_message">Προώθηση</string>
<string name="compress_error">Αδυναμία συμπίεσης εικόνας στο επιλεγμένο μέγεθος</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">και άλλος %d</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Depingli</string>
<string name="forward_message">Forward</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Desanclar</string>
<string name="forward_message">Reenviar</string>
<string name="compress_error">Incapaz de comprimir la imagen al tamaño seleccionado</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">y %d otro</item>
@ -90,4 +92,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Eemalda kinnitus</string>
<string name="forward_message">Edasta</string>
<string name="compress_error">Pildi muutmine valitud suurusesse ei õnnestu</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">ja %d muud</item>
@ -87,4 +89,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Poista</string>
<string name="forward_message">Välitä</string>
<string name="compress_error">Kuvan pakkaaminen valittuun kokoon ei onnistu</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">ja %d muu</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Désépingler</string>
<string name="forward_message">Transférer</string>
<string name="compress_error">Impossible de compresser l\'image à la taille sélectionnée</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">et %d autre</item>
@ -90,4 +92,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Desenganche</string>
<string name="forward_message">Adiante</string>
<string name="compress_error">Non se puido comprimir a imaxe ao tamaño seleccionado</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">E %d outro</item>
@ -87,4 +89,4 @@
Non atopaches algunhas cadeas? Hai máis en
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Unpin</string>
<string name="forward_message">Forward</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Otkvači</string>
<string name="forward_message">Proslijedi</string>
<string name="compress_error">Isključi za komprimiranje slike na odabranu veličinu</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">i još %d druga</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Kitűzés megszüntetése</string>
<string name="forward_message">Továbbítás</string>
<string name="compress_error">Nem lehet tömöríteni a képet a kiválasztott méretre</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">és még %d fő</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Unpin</string>
<string name="forward_message">Forward</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="other">and %d others</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Rimuovi</string>
<string name="forward_message">Inoltra</string>
<string name="compress_error">Impossibile comprimere l\'immagine alla dimensione selezionata</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">e %d altro</item>
@ -90,4 +92,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">בטל הצמדה</string>
<string name="forward_message">התקדם</string>
<string name="compress_error">לא ניתן לדחוס תמונה לגודל שנבחר</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">固定を外す</string>
<string name="forward_message">転送</string>
<string name="compress_error">選択したサイズに画像を圧縮できません</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="other">and %d others</item>
@ -84,4 +86,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Atjunkite</string>
<string name="forward_message">Pirmyn</string>
<string name="compress_error">Nepavyksta suspausti vaizdo iki pasirinkto dydžio</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Unpin</string>
<string name="forward_message">Forward</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="zero">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Unpin</string>
<string name="forward_message">Forward</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Unpin</string>
<string name="forward_message">Forward</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Løsne</string>
<string name="forward_message">Videresend</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Losmaken</string>
<string name="forward_message">Doorsturen</string>
<string name="compress_error">Kon de afbeelding niet comprimeren naar de gekozen grootte</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">en %d andere</item>
@ -87,4 +89,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Unpin</string>
<string name="forward_message">اگے</string>
<string name="compress_error">تصویر نوں چݨے ہوۓ اکار وچ سنکُچت کر نہیں سکدی</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">تے %d ہور</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Odepnij</string>
<string name="forward_message">Przekaż dalej</string>
<string name="compress_error">Nie udało się skompresować obrazu do wybranego rozmiaru</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">i %d inny</item>
@ -93,4 +95,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Desfixar</string>
<string name="forward_message">Encaminhar</string>
<string name="compress_error">Não pôde comprimir imagem ao tamanho selecionado</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Desafixar</string>
<string name="forward_message">Reencaminhar</string>
<string name="compress_error">Incapaz de comprimir imagem no tamanho selecionado</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Elimină fixarea</string>
<string name="forward_message">Redirecţionare</string>
<string name="compress_error">Nu se poate comprima imaginea la dimensiunea selectată</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">și %d alt</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Открепить</string>
<string name="forward_message">Переслать</string>
<string name="compress_error">Невозможно сжать изображение до выбранного размера</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">и ещё %d</item>
@ -93,4 +95,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Odopnúť</string>
<string name="forward_message">Preposlať</string>
<string name="compress_error">Nepodarilo sa zmenšiť obrázok na požadovanú veľkosť</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">a %d ďalší</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Odpni</string>
<string name="forward_message">Posreduj</string>
<string name="compress_error">Slike ni mogoče stisniti na izbrano velikost</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">in %d drug</item>
@ -93,4 +95,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Lossa</string>
<string name="forward_message">Vidarebefordra</string>
<string name="compress_error">Det gick inte att komprimera bilden till den valda storleken</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">och %d annan</item>
@ -87,4 +89,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">பின் நீக்கு</string>
<string name="forward_message">முன்னோக்கி</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Unpin</string>
<string name="forward_message">Forward</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="other">and %d others</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Sabitlemeyi kaldır</string>
<string name="forward_message">İlet</string>
<string name="compress_error">Resim seçilen boyuta sıkıştırılamıyor</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">ve %d diğeri</item>
@ -87,4 +89,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Відкріпити</string>
<string name="forward_message">Переслати</string>
<string name="compress_error">Не вдається стиснути зображення до вибраного розміру</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">取消固定</string>
<string name="forward_message">转发</string>
<string name="compress_error">无法将图像压缩到选定的大小</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="other">及 %d 个其他人</item>
@ -84,4 +86,4 @@
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>
</resources>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">取消釘選</string>
<string name="forward_message">轉傳</string>
<string name="compress_error">無法將圖片壓縮至指定大小</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="other">and %d others</item>

View File

@ -20,6 +20,8 @@
<string name="unpin_conversation">Unpin</string>
<string name="forward_message">Forward</string>
<string name="compress_error">Unable to compress image to selected size</string>
<!-- Attachments-->
<string name="duplicate_item_warning">Duplicate item was not included</string>
<!-- vCard-->
<plurals name="and_other_contacts">
<item quantity="one">and %d other</item>