From dbe5db10afb28b327d5267786e4f7aea60fdd262 Mon Sep 17 00:00:00 2001 From: Bartosz Date: Sun, 27 Sep 2020 10:59:29 +0000 Subject: [PATCH 01/43] Translated using Weblate (Polish) Currently translated at 100.0% (32 of 32 strings) Translation: Element iOS/Element iOS (Push) Translate-URL: https://translate.riot.im/projects/riot-ios/riot-ios-push/pl/ --- Riot/Assets/pl.lproj/Localizable.strings | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Riot/Assets/pl.lproj/Localizable.strings b/Riot/Assets/pl.lproj/Localizable.strings index 5d34eb5a0..e8acae301 100644 --- a/Riot/Assets/pl.lproj/Localizable.strings +++ b/Riot/Assets/pl.lproj/Localizable.strings @@ -55,3 +55,9 @@ /* Incoming named video conference invite from a specific person */ "VIDEO_CONF_NAMED_FROM_USER" = "Grupowe połączenie wideo z %@: '%@'"; "KEY_VERIFICATION_REQUEST_FROM_USER" = "%@ wymaga weryfikacji"; +/* New message indicator on unknown room */ +"MESSAGE" = "Wiadomość"; +/* New message indicator from a DM */ +"MESSAGE_FROM_X" = "Wiadomość od %@"; +/* New message indicator on a room */ +"MESSAGE_IN_X" = "Wiadomość w %@"; From 4847189b4722671d12ca04a548e4fdb0ef321f1c Mon Sep 17 00:00:00 2001 From: random Date: Wed, 30 Sep 2020 12:23:24 +0000 Subject: [PATCH 02/43] Translated using Weblate (Italian) Currently translated at 100.0% (1119 of 1119 strings) Translation: Element iOS/Element iOS Translate-URL: https://translate.riot.im/projects/riot-ios/riot-ios/it/ --- Riot/Assets/it.lproj/Vector.strings | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Riot/Assets/it.lproj/Vector.strings b/Riot/Assets/it.lproj/Vector.strings index 703602f52..d7f5cbc32 100644 --- a/Riot/Assets/it.lproj/Vector.strings +++ b/Riot/Assets/it.lproj/Vector.strings @@ -1204,3 +1204,19 @@ "room_info_list_one_member" = "1 membro"; "room_info_list_several_members" = "%@ membri"; "room_info_list_section_other" = "Altro"; +"room_participants_leave_prompt_title_for_dm" = "Esci"; +"room_participants_leave_prompt_msg_for_dm" = "Vuoi veramente uscire?"; +"room_participants_filter_room_members_for_dm" = "Filtra membri"; +"room_participants_security_information_room_not_encrypted_for_dm" = "I messaggi qui non sono cifrati end-to-end."; +"room_participants_security_information_room_encrypted_for_dm" = "I messaggi qui sono cifrati end-to-end. \n \nI tuoi messaggi sono protetti con lucchetti e solo tu e il destinatario avete le chiavi univoche per sbloccarli."; +"room_details_title_for_dm" = "Dettagli"; +"room_details_photo_for_dm" = "Foto"; +"room_details_room_name_for_dm" = "Nome"; +"room_details_access_section_for_dm" = "Chi può accedervi?"; +"room_details_access_section_anyone_apart_from_guest_for_dm" = "Chiunque conosca il link, eccetto gli ospiti"; +"room_details_access_section_anyone_for_dm" = "Chiunque conosca il link, compresi gli ospiti"; +"room_details_access_section_directory_toggle_for_dm" = "Mostra nell'elenco delle stanze"; +"room_details_no_local_addresses_for_dm" = "Non ha indirizzi locali"; +"room_details_advanced_room_id_for_dm" = "ID:"; +"room_details_advanced_e2e_encryption_enabled_for_dm" = "La crittografia è attiva"; +"room_details_advanced_e2e_encryption_disabled_for_dm" = "La crittografia non è attiva."; From ed002feea2c0f889d423bf60553bb3d102ddaed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Wed, 30 Sep 2020 18:30:25 +0000 Subject: [PATCH 03/43] Translated using Weblate (Estonian) Currently translated at 100.0% (1120 of 1120 strings) Translation: Element iOS/Element iOS Translate-URL: https://translate.riot.im/projects/riot-ios/riot-ios/et/ --- Riot/Assets/et.lproj/Vector.strings | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Riot/Assets/et.lproj/Vector.strings b/Riot/Assets/et.lproj/Vector.strings index 6a7821cea..fe7e9d4f5 100644 --- a/Riot/Assets/et.lproj/Vector.strings +++ b/Riot/Assets/et.lproj/Vector.strings @@ -1147,7 +1147,7 @@ "pin_protection_choose_pin_welcome_after_login" = "Tere tulemast tagasi."; "pin_protection_choose_pin_welcome_after_register" = "Tere tulemast."; "pin_protection_not_allowed_pin" = "Turvapõhjustel seda PIN-kooi ei saa kasutada. Palun vali mõnu muu PIN-kood"; -"pin_protection_explanatory" = "PIN-kood aitab tagada, et vaid sina ise pääsed ligi oma profiilile, sõnumitele ja kontaktidele."; +"pin_protection_explanatory" = "PIN-koodi seadistamine aitab tagada, et vaid sina ise pääsed ligi oma profiilile, sõnumitele ja kontaktidele, kui sisestad PIN-koodi rakenduse käivitamisel."; "searchable_directory_create_new_room" = "Loo uus jututuba"; "searchable_directory_x_network" = "%@ võrk"; "searchable_directory_search_placeholder" = "Nimi või Matrix'i tunnus"; @@ -1170,3 +1170,20 @@ "room_info_list_one_member" = "1 liige"; "room_info_list_several_members" = "%@ liiget"; "room_info_list_section_other" = "Muud"; +"room_participants_leave_prompt_title_for_dm" = "Lahku"; +"room_participants_leave_prompt_msg_for_dm" = "Kas oled kindel, et soovid lahkuda jututoast?"; +"room_participants_filter_room_members_for_dm" = "Filtreeri jututoa liikmeid"; +"room_participants_security_information_room_not_encrypted_for_dm" = "See jututuba ei ole läbivalt krüptitud."; +"room_participants_security_information_room_encrypted_for_dm" = "Sõnumid siin jututoas kasutavad läbivat krüptimist. \n \nSinu sõnumid on turvatud ning ainult sinul ja saaja(te)l on unikaalsed võtmed selliste sõnumite lugemiseks."; +"room_details_title_for_dm" = "Jututoa üksikasjad"; +"room_details_photo_for_dm" = "Jututoa foto"; +"room_details_room_name_for_dm" = "Nimi"; +"room_details_access_section_for_dm" = "Kes pääsevad ligi siia jututuppa?"; +"room_details_access_section_anyone_apart_from_guest_for_dm" = "Kõik, kes teavad jututoa viidet, välja arvatud külalised"; +"room_details_access_section_anyone_for_dm" = "Kõik, kes teavad jututoa viidet, kaasa arvatud külalised"; +"room_details_access_section_directory_toggle_for_dm" = "Näita seda jututuba jututubade kataloogis"; +"room_details_no_local_addresses_for_dm" = "Sellel jututoal puuduvad kohalikud aadressid"; +"room_details_advanced_room_id_for_dm" = "Jututoa tunnus:"; +"room_details_advanced_e2e_encryption_enabled_for_dm" = "Krüptimine on selles jututoas kasutusel"; +"room_details_advanced_e2e_encryption_disabled_for_dm" = "Krüptimine ei ole selles jututoas kasutusel."; +"pin_protection_kick_user_alert_message" = "Liiga palju vigu PIN-koodi sisestamisel ning sa oled nüüd välja logitud"; From 5ed51214dd5a966b8cbbe8ae0afdaeaa4052f6a3 Mon Sep 17 00:00:00 2001 From: "@a2sc:matrix.org" Date: Thu, 1 Oct 2020 08:47:49 +0000 Subject: [PATCH 04/43] Translated using Weblate (German) Currently translated at 98.6% (1104 of 1120 strings) Translation: Element iOS/Element iOS Translate-URL: https://translate.riot.im/projects/riot-ios/riot-ios/de/ --- Riot/Assets/de.lproj/Vector.strings | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Riot/Assets/de.lproj/Vector.strings b/Riot/Assets/de.lproj/Vector.strings index 0073b8b2c..7650205e2 100644 --- a/Riot/Assets/de.lproj/Vector.strings +++ b/Riot/Assets/de.lproj/Vector.strings @@ -1210,3 +1210,6 @@ "room_info_list_one_member" = "1 Mitglied"; "room_info_list_several_members" = "%@ Mitglieder"; "room_info_list_section_other" = "Sonstige"; +"room_participants_leave_prompt_title_for_dm" = "Verlassen"; +"room_participants_filter_room_members_for_dm" = "Mitglieder filtern"; +"room_participants_security_information_room_not_encrypted_for_dm" = "Die Nachrichten hier sind nicht Ende-zu-Ende verschlüsselt."; From 0ce7d35d19120249a3d87af98521df48eaef07d0 Mon Sep 17 00:00:00 2001 From: Nikita Epifanov Date: Wed, 30 Sep 2020 18:40:52 +0000 Subject: [PATCH 05/43] Translated using Weblate (Russian) Currently translated at 100.0% (1120 of 1120 strings) Translation: Element iOS/Element iOS Translate-URL: https://translate.riot.im/projects/riot-ios/riot-ios/ru/ --- Riot/Assets/ru.lproj/Vector.strings | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Riot/Assets/ru.lproj/Vector.strings b/Riot/Assets/ru.lproj/Vector.strings index f9954002c..d0f00645a 100644 --- a/Riot/Assets/ru.lproj/Vector.strings +++ b/Riot/Assets/ru.lproj/Vector.strings @@ -1192,7 +1192,7 @@ "pin_protection_choose_pin_welcome_after_login" = "С возвращением."; "pin_protection_choose_pin_welcome_after_register" = "Добро пожаловать."; "pin_protection_not_allowed_pin" = "По соображениям безопасности этот PIN-код недоступен. Пожалуйста, попробуйте другой PIN-код"; -"pin_protection_explanatory" = "PIN-коды помогают защитить ваш профиль, сообщения и контакты, поэтому только вы можете получить к ним доступ."; +"pin_protection_explanatory" = "Установка PIN-кода позволяет защитить такие данные, как сообщения и контакты, поэтому только вы можете получить к ним доступ, введя PIN-код в начале приложения."; "searchable_directory_create_new_room" = "Создать новую комнату"; "searchable_directory_x_network" = "%@ Сеть"; "searchable_directory_search_placeholder" = "Имя или ID"; @@ -1231,3 +1231,4 @@ "room_details_advanced_room_id_for_dm" = "ID:"; "room_details_advanced_e2e_encryption_enabled_for_dm" = "Шифрование включено"; "room_details_advanced_e2e_encryption_disabled_for_dm" = "Шифрование не включено."; +"pin_protection_kick_user_alert_message" = "Слишком много ошибок, вы вышли из системы"; From c646e016d7f7dcab6329913c871ac52ca7dd5543 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Fri, 2 Oct 2020 14:17:52 +0300 Subject: [PATCH 06/43] Fix layout for small screens --- .../EnterPinCodeViewController.storyboard | 153 ++++++++---------- .../EnterPinCodeViewController.swift | 26 +-- 2 files changed, 82 insertions(+), 97 deletions(-) diff --git a/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewController.storyboard b/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewController.storyboard index 923521baa..e3f675ca6 100644 --- a/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewController.storyboard +++ b/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewController.storyboard @@ -1,6 +1,6 @@ - + @@ -13,14 +13,14 @@ - + - - + + - - - - - - - - - - - - - - + + - - - - - - - - - - - + + - - - + + + + + - + @@ -88,14 +70,14 @@ - + - + @@ -111,7 +93,7 @@ - + @@ -121,7 +103,7 @@ - - + + - - + + - - + + - - + + - - + + - + + + - - - - - + - - + + + + @@ -348,6 +326,7 @@ + @@ -364,7 +343,7 @@ - + diff --git a/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewController.swift b/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewController.swift index 3f510886f..68ba18939 100644 --- a/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewController.swift +++ b/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewController.swift @@ -42,6 +42,7 @@ final class EnterPinCodeViewController: UIViewController { @IBOutlet private weak var informationLabel: UILabel! @IBOutlet private weak var explanatoryLabel: UILabel! @IBOutlet private weak var forgotPinButton: UIButton! + @IBOutlet private weak var bottomView: UIView! // MARK: Private @@ -160,6 +161,11 @@ final class EnterPinCodeViewController: UIViewController { } private func setupViews() { + let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in + self?.cancelButtonAction() + } + + self.navigationItem.rightBarButtonItem = cancelBarButtonItem showCancelButton() self.title = "" @@ -177,15 +183,11 @@ final class EnterPinCodeViewController: UIViewController { } private func showCancelButton() { - let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in - self?.cancelButtonAction() - } - - self.navigationItem.rightBarButtonItem = cancelBarButtonItem + self.navigationController?.navigationBar.isHidden = false } private func hideCancelButton() { - self.navigationItem.rightBarButtonItem = nil + self.navigationController?.navigationBar.isHidden = true } private func render(viewState: EnterPinCodeViewState) { @@ -224,6 +226,7 @@ final class EnterPinCodeViewController: UIViewController { self.informationLabel.text = VectorL10n.pinProtectionChoosePin self.explanatoryLabel.isHidden = false self.forgotPinButton.isHidden = true + self.bottomView.isHidden = false self.notAllowedPinView.isHidden = true } @@ -242,6 +245,7 @@ final class EnterPinCodeViewController: UIViewController { self.mainStackView.isHidden = false self.logoImageView.isHidden = true self.forgotPinButton.isHidden = true + self.bottomView.isHidden = false self.notAllowedPinView.isHidden = false renderPlaceholdersCount(.max, error: true) @@ -273,8 +277,9 @@ final class EnterPinCodeViewController: UIViewController { self.mainStackView.isHidden = false self.logoImageView.isHidden = false self.informationLabel.text = VectorL10n.pinProtectionEnterPin - self.explanatoryLabel.text = nil + self.explanatoryLabel.isHidden = true self.forgotPinButton.isHidden = false + self.bottomView.isHidden = true self.notAllowedPinView.isHidden = true } @@ -282,7 +287,7 @@ final class EnterPinCodeViewController: UIViewController { self.inactiveView.isHidden = true self.mainStackView.isHidden = false self.notAllowedPinView.isHidden = true - self.explanatoryLabel.text = nil + self.explanatoryLabel.isHidden = true self.placeholderStackView.vc_shake() } @@ -317,8 +322,9 @@ final class EnterPinCodeViewController: UIViewController { self.mainStackView.isHidden = false self.logoImageView.isHidden = true self.informationLabel.text = VectorL10n.pinProtectionConfirmPinToDisable - self.explanatoryLabel.text = nil + self.explanatoryLabel.isHidden = true self.forgotPinButton.isHidden = true + self.bottomView.isHidden = false self.notAllowedPinView.isHidden = true } @@ -327,7 +333,7 @@ final class EnterPinCodeViewController: UIViewController { self.inactiveView.isHidden = false self.mainStackView.isHidden = true self.notAllowedPinView.isHidden = true - self.explanatoryLabel.text = nil + self.explanatoryLabel.isHidden = true } private func renderPlaceholdersCount(_ count: Int, error: Bool = false) { From 31322e7cb6ae5db48035063dfb6ca78dfc69eec8 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Fri, 2 Oct 2020 14:18:33 +0300 Subject: [PATCH 07/43] Update CHANGES.rst --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 87ba46b1e..319660a9d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,6 +14,7 @@ Changes to be released in next version * Fix "Unable to open the link" error when using non-Safari browsers (#3673). * Biometrics: Handle retry case. * Room: Remove membership events from room creation modal (#3679). + * PIN: Fix layout on small screens. ⚠️ API Changes * From 720bf97c9d5a08eb1282dddc07b04d27947b7f3d Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Fri, 2 Oct 2020 15:57:10 +0200 Subject: [PATCH 09/43] Prepare for new sprint --- CHANGES.rst | 24 ++++++++++++++++++++++++ Riot.xcodeproj/project.pbxproj | 8 ++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 461adacb1..83cae3fbe 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,27 @@ +Changes to be released in next version +================================================= + +✨ Features + * + +🙌 Improvements + * + +🐛 Bugfix + * + +⚠️ API Changes + * + +🗣 Translations + * + +🧱 Build + * + +Others + * + Changes in 1.0.14 (2020-10-02) ================================================= diff --git a/Riot.xcodeproj/project.pbxproj b/Riot.xcodeproj/project.pbxproj index 474195c87..d488d66c8 100644 --- a/Riot.xcodeproj/project.pbxproj +++ b/Riot.xcodeproj/project.pbxproj @@ -7277,7 +7277,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1.0.14; + CURRENT_PROJECT_VERSION = 1.0.15; DEFINES_MODULE = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -7297,7 +7297,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.0.14; + MARKETING_VERSION = 1.0.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -7336,7 +7336,7 @@ CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 1.0.14; + CURRENT_PROJECT_VERSION = 1.0.15; DEFINES_MODULE = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -7349,7 +7349,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.0.14; + MARKETING_VERSION = 1.0.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; From 1a68fab3d4d9a4cdd83cda2468828f613ddf3ad4 Mon Sep 17 00:00:00 2001 From: "@a2sc:matrix.org" Date: Fri, 2 Oct 2020 09:55:54 +0000 Subject: [PATCH 10/43] Translated using Weblate (German) Currently translated at 99.9% (1119 of 1120 strings) Translation: Element iOS/Element iOS Translate-URL: https://translate.riot.im/projects/riot-ios/riot-ios/de/ --- Riot/Assets/de.lproj/Vector.strings | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Riot/Assets/de.lproj/Vector.strings b/Riot/Assets/de.lproj/Vector.strings index 7650205e2..4e3d26db9 100644 --- a/Riot/Assets/de.lproj/Vector.strings +++ b/Riot/Assets/de.lproj/Vector.strings @@ -1187,7 +1187,7 @@ "pin_protection_choose_pin_welcome_after_login" = "Willkommen zurück."; "pin_protection_choose_pin_welcome_after_register" = "Willkommen."; "pin_protection_not_allowed_pin" = "Aus Sicherheitsgründen ist diese PIN nicht verfügbar. Bitte versuche es mit einer anderen PIN"; -"pin_protection_explanatory" = "PINs helfen dein Profil, deine Nachrichten und Kontakte so zu sichern, dass nur du Zugriff auf sie hast."; +"pin_protection_explanatory" = "Das Einrichten einer PIN schützt Daten wie Nachrichten und Kontakten so, dass nur du Zugriff auf sie hast, indem du die PIN beim Starten der App eingibst."; "searchable_directory_create_new_room" = "Erstelle einen neuen Raum"; "searchable_directory_x_network" = "%@ Netzwerk"; "searchable_directory_search_placeholder" = "Name oder ID"; @@ -1213,3 +1213,17 @@ "room_participants_leave_prompt_title_for_dm" = "Verlassen"; "room_participants_filter_room_members_for_dm" = "Mitglieder filtern"; "room_participants_security_information_room_not_encrypted_for_dm" = "Die Nachrichten hier sind nicht Ende-zu-Ende verschlüsselt."; +"room_participants_leave_prompt_msg_for_dm" = "Bist du sicher, dass du die Konversation verlassen möchtest?"; +"room_participants_security_information_room_encrypted_for_dm" = "Nachrichten hier sind Ende-zu-Ende verschlüsselt.\n\nDeine Nachrichten sind mit digitalen Schlüsseln gesichert, nur du und der/die Empfänger!n haben die einzigen Schlüssel, um jene zu entsperren."; +"room_details_title_for_dm" = "Details"; +"room_details_photo_for_dm" = "Bild"; +"room_details_room_name_for_dm" = "Name"; +"room_details_access_section_for_dm" = "Wer hat Zugriff hierauf?"; +"room_details_access_section_anyone_apart_from_guest_for_dm" = "Alle, die den Link kennen (ausgenommen Gäste)"; +"room_details_access_section_anyone_for_dm" = "Alle, die den Link kennen (auch Gäste)"; +"room_details_access_section_directory_toggle_for_dm" = "Im Raum-Verzeichnis auflisten"; +"room_details_no_local_addresses_for_dm" = "Keine lokalen Adressen vorhanden"; +"room_details_advanced_room_id_for_dm" = "ID:"; +"room_details_advanced_e2e_encryption_enabled_for_dm" = "Verschlüsselung ist hier aktiviert"; +"room_details_advanced_e2e_encryption_disabled_for_dm" = "Verschlüsselung ist hier nicht aktiviert."; +"pin_protection_kick_user_alert_message" = "Zu viele Fehler. Du wurdest ausgeloggt"; From 8e14d43a3fbfbc30fd7558cd51a8dcd921bd46ee Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 6 Oct 2020 00:53:58 +0300 Subject: [PATCH 11/43] Replace label with a text view --- .../Views/RoomInfoBasicView.swift | 18 +++++++-- .../RoomInfoList/Views/RoomInfoBasicView.xib | 40 ++++++++++--------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.swift b/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.swift index f889cc456..f454a5998 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.swift @@ -39,7 +39,13 @@ class RoomInfoBasicView: UIView { @IBOutlet private weak var badgeImageView: UIImageView! @IBOutlet private weak var roomNameLabel: UILabel! @IBOutlet private weak var roomAddressLabel: UILabel! - @IBOutlet private weak var roomTopicLabel: UILabel! + @IBOutlet private weak var roomTopicTextView: UITextView! { + didSet { + roomTopicTextView.contentInset = .zero + roomTopicTextView.textContainerInset = .zero + roomTopicTextView.textContainer.lineFragmentPadding = 0 + } + } func configure(withViewData viewData: RoomInfoBasicViewData) { let avatarImage = AvatarGenerator.generateAvatar(forMatrixItem: viewData.roomId, withDisplayName: viewData.roomDisplayName) @@ -61,8 +67,8 @@ class RoomInfoBasicView: UIView { roomNameLabel.text = viewData.roomDisplayName roomAddressLabel.text = viewData.mainRoomAlias roomAddressLabel.isHidden = roomAddressLabel.text?.isEmpty ?? true - roomTopicLabel.text = viewData.roomTopic - roomTopicLabel.isHidden = roomTopicLabel.text?.isEmpty ?? true + roomTopicTextView.text = viewData.roomTopic + roomTopicTextView.isHidden = roomTopicTextView.text?.isEmpty ?? true } } @@ -75,7 +81,11 @@ extension RoomInfoBasicView: Themable { backgroundColor = theme.headerBackgroundColor roomNameLabel.textColor = theme.textPrimaryColor roomAddressLabel.textColor = theme.textSecondaryColor - roomTopicLabel.textColor = theme.textSecondaryColor + roomTopicTextView.textColor = theme.textSecondaryColor + roomTopicTextView.linkTextAttributes = [ + NSAttributedString.Key.font: UIFont.systemFont(ofSize: 16), + NSAttributedString.Key.foregroundColor: theme.tintColor + ] } } diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.xib b/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.xib index 243b1b9cb..ff1edd99b 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.xib +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.xib @@ -10,21 +10,21 @@ - - + + - - + + - + - + @@ -63,34 +63,36 @@ - - + - + @@ -99,10 +101,10 @@ - + - + From 9d4a983a3213396e013b8518fa24600175c4407a Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 6 Oct 2020 00:59:30 +0300 Subject: [PATCH 12/43] Fix layout to show all of the topic --- .../RoomInfoListViewController.swift | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift index 9ae0ff7b6..1eb48036e 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift @@ -49,10 +49,7 @@ final class RoomInfoListViewController: UIViewController { }() private lazy var basicInfoView: RoomInfoBasicView = { - let view = RoomInfoBasicView.loadFromNib() - view.autoresizingMask = .flexibleWidth - view.translatesAutoresizingMaskIntoConstraints = true - return view + return RoomInfoBasicView.loadFromNib() }() private lazy var leaveAlertController: UIAlertController = { @@ -127,6 +124,19 @@ final class RoomInfoListViewController: UIViewController { return self.theme.statusBarStyle } + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + + let height = ceil(basicInfoView.systemLayoutSizeFitting(CGSize(width: view.bounds.width, height: 0)).height) + + // compare heights to avoid infinite loop + if height != basicInfoView.frame.height { + var headerFrame = basicInfoView.frame + headerFrame.size.height = height + basicInfoView.frame = headerFrame + } + } + // MARK: - Private private func updateSections(with viewData: RoomInfoListViewData) { From 6ef778debb00e1d819f62dc64cde7ca4e279d2b8 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 6 Oct 2020 01:01:00 +0300 Subject: [PATCH 13/43] Update CHANGES.rst --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 14232c007..f57b9dbdb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ Changes to be released in next version * 🙌 Improvements - * + * Room: Make topic links tappable (#3713). 🐛 Bugfix * From 40f931baedbf4a5e2b01cbd3462e809405e7896c Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 6 Oct 2020 01:07:19 +0300 Subject: [PATCH 14/43] Fix table view content size --- .../Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift index 1eb48036e..522bc32dc 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift @@ -134,6 +134,7 @@ final class RoomInfoListViewController: UIViewController { var headerFrame = basicInfoView.frame headerFrame.size.height = height basicInfoView.frame = headerFrame + mainTableView.tableHeaderView = basicInfoView } } From b1f53eafd81ddbe11efd9712436ed293f75d000c Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 6 Oct 2020 17:27:23 +0300 Subject: [PATCH 15/43] Add ReadMoreTextView --- Podfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Podfile b/Podfile index 1da4efc62..528c29f5d 100644 --- a/Podfile +++ b/Podfile @@ -74,6 +74,7 @@ abstract_target 'RiotPods' do pod 'KTCenterFlowLayout', '~> 1.3.1' pod 'ZXingObjC', '~> 3.6.5' pod 'FlowCommoniOS', '~> 1.8.7' + pod 'ReadMoreTextView', '~> 3.0.1' target 'RiotTests' do inherit! :search_paths @@ -102,7 +103,12 @@ post_install do |installer| # Because the WebRTC pod (included by the JingleCallStack pod) does not support it. # Plus the app does not enable it target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' + config.build_settings['ENABLE_BITCODE'] = 'NO' + + # Force ReadMoreTextView to use Swift 5.2 version (as there is no code changes to perform) + if target.name.include? 'ReadMoreTextView' + config.build_settings['SWIFT_VERSION'] = '5.2' + end end end end From 61f7d9be7b793954a1d2c184a92dcffdb78f2254 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 6 Oct 2020 17:27:35 +0300 Subject: [PATCH 16/43] Add thirdparty license --- Riot/Assets/third_party_licenses.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Riot/Assets/third_party_licenses.html b/Riot/Assets/third_party_licenses.html index 1dfe37c5d..983e89561 100644 --- a/Riot/Assets/third_party_licenses.html +++ b/Riot/Assets/third_party_licenses.html @@ -1469,6 +1469,28 @@ SOFTWARE.

+
  • + ReadMoreTextView (https://github.com/ilyapuchka/ReadMoreTextView) +

    UITextView subclass with "read more"/"read less" capabilities and UITextView extensions to handle touches in characters range. +

    It is released under the MIT license. +

    Copyright (c) 2015-2016 Ilya Puchka +

    Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: +

    The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. +

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +

    +
  • From f9b29983be870fb18d4b643ad18fe76d37dd4ebe Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 6 Oct 2020 17:27:53 +0300 Subject: [PATCH 17/43] Add less string --- Riot/Assets/en.lproj/Vector.strings | 1 + Riot/Generated/Strings.swift | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 25c1df89d..98884e77c 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -62,6 +62,7 @@ "joined" = "Joined"; "switch" = "Switch"; "more" = "More"; +"less" = "Less"; // Accessibility "accessibility_checkbox_label" = "checkbox"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 10521a18d..63b9c3030 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -1910,6 +1910,10 @@ internal enum VectorL10n { internal static var leave: String { return VectorL10n.tr("Vector", "leave") } + /// Less + internal static var less: String { + return VectorL10n.tr("Vector", "less") + } /// Got it internal static var majorUpdateDoneAction: String { return VectorL10n.tr("Vector", "major_update_done_action") From 1ef4bbb328284eb2a9cf099abaad396ad6edb664 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 6 Oct 2020 17:32:28 +0300 Subject: [PATCH 18/43] Use ReadMoreTextView for room tpic --- .../RoomInfoListViewController.swift | 14 +++++- .../Views/RoomInfoBasicView.swift | 44 ++++++++++++++++++- .../RoomInfoList/Views/RoomInfoBasicView.xib | 22 +++++++--- 3 files changed, 70 insertions(+), 10 deletions(-) diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift index 522bc32dc..25ea66917 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift @@ -49,7 +49,11 @@ final class RoomInfoListViewController: UIViewController { }() private lazy var basicInfoView: RoomInfoBasicView = { - return RoomInfoBasicView.loadFromNib() + let view = RoomInfoBasicView.loadFromNib() + view.onTopicSizeChange = { _ in + self.view.setNeedsLayout() + } + return view }() private lazy var leaveAlertController: UIAlertController = { @@ -127,7 +131,7 @@ final class RoomInfoListViewController: UIViewController { override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() - let height = ceil(basicInfoView.systemLayoutSizeFitting(CGSize(width: view.bounds.width, height: 0)).height) + let height = ceil(basicInfoView.systemLayoutSizeFitting(CGSize(width: view.bounds.width, height: 0), withHorizontalFittingPriority: .required, verticalFittingPriority: .fittingSizeLevel).height) // compare heights to avoid infinite loop if height != basicInfoView.frame.height { @@ -138,6 +142,12 @@ final class RoomInfoListViewController: UIViewController { } } + override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { + coordinator.animate(alongsideTransition: {_ in + self.basicInfoView.updateTrimmingOnTopic() + }, completion: nil) + } + // MARK: - Private private func updateSections(with viewData: RoomInfoListViewData) { diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.swift b/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.swift index f454a5998..0988e2b18 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.swift @@ -16,6 +16,7 @@ import UIKit import Reusable +import ReadMoreTextView class RoomInfoBasicView: UIView { @@ -39,14 +40,35 @@ class RoomInfoBasicView: UIView { @IBOutlet private weak var badgeImageView: UIImageView! @IBOutlet private weak var roomNameLabel: UILabel! @IBOutlet private weak var roomAddressLabel: UILabel! - @IBOutlet private weak var roomTopicTextView: UITextView! { + @IBOutlet private weak var roomTopicTextView: ReadMoreTextView! { didSet { roomTopicTextView.contentInset = .zero roomTopicTextView.textContainerInset = .zero roomTopicTextView.textContainer.lineFragmentPadding = 0 + roomTopicTextView.readMoreTextPadding = UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16) + roomTopicTextView.readLessTextPadding = UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16) + roomTopicTextView.shouldTrim = true + roomTopicTextView.maximumNumberOfLines = 4 + roomTopicTextView.onSizeChange = { _ in + self.roomTopicTextView.textAlignment = .center + self.onTopicSizeChange?(self) + } } } + /// Block to be invoked when topic text view changes its content size. + var onTopicSizeChange: ((RoomInfoBasicView) -> Void)? + + /// Force to update topic text view trimming. + func updateTrimmingOnTopic() { + roomTopicTextView.setNeedsUpdateTrim() + roomTopicTextView.layoutIfNeeded() + let currentValue = roomTopicTextView.shouldTrim + roomTopicTextView.shouldTrim = !currentValue + roomTopicTextView.shouldTrim = currentValue + roomTopicTextView.textAlignment = .center + } + func configure(withViewData viewData: RoomInfoBasicViewData) { let avatarImage = AvatarGenerator.generateAvatar(forMatrixItem: viewData.roomId, withDisplayName: viewData.roomDisplayName) @@ -70,7 +92,7 @@ class RoomInfoBasicView: UIView { roomTopicTextView.text = viewData.roomTopic roomTopicTextView.isHidden = roomTopicTextView.text?.isEmpty ?? true } - + } extension RoomInfoBasicView: NibLoadable {} @@ -86,6 +108,24 @@ extension RoomInfoBasicView: Themable { NSAttributedString.Key.font: UIFont.systemFont(ofSize: 16), NSAttributedString.Key.foregroundColor: theme.tintColor ] + let mutableReadMore = NSMutableAttributedString(string: "... ", attributes: [ + NSAttributedString.Key.font: UIFont.systemFont(ofSize: 16), + NSAttributedString.Key.foregroundColor: theme.textSecondaryColor + ]) + let attributedMore = NSAttributedString(string: VectorL10n.more, attributes: [ + NSAttributedString.Key.font: UIFont.systemFont(ofSize: 16), + NSAttributedString.Key.foregroundColor: theme.tintColor + ]) + mutableReadMore.append(attributedMore) + roomTopicTextView.attributedReadMoreText = mutableReadMore + + let mutableReadLess = NSMutableAttributedString(string: " ") + let attributedLess = NSAttributedString(string: VectorL10n.less, attributes: [ + NSAttributedString.Key.font: UIFont.systemFont(ofSize: 16), + NSAttributedString.Key.foregroundColor: theme.tintColor + ]) + mutableReadLess.append(attributedLess) + roomTopicTextView.attributedReadLessText = mutableReadLess } } diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.xib b/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.xib index ff1edd99b..ae9de8030 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.xib +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.xib @@ -63,28 +63,38 @@ -