remove caption function with strings

pull/1023/head
Ryan ZHAO 1 year ago
parent 23c0de426b
commit 10e2734f34

@ -351,7 +351,6 @@
C38EF387255B6DD2007E1867 /* AttachmentItemCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF37E255B6DD0007E1867 /* AttachmentItemCollection.swift */; };
C38EF388255B6DD2007E1867 /* AttachmentApprovalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF37F255B6DD0007E1867 /* AttachmentApprovalViewController.swift */; };
C38EF389255B6DD2007E1867 /* AttachmentTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF380255B6DD0007E1867 /* AttachmentTextView.swift */; };
C38EF38A255B6DD2007E1867 /* AttachmentCaptionToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF381255B6DD1007E1867 /* AttachmentCaptionToolbar.swift */; };
C38EF38B255B6DD2007E1867 /* AttachmentPrepViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF382255B6DD1007E1867 /* AttachmentPrepViewController.swift */; };
C38EF38C255B6DD2007E1867 /* ApprovalRailCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF383255B6DD1007E1867 /* ApprovalRailCellView.swift */; };
C38EF3B8255B6DE7007E1867 /* ImageEditorTextViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF3A8255B6DE4007E1867 /* ImageEditorTextViewController.swift */; };
@ -1506,7 +1505,6 @@
C38EF37E255B6DD0007E1867 /* AttachmentItemCollection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AttachmentItemCollection.swift; path = "SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentItemCollection.swift"; sourceTree = SOURCE_ROOT; };
C38EF37F255B6DD0007E1867 /* AttachmentApprovalViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AttachmentApprovalViewController.swift; path = "SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift"; sourceTree = SOURCE_ROOT; };
C38EF380255B6DD0007E1867 /* AttachmentTextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AttachmentTextView.swift; path = "SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextView.swift"; sourceTree = SOURCE_ROOT; };
C38EF381255B6DD1007E1867 /* AttachmentCaptionToolbar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AttachmentCaptionToolbar.swift; path = "SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentCaptionToolbar.swift"; sourceTree = SOURCE_ROOT; };
C38EF382255B6DD1007E1867 /* AttachmentPrepViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AttachmentPrepViewController.swift; path = "SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentPrepViewController.swift"; sourceTree = SOURCE_ROOT; };
C38EF383255B6DD1007E1867 /* ApprovalRailCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ApprovalRailCellView.swift; path = "SignalUtilitiesKit/Shared Views/ApprovalRailCellView.swift"; sourceTree = SOURCE_ROOT; };
C38EF3A8255B6DE4007E1867 /* ImageEditorTextViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageEditorTextViewController.swift; path = "SignalUtilitiesKit/Media Viewing & Editing/Image Editing/ImageEditorTextViewController.swift"; sourceTree = SOURCE_ROOT; };
@ -3205,7 +3203,6 @@
children = (
C38EF37D255B6DCF007E1867 /* AttachmentApprovalInputAccessoryView.swift */,
C38EF37F255B6DD0007E1867 /* AttachmentApprovalViewController.swift */,
C38EF381255B6DD1007E1867 /* AttachmentCaptionToolbar.swift */,
C38EF37E255B6DD0007E1867 /* AttachmentItemCollection.swift */,
C38EF382255B6DD1007E1867 /* AttachmentPrepViewController.swift */,
C38EF37C255B6DCF007E1867 /* AttachmentTextToolbar.swift */,
@ -5679,7 +5676,6 @@
C38EF3FB255B6DF7007E1867 /* UIAlertController+OWS.swift in Sources */,
C38EF30C255B6DBF007E1867 /* ScreenLock.swift in Sources */,
C38EF363255B6DCC007E1867 /* ModalActivityIndicatorViewController.swift in Sources */,
C38EF38A255B6DD2007E1867 /* AttachmentCaptionToolbar.swift in Sources */,
C38EF402255B6DF7007E1867 /* CommonStrings.swift in Sources */,
C38EF3C1255B6DE7007E1867 /* ImageEditorBrushViewController.swift in Sources */,
C3F0A530255C80BC007BE2A3 /* NoopNotificationsManager.swift in Sources */,

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "ملف مرفق";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "تعليق";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "نوع الملف: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Далучэнне";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Загаловак";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Тып файла: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Адправіць";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Паўтарыць";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Паказаць чат";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Ваша паведамленне не можа быць адпраўлена.";
"INVALID_SESSION_ID_MESSAGE" = "Калі ласка, праверце Session ID і паспрабуйце зноў.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Прикачени";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Надпис";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Тип файл: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "সংযুক্তি";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "ক্যাপশন";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "ফাইলের ধরণ:";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Příloha";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Titulek";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Typ souboru: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Odeslat";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Opakovat";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Zobrazit chat";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Zprávu se nepodařilo odeslat.";
"INVALID_SESSION_ID_MESSAGE" = "Zkontrolujte prosím Session ID a zkuste to znovu.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Vedhæftning";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Billedtekst";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Filtype: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Anhang";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Beschriftung";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Dateityp: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Senden";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Wiederholen";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Chat anzeigen";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Nachricht konnte nicht gesendet werden.";
"INVALID_SESSION_ID_MESSAGE" = "Bitte prüfe die Session-ID und versuche es erneut.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Συνημμένο";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Λεζάντα";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Τύπος αρχείου: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Αποστολή";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Επανάληψη";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Εμφάνιση Συνομιλίας";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Η αποστολή του μηνύματός σας απέτυχε.";
"INVALID_SESSION_ID_MESSAGE" = "Παρακαλώ ελέγξτε το Session ID και προσπαθήστε ξανά.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Attachment";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Caption";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "File type: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Kunsendaĵo";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Apudskribo";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "File type: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Adjunto";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Descripción";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Tipo de archivo: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Enviar";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Reintentar";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Mostrar Chat";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Hubo un error al enviar tu mensaje.";
"INVALID_SESSION_ID_MESSAGE" = "Por favor, comprueba el ID de Session y vuelve a intentarlo.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "ضمیمه";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "عنوان";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "نوع فايل: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "ارسال";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "تلاش مجدد";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "نمایش گفتگو";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "پیام شما ارسال نشد.";
"INVALID_SESSION_ID_MESSAGE" = "لطفاً شناسه Session را مجدد بررسی کنید.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Liite";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Otsikko";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Tiedostotyyppi: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Lähetä";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Yritä uudelleen";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Näytä keskustelu";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Viestin lähetys epäonnistui";
"INVALID_SESSION_ID_MESSAGE" = "Tarkista Session ID ja yritä uudelleen";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Mga isinama";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Pamagat";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Uri ng talaksan: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Fichier joint";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Légende";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Type de fichier : %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Envoyer";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Réessayer";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Afficher le chat";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Lenvoi de votre message a échoué.";
"INVALID_SESSION_ID_MESSAGE" = "Veuillez vérifier le Session ID et réessayer.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "अटैचमेंट जोड़ें";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "कैप्शन";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "फ़ाइल प्रकार: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Privitak";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Naslov";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Vrsta datoteke: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Csatolmány";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Felirat";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Fájltípus";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Küldés";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Újra";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Chat mutatása";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Üzenet küldése sikertelen.";
"INVALID_SESSION_ID_MESSAGE" = "Ellenőrizd a Session azonosítót és próbáld újra!";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Lampiran";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Keterangan";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Tipe Berkas: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Kirim";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Coba lagi";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Tampilkan Obrolan";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Pesan Anda gagal terkirim.";
"INVALID_SESSION_ID_MESSAGE" = "Periksa ID Session dan coba lagi.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Allegato";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Didascalia";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Tipo file: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Invia";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Riprova";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Mostra chat";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Invio del tuo messaggio non riuscito.";
"INVALID_SESSION_ID_MESSAGE" = "Controlla il Session ID e riprova.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "添付ファイル";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "キャプション";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "ファイルの種類:%@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "送信";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "再試行";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "チャットを表示";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "メッセージの送信に失敗しました。";
"INVALID_SESSION_ID_MESSAGE" = "セッションIDを確認してもう一度やり直してください";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "첨부파일";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "설명문구";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "파일 형식: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "هاوپێچ";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "ناونیشان";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "جۆری دۆسیە:%@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Priedas";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Caption";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Failo tipas: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Pielikums";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Paraksts";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Faila paplašinājums: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "संम्लगन गर्नुहोस्";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "क्याप्शन";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "फाईलको प्रकार";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Bijlage";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Bijschrift";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Bestand type: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Vedlegg";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Bildetekst";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Filtype: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Sende";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Prøv på nytt";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Vise samtale";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Meldingen din lot seg ikke sende.";
"INVALID_SESSION_ID_MESSAGE" = "Vennligst sjekk Session-ID'en og prøv på nytt.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Załącznik";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Podpis";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Typ pliku: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Wyślij";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Ponów";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Pokaż Czat";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Twoja wiadomość nie została wysłana.";
"INVALID_SESSION_ID_MESSAGE" = "Proszę sprawdzić ID sesji i spróbować ponownie.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Anexo";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Legenda";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Tipo de arquivo: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Enviar";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Tentar novamente";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Exibir conversa";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Falha ao enviar a sua mensagem.";
"INVALID_SESSION_ID_MESSAGE" = "Por favor, verifique o ID da sessão e tente novamente.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Anexo";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Legenda";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Tipo de ficheiro: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Atașament";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Captură";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Tipul fișierului: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Trimite";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Reîncercați";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Arată conversația";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Mesajul tău nu a putut fi trimis.";
"INVALID_SESSION_ID_MESSAGE" = "Vă rugăm să verificați ID-ul Session și să încercați din nou.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Вложение";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Подпись";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Тип файла: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Отправить";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Повторить";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Показать чат";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Ваше сообщение не было отправлено.";
"INVALID_SESSION_ID_MESSAGE" = "Пожалуйста, проверьте Session ID или ONS имя и попробуйте снова.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "ඇමුණුම";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "ශීර්ෂ පාඨය";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "ගොනුවේ වර්ගය: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Príloha";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Titulok";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Typ súboru: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Odoslať";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Znova";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Zobraziť rozhovor";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Vašu správu sa nepodarilo odoslať.";
"INVALID_SESSION_ID_MESSAGE" = "Skontrolujte prosím Session ID a skúste to znova.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Priloga";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Naziv";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Tip datoteke: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Bilaga";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Bildtext";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Filtyp: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "ไฟล์แนบ";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "รายละเอียด";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "ประเภทไฟล์: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Ek";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Başlık";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Dosya türü: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Вкладення";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Заголовок";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Тип файлу: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "Надіслати";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "Спробувати знову";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "Показати чат";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "Не вдалося відправити ваше повідомлення.";
"INVALID_SESSION_ID_MESSAGE" = "Будь ласка, перевірте Session ID або та спробуйте ще раз.";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "Tệp đính kèm";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "Mô tả";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "Loại tệp tin: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "附件";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "注释";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "文件类型: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "发送";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "重试";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "显示聊天";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "消息发送失败";
"INVALID_SESSION_ID_MESSAGE" = "请检查 Session ID然后重试。";

@ -1,7 +1,5 @@
/* No comment provided by engineer. */
"ATTACHMENT" = "附件";
/* Title for 'caption' mode of the attachment approval view. */
"ATTACHMENT_APPROVAL_CAPTION_TITLE" = "標題";
/* Format string for file extension label in call interstitial view */
"ATTACHMENT_APPROVAL_FILE_EXTENSION_FORMAT" = "檔案類型: %@";
/* Format string for file size label in call interstitial view. Embeds: {{file size as 'N mb' or 'N kb'}}. */
@ -422,8 +420,6 @@
"SEND_BUTTON_TITLE" = "傳送";
/* Generic text for button that retries whatever the last action was. */
"RETRY_BUTTON_TEXT" = "重試";
/* notification action */
"SHOW_THREAD_BUTTON_TITLE" = "顯示聊天";
/* notification body */
"SEND_FAILED_NOTIFICATION_BODY" = "訊息傳送失敗";
"INVALID_SESSION_ID_MESSAGE" = "請檢查 Session ID然後再試一次。";

@ -7,8 +7,6 @@ import SignalCoreKit
protocol AttachmentApprovalInputAccessoryViewDelegate: AnyObject {
func attachmentApprovalInputUpdateMediaRail()
func attachmentApprovalInputStartEditingCaptions()
func attachmentApprovalInputStopEditingCaptions()
}
// MARK: -
@ -18,23 +16,18 @@ class AttachmentApprovalInputAccessoryView: UIView {
weak var delegate: AttachmentApprovalInputAccessoryViewDelegate?
let attachmentTextToolbar: AttachmentTextToolbar
let attachmentCaptionToolbar: AttachmentCaptionToolbar
let galleryRailView: GalleryRailView
let currentCaptionLabel = UILabel()
let currentCaptionWrapper = UIView()
var isEditingMediaMessage: Bool {
return attachmentTextToolbar.textView.isFirstResponder
}
private var isEditingCaptions: Bool = false
private var currentAttachmentItem: SignalAttachmentItem?
let kGalleryRailViewHeight: CGFloat = 72
required init() {
attachmentTextToolbar = AttachmentTextToolbar()
attachmentCaptionToolbar = AttachmentCaptionToolbar()
galleryRailView = GalleryRailView()
galleryRailView.scrollFocusMode = .keepWithinBounds
@ -71,19 +64,7 @@ class AttachmentApprovalInputAccessoryView: UIView {
separator.pin(.leading, to: .leading, of: self)
separator.pin(.trailing, to: .trailing, of: self)
currentCaptionLabel.themeTextColor = .white
currentCaptionLabel.font = .systemFont(ofSize: Values.mediumFontSize)
currentCaptionLabel.numberOfLines = 5
currentCaptionLabel.lineBreakMode = .byWordWrapping
currentCaptionWrapper.isUserInteractionEnabled = true
currentCaptionWrapper.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(captionTapped)))
currentCaptionWrapper.addSubview(currentCaptionLabel)
currentCaptionLabel.autoPinEdgesToSuperviewMargins()
attachmentCaptionToolbar.attachmentCaptionToolbarDelegate = self
let stackView = UIStackView(arrangedSubviews: [currentCaptionWrapper, attachmentCaptionToolbar, galleryRailView, attachmentTextToolbar])
let stackView = UIStackView(arrangedSubviews: [galleryRailView, attachmentTextToolbar])
stackView.axis = .vertical
addSubview(stackView)
@ -104,78 +85,21 @@ class AttachmentApprovalInputAccessoryView: UIView {
galleryRailBlockingView.pin(.bottom, to: .bottom, of: stackView)
}
// MARK: - Events
@objc func captionTapped(sender: UIGestureRecognizer) {
guard sender.state == .recognized else { return }
delegate?.attachmentApprovalInputStartEditingCaptions()
}
// MARK:
private var shouldHideControls = false
private func updateContents() {
var hasCurrentCaption = false
if let currentAttachmentItem = currentAttachmentItem,
let captionText = currentAttachmentItem.captionText {
hasCurrentCaption = captionText.count > 0
attachmentCaptionToolbar.textView.text = captionText
currentCaptionLabel.text = captionText
} else {
attachmentCaptionToolbar.textView.text = nil
currentCaptionLabel.text = nil
}
attachmentCaptionToolbar.isHidden = !isEditingCaptions
currentCaptionWrapper.isHidden = isEditingCaptions || !hasCurrentCaption
attachmentTextToolbar.isHidden = isEditingCaptions
updateFirstResponder()
layoutSubviews()
}
private func updateFirstResponder() {
if (shouldHideControls) {
if attachmentCaptionToolbar.textView.isFirstResponder {
attachmentCaptionToolbar.textView.resignFirstResponder()
} else if attachmentTextToolbar.textView.isFirstResponder {
attachmentTextToolbar.textView.resignFirstResponder()
}
} else if (isEditingCaptions) {
// While editing captions, the keyboard should always remain visible.
if !attachmentCaptionToolbar.textView.isFirstResponder {
attachmentCaptionToolbar.textView.becomeFirstResponder()
}
} else {
if attachmentCaptionToolbar.textView.isFirstResponder {
attachmentCaptionToolbar.textView.resignFirstResponder()
}
attachmentTextToolbar.textView.resignFirstResponder()
}
// NOTE: We don't automatically make attachmentTextToolbar.textView
// first responder;
}
public func update(isEditingCaptions: Bool,
currentAttachmentItem: SignalAttachmentItem?,
shouldHideControls: Bool) {
// De-bounce
guard self.isEditingCaptions != isEditingCaptions ||
self.currentAttachmentItem != currentAttachmentItem ||
self.shouldHideControls != shouldHideControls else {
updateFirstResponder()
return
}
self.isEditingCaptions = isEditingCaptions
public func update(currentAttachmentItem: SignalAttachmentItem?, shouldHideControls: Bool) {
self.currentAttachmentItem = currentAttachmentItem
self.shouldHideControls = shouldHideControls
updateContents()
updateFirstResponder()
}
// MARK:
@ -189,28 +113,6 @@ class AttachmentApprovalInputAccessoryView: UIView {
}
public var hasFirstResponder: Bool {
return (isFirstResponder ||
attachmentCaptionToolbar.textView.isFirstResponder ||
attachmentTextToolbar.textView.isFirstResponder)
}
}
// MARK: -
extension AttachmentApprovalInputAccessoryView: AttachmentCaptionToolbarDelegate {
public func attachmentCaptionToolbarDidEdit(_ attachmentCaptionToolbar: AttachmentCaptionToolbar) {
guard let currentAttachmentItem = currentAttachmentItem else {
owsFailDebug("Missing currentAttachmentItem.")
return
}
// TODO: Look at refactoring this behaviour to consolidate attachment mutations
currentAttachmentItem.attachment.captionText = attachmentCaptionToolbar.textView.text
delegate?.attachmentApprovalInputUpdateMediaRail()
}
public func attachmentCaptionToolbarDidComplete() {
delegate?.attachmentApprovalInputStopEditingCaptions()
return (isFirstResponder || attachmentTextToolbar.textView.isFirstResponder)
}
}

@ -64,10 +64,6 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
private let isAddMoreVisible: Bool
public weak var approvalDelegate: AttachmentApprovalViewControllerDelegate?
public var isEditingCaptions = false {
didSet { updateContents() }
}
let attachmentItemCollection: AttachmentItemCollection
@ -198,20 +194,6 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
private var galleryRailView: GalleryRailView { return bottomToolView.galleryRailView }
private lazy var touchInterceptorView: UIView = {
let view: UIView = UIView()
view.translatesAutoresizingMaskIntoConstraints = false
view.isHidden = true
let tapGesture = UITapGestureRecognizer(
target: self,
action: #selector(didTapTouchInterceptorView(gesture:))
)
view.addGestureRecognizer(tapGesture)
return view
}()
private lazy var pagerScrollView: UIScrollView? = {
// This is kind of a hack. Since we don't have first class access to the superview's `scrollView`
// we traverse the view hierarchy until we find it.
@ -237,8 +219,6 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
}
self.setCurrentItem(firstItem, direction: .forward, animated: false)
view.addSubview(touchInterceptorView)
// layout immediately to avoid animating the layout process during the transition
UIView.performWithoutAnimation {
@ -250,8 +230,6 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
if firstItem.attachment.isText || (firstItem.attachment.isUrl && LinkPreview.previewUrl(for: firstItem.attachment.text()) == nil) {
bottomToolView.attachmentTextToolbar.messageText = firstItem.attachment.text()
}
setupLayout()
}
override public func viewWillAppear(_ animated: Bool) {
@ -269,12 +247,6 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
updateContents()
}
// MARK: - Layout
private func setupLayout() {
touchInterceptorView.autoPinEdgesToSuperviewEdges()
}
// MARK: - Notifications
@objc func didBecomeActive() {
@ -288,8 +260,6 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
private func updateContents() {
updateNavigationBar()
updateInputAccessory()
touchInterceptorView.isHidden = !isEditingCaptions
}
// MARK: - Input Accessory
@ -310,7 +280,6 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
}
bottomToolView.update(
isEditingCaptions: isEditingCaptions,
currentAttachmentItem: currentAttachmentItem,
shouldHideControls: shouldHideControls
)
@ -325,39 +294,10 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
return
}
guard !isEditingCaptions else {
// Hide all navigation bar items while the caption view is open.
self.navigationItem.leftBarButtonItem = UIBarButtonItem(
//"Title for 'caption' mode of the attachment approval view."
title: "ATTACHMENT_APPROVAL_CAPTION_TITLE".localized(),
style: .plain,
target: nil,
action: nil
)
let doneButton = navigationBarButton(
imageName: "image_editor_checkmark_full",
selector: #selector(didTapCaptionDone(sender:))
)
let navigationBarItems = [doneButton]
updateNavigationBar(navigationBarItems: navigationBarItems)
return
}
var navigationBarItems = [UIView]()
if viewControllers?.count == 1, let firstViewController: AttachmentPrepViewController = viewControllers?.first as? AttachmentPrepViewController {
navigationBarItems = firstViewController.navigationBarItems()
// Show the caption UI if there's more than one attachment
// OR if the attachment already has a caption.
if attachmentItemCollection.count > 0, (firstViewController.attachmentItem.captionText?.count ?? 0) > 0 {
let captionButton = navigationBarButton(
imageName: "image_editor_caption",
selector: #selector(didTapCaption(sender:))
)
navigationBarItems.append(captionButton)
}
}
updateNavigationBar(navigationBarItems: navigationBarItems)
@ -643,30 +583,11 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
return nextItem
}
// MARK: - Event Handlers
@objc
func didTapTouchInterceptorView(gesture: UITapGestureRecognizer) {
Logger.info("")
isEditingCaptions = false
}
// MARK: - Event Handlers=
private func cancelPressed() {
self.approvalDelegate?.attachmentApprovalDidCancel(self)
}
@objc func didTapCaption(sender: UIButton) {
Logger.verbose("")
isEditingCaptions = true
}
@objc func didTapCaptionDone(sender: UIButton) {
Logger.verbose("")
isEditingCaptions = false
}
}
// MARK: -
@ -778,12 +699,4 @@ extension AttachmentApprovalViewController: AttachmentApprovalInputAccessoryView
public func attachmentApprovalInputUpdateMediaRail() {
updateMediaRail()
}
public func attachmentApprovalInputStartEditingCaptions() {
isEditingCaptions = true
}
public func attachmentApprovalInputStopEditingCaptions() {
isEditingCaptions = false
}
}

@ -1,205 +0,0 @@
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
import Foundation
import UIKit
import SessionUIKit
import SignalCoreKit
import SessionUtilitiesKit
protocol AttachmentCaptionToolbarDelegate: AnyObject {
func attachmentCaptionToolbarDidEdit(_ attachmentCaptionToolbar: AttachmentCaptionToolbar)
func attachmentCaptionToolbarDidComplete()
}
// MARK: -
class AttachmentCaptionToolbar: UIView, UITextViewDelegate {
private let kMaxCaptionCharacterCount = 240
weak var attachmentCaptionToolbarDelegate: AttachmentCaptionToolbarDelegate?
var messageText: String? {
get { return textView.text }
set {
textView.text = newValue
}
}
// Layout Constants
let kMinTextViewHeight: CGFloat = 38
var maxTextViewHeight: CGFloat {
// About ~4 lines in portrait and ~3 lines in landscape.
// Otherwise we risk obscuring too much of the content.
return UIDevice.current.orientation.isPortrait ? 160 : 100
}
var textViewHeightConstraint: NSLayoutConstraint!
var textViewHeight: CGFloat
// MARK: - Initializers
init() {
self.textViewHeight = kMinTextViewHeight
super.init(frame: CGRect.zero)
// Specifying autorsizing mask and an intrinsic content size allows proper
// sizing when used as an input accessory view.
self.autoresizingMask = .flexibleHeight
self.translatesAutoresizingMaskIntoConstraints = false
self.themeBackgroundColor = .clear
textView.delegate = self
// Layout
let kToolbarMargin: CGFloat = 8
self.textViewHeightConstraint = textView.autoSetDimension(.height, toSize: kMinTextViewHeight)
lengthLimitLabel.setContentHuggingHigh()
lengthLimitLabel.setCompressionResistanceHigh()
let contentView = UIStackView(arrangedSubviews: [textContainer, lengthLimitLabel])
// We have to wrap the toolbar items in a content view because iOS (at least on iOS10.3) assigns the inputAccessoryView.layoutMargins
// when resigning first responder (verified by auditing with `layoutMarginsDidChange`).
// The effect of this is that if we were to assign these margins to self.layoutMargins, they'd be blown away if the
// user dismisses the keyboard, giving the input accessory view a wonky layout.
contentView.layoutMargins = UIEdgeInsets(top: kToolbarMargin, left: kToolbarMargin, bottom: kToolbarMargin, right: kToolbarMargin)
contentView.axis = .vertical
addSubview(contentView)
contentView.autoPinEdgesToSuperviewEdges()
}
required init?(coder aDecoder: NSCoder) {
notImplemented()
}
// MARK: - UIView Overrides
override var intrinsicContentSize: CGSize {
get {
// Since we have `self.autoresizingMask = UIViewAutoresizingFlexibleHeight`, we must specify
// an intrinsicContentSize. Specifying CGSize.zero causes the height to be determined by autolayout.
return CGSize.zero
}
}
// MARK: - Subviews
private lazy var lengthLimitLabel: UILabel = {
let lengthLimitLabel = UILabel()
// Length Limit Label shown when the user inputs too long of a message
lengthLimitLabel.themeTextColor = .textPrimary
lengthLimitLabel.text = NSLocalizedString("ATTACHMENT_APPROVAL_MESSAGE_LENGTH_LIMIT_REACHED", comment: "One-line label indicating the user can add no more text to the media message field.")
lengthLimitLabel.textAlignment = .center
// Add shadow in case overlayed on white content
lengthLimitLabel.themeShadowColor = .black
lengthLimitLabel.layer.shadowOffset = .zero
lengthLimitLabel.layer.shadowOpacity = 0.8
lengthLimitLabel.layer.shadowRadius = 2.0
lengthLimitLabel.isHidden = true
return lengthLimitLabel
}()
lazy var textView: UITextView = {
let textView = buildTextView()
textView.returnKeyType = .done
textView.scrollIndicatorInsets = UIEdgeInsets(top: 5, left: 0, bottom: 5, right: 3)
return textView
}()
private lazy var textContainer: UIView = {
let textContainer = UIView()
textContainer.clipsToBounds = true
textContainer.addSubview(textView)
textView.autoPinEdgesToSuperviewEdges()
return textContainer
}()
private func buildTextView() -> UITextView {
let textView = AttachmentTextView()
textView.themeBackgroundColor = .clear
textView.themeTintColor = .textPrimary
textView.font = UIFont.preferredFont(forTextStyle: .body)
textView.themeTextColor = .textPrimary
textView.textContainerInset = UIEdgeInsets(top: 7, left: 7, bottom: 7, right: 7)
ThemeManager.onThemeChange(observer: textView) { [weak textView] theme, _ in
textView?.keyboardAppearance = theme.keyboardAppearance
}
return textView
}
// MARK: - UITextViewDelegate
public func textViewDidChange(_ textView: UITextView) {
updateHeight(textView: textView)
attachmentCaptionToolbarDelegate?.attachmentCaptionToolbarDidEdit(self)
}
public func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
let existingText: String = textView.text ?? ""
let proposedText: String = (existingText as NSString).replacingCharacters(in: range, with: text)
self.lengthLimitLabel.isHidden = true
// After verifying the byte-length is sufficiently small, verify the character count is within bounds.
guard proposedText.count < kMaxCaptionCharacterCount else {
Logger.debug("hit attachment message body character count limit")
self.lengthLimitLabel.isHidden = false
// `range` represents the section of the existing text we will replace. We can re-use that space.
let charsAfterDelete: Int = (existingText as NSString).replacingCharacters(in: range, with: "").count
// Accept as much of the input as we can
let charBudget: Int = Int(kMaxCaptionCharacterCount) - charsAfterDelete
if charBudget >= 0 {
let acceptableNewText = String(text.prefix(charBudget))
textView.text = (existingText as NSString).replacingCharacters(in: range, with: acceptableNewText)
}
return false
}
// Though we can wrap the text, we don't want to encourage multline captions, plus a "done" button
// allows the user to get the keyboard out of the way while in the attachment approval view.
if text == "\n" {
attachmentCaptionToolbarDelegate?.attachmentCaptionToolbarDidComplete()
return false
}
return true
}
// MARK: - Helpers
private func updateHeight(textView: UITextView) {
// compute new height assuming width is unchanged
let currentSize = textView.frame.size
let newHeight = clampedTextViewHeight(fixedWidth: currentSize.width)
if newHeight != textViewHeight {
Logger.debug("TextView height changed: \(textViewHeight) -> \(newHeight)")
textViewHeight = newHeight
textViewHeightConstraint?.constant = textViewHeight
invalidateIntrinsicContentSize()
}
}
private func clampedTextViewHeight(fixedWidth: CGFloat) -> CGFloat {
let contentSize = textView.sizeThatFits(CGSize(width: fixedWidth, height: CGFloat.greatestFiniteMagnitude))
return CGFloatClamp(contentSize.height, kMinTextViewHeight, maxTextViewHeight)
}
}
Loading…
Cancel
Save