From fa61a6a11fa402134383e5ea5ff880297e5e6514 Mon Sep 17 00:00:00 2001 From: Rudrank Date: Mon, 19 Aug 2019 12:08:29 +0530 Subject: [PATCH 1/4] add changing servers accessibility --- .../SubscriptionsList/SubscriptionsViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift b/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift index 85239c0959..efb81ec307 100644 --- a/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift +++ b/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift @@ -110,6 +110,8 @@ final class SubscriptionsViewController: BaseViewController { override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() + serversView?.accessibilityViewIsModal = true + sortingView?.accessibilityViewIsModal = true serversView?.frame = frameForDropDownOverlay sortingView?.frame = frameForDropDownOverlay } @@ -117,6 +119,8 @@ final class SubscriptionsViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + UIAccessibility.post(notification: .screenChanged, argument: titleView?.labelMessages) + // This method can stay here, since adding a new connection handler // will override the existing one if there's already one. This is here // to prevent that some connection issue removes all the connection handler. @@ -237,6 +241,7 @@ final class SubscriptionsViewController: BaseViewController { self.titleView = titleView let tapGesture = UITapGestureRecognizer(target: self, action: #selector(recognizeTitleViewTapGesture(_:))) + titleView.isAccessibilityElement = true titleView.addGestureRecognizer(tapGesture) } } @@ -362,6 +367,7 @@ extension SubscriptionsViewController: UISearchBarDelegate { titleView?.updateTitleImage(reverse: true) serversView = ServersListView.showIn(view, frame: frameForDropDownOverlay) + UIAccessibility.post(notification: .screenChanged, argument: serversView?.labelTitle) serversView?.delegate = self } From df5bb5738467f32eb262331a21a4c326c05daab0 Mon Sep 17 00:00:00 2001 From: Rudrank Date: Mon, 19 Aug 2019 12:19:54 +0530 Subject: [PATCH 2/4] accessibility for serverMenu --- Rocket.Chat/Views/Subscriptions/ServersListView.swift | 1 + Rocket.Chat/Views/Subscriptions/SubscriptionsTitleView.swift | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Rocket.Chat/Views/Subscriptions/ServersListView.swift b/Rocket.Chat/Views/Subscriptions/ServersListView.swift index 9e903cebc2..7c0d976f0c 100644 --- a/Rocket.Chat/Views/Subscriptions/ServersListView.swift +++ b/Rocket.Chat/Views/Subscriptions/ServersListView.swift @@ -21,6 +21,7 @@ final class ServersListView: UIView { @IBOutlet weak var labelTitle: UILabel! { didSet { labelTitle.text = viewModel.title + labelTitle.accessibilityTraits = .header } } diff --git a/Rocket.Chat/Views/Subscriptions/SubscriptionsTitleView.swift b/Rocket.Chat/Views/Subscriptions/SubscriptionsTitleView.swift index 1d0bc46ea8..05955f1490 100644 --- a/Rocket.Chat/Views/Subscriptions/SubscriptionsTitleView.swift +++ b/Rocket.Chat/Views/Subscriptions/SubscriptionsTitleView.swift @@ -30,6 +30,9 @@ final class SubscriptionsTitleView: UIView { buttonServer.semanticContentAttribute = .forceRightToLeft buttonServer.layer.cornerRadius = 5 buttonServer.layer.masksToBounds = true + + buttonServer.isAccessibilityElement = true + buttonServer.accessibilityTraits = .button } } @@ -47,8 +50,10 @@ final class SubscriptionsTitleView: UIView { if reverse, let cgImage = image.cgImage { let rotatedImage = UIImage(cgImage: cgImage, scale: image.scale, orientation: .downMirrored) buttonServer.setImage(rotatedImage, for: .normal) + buttonServer.accessibilityHint = VOLocalizedString("subscriptions.server_button.close.hint") } else { buttonServer.setImage(image, for: .normal) + buttonServer.accessibilityHint = VOLocalizedString("subscriptions.server_button.hint") } } } From bdf6b0c65995282eb03017959041a07e1f3545fa Mon Sep 17 00:00:00 2001 From: Rudrank Date: Mon, 19 Aug 2019 12:32:17 +0530 Subject: [PATCH 3/4] localisation of the accessibilityLabels --- Rocket.Chat/Resources/cs.lproj/VoiceOver.strings | 3 ++- Rocket.Chat/Resources/de.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/el.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/en.lproj/VoiceOver.strings | 4 +++- Rocket.Chat/Resources/es.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/fr.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/it.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/ja.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/pl.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/ru.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings | 2 ++ Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings | 2 ++ 14 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings b/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings index 9837f1bce0..0dabdb32d3 100644 --- a/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings @@ -28,7 +28,8 @@ "subscriptions.main.userview.value" = "Server: %@. User: %@. Status: %@."; "subscriptions.main.userview.hint" = "Double tap to change status."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO - +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/de.lproj/VoiceOver.strings b/Rocket.Chat/Resources/de.lproj/VoiceOver.strings index 416806c64b..8769a99927 100644 --- a/Rocket.Chat/Resources/de.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/de.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "Server: %@. Benutzer: %@. Status: %@."; "subscriptions.main.userview.hint" = "Klicken Sie doppelt, um den Status zu ändern."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/el.lproj/VoiceOver.strings b/Rocket.Chat/Resources/el.lproj/VoiceOver.strings index 2551268bf5..d4cc4cd18e 100644 --- a/Rocket.Chat/Resources/el.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/el.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "Εξυπηρετητής: %@. Χρήστης: %@. Κατάσταση: %@."; "subscriptions.main.userview.hint" = "Πατήστε δύο φορές για αλλαγή κατάστασης."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/en.lproj/VoiceOver.strings b/Rocket.Chat/Resources/en.lproj/VoiceOver.strings index 95c94ada76..9bf46fcf26 100644 --- a/Rocket.Chat/Resources/en.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/en.lproj/VoiceOver.strings @@ -27,7 +27,9 @@ "subscriptions.main.userview.label" = "Session information"; "subscriptions.main.userview.value" = "Server: %@. User: %@. Status: %@."; "subscriptions.main.userview.hint" = "Double tap to change status."; -"subscriptions.main.channel.hint" = "Double tap to enter"; +"subscriptions.main.channel.hint" = "Double tap to enter"; +"subscriptions.server_button.hint" = "Double tap to add or change server"; +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; diff --git a/Rocket.Chat/Resources/es.lproj/VoiceOver.strings b/Rocket.Chat/Resources/es.lproj/VoiceOver.strings index d6bf232c6d..3f3537b2d4 100644 --- a/Rocket.Chat/Resources/es.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/es.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "Servidor: %@. Usuario: %@. Estado: %@."; "subscriptions.main.userview.hint" = "Toca dos veces para cambiar el estado"; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings b/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings index 9436ebc611..0dabdb32d3 100644 --- a/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "Server: %@. User: %@. Status: %@."; "subscriptions.main.userview.hint" = "Double tap to change status."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/it.lproj/VoiceOver.strings b/Rocket.Chat/Resources/it.lproj/VoiceOver.strings index 2e0d526b00..68e5bf124b 100644 --- a/Rocket.Chat/Resources/it.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/it.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "Server: %@. Utente: %@. Stato: %@."; "subscriptions.main.userview.hint" = "Fare doppio clic per cambiare lo stato."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings b/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings index b70947585f..2585768b83 100644 --- a/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "サーバー: %@. ユーザー: %@. ステータス: %@."; "subscriptions.main.userview.hint" = "ステータスを変更するにはダブルタップしてください。"; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings b/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings index af140a3598..c7acda200c 100644 --- a/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "Serwer: %@. Użytkownik: %@. Status: %@."; "subscriptions.main.userview.hint" = "Dotknij dwukrotnie aby zmienić status."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings b/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings index 7d80745784..8cb8744169 100644 --- a/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "Servidor: %@. Usuário: %@. Status: %@."; "subscriptions.main.userview.hint" = "Toque duplo para mudar o status."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings b/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings index 7d80745784..8cb8744169 100644 --- a/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "Servidor: %@. Usuário: %@. Status: %@."; "subscriptions.main.userview.hint" = "Toque duplo para mudar o status."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings b/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings index 486b7d80dd..dca7592fb8 100644 --- a/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "Сервер: %@. Пользователь: %@. Статус: %@."; "subscriptions.main.userview.hint" = "Дважды нажмите, чтобы изменить статус."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings b/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings index e7a8661ac5..1c2b8c17ee 100644 --- a/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "服务器: %@. 用户: %@. 状态: %@."; "subscriptions.main.userview.hint" = "双击变更状态"; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings b/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings index fd93a1cc8a..bff31f4fd7 100644 --- a/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings @@ -28,6 +28,8 @@ "subscriptions.main.userview.value" = "伺服器: %@. 訊息: %@. 狀態: %@."; "subscriptions.main.userview.hint" = "點擊兩下變更狀態"; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.server_button.hint" = "Double tap to add or change server"; // TODO +"subscriptions.server_button.close.hint" = "Double tap to close the server menu"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO From 84be45e3de8df4671ac4df80010cd65b8414b2cb Mon Sep 17 00:00:00 2001 From: Rudrank Date: Mon, 26 Aug 2019 14:52:55 +0530 Subject: [PATCH 4/4] fix the accessibility Notification on the serverView --- .../SubscriptionsList/SubscriptionsViewController.swift | 4 +--- Rocket.Chat/Views/Subscriptions/ServersListView.swift | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift b/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift index efb81ec307..b736f85dd5 100644 --- a/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift +++ b/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift @@ -119,8 +119,6 @@ final class SubscriptionsViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - UIAccessibility.post(notification: .screenChanged, argument: titleView?.labelMessages) - // This method can stay here, since adding a new connection handler // will override the existing one if there's already one. This is here // to prevent that some connection issue removes all the connection handler. @@ -367,8 +365,8 @@ extension SubscriptionsViewController: UISearchBarDelegate { titleView?.updateTitleImage(reverse: true) serversView = ServersListView.showIn(view, frame: frameForDropDownOverlay) - UIAccessibility.post(notification: .screenChanged, argument: serversView?.labelTitle) serversView?.delegate = self + UIAccessibility.post(notification: .screenChanged, argument: serversView) } func closeServersList() { diff --git a/Rocket.Chat/Views/Subscriptions/ServersListView.swift b/Rocket.Chat/Views/Subscriptions/ServersListView.swift index 7c0d976f0c..d8babac737 100644 --- a/Rocket.Chat/Views/Subscriptions/ServersListView.swift +++ b/Rocket.Chat/Views/Subscriptions/ServersListView.swift @@ -81,6 +81,7 @@ final class ServersListView: UIView { DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { instance.headerViewTopConstraint.constant = 0 + UIAccessibility.post(notification: .screenChanged, argument: self) instance.animates({ instance.backgroundColor = UIColor.black.withAlphaComponent(0.4)