Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[WIP] [NEW] Project 03 - Changing, searching and adding channels VoiceOver accessible #2751

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 14 additions & 3 deletions Rocket.Chat/Controllers/Chat/ChannelActionsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class ChannelActionsViewController: BaseViewController {

tableView?.contentInsetAdjustmentBehavior = .never

navigationItem.leftBarButtonItem?.accessibilityLabel = VOLocalizedString("auth.close.label")

setupNavigationBarButtons()
registerCells()
}
Expand Down Expand Up @@ -135,34 +137,43 @@ class ChannelActionsViewController: BaseViewController {
target: self,
action: #selector(buttonFavoriteDidPressed)
)
buttonFavorite.accessibilityLabel = favoriteButtonAccessibilityLabel

buttons.append(buttonFavorite)
self.buttonFavorite = buttonFavorite
updateButtonFavoriteImage()
}

if settings.isJitsiEnabled && AppManager.isVideoCallAvailable {
buttons.append(UIBarButtonItem(
image: UIImage(named: "UserDetail_VideoCall"),
let buttonVideoCall = UIBarButtonItem(image: UIImage(named: "UserDetail_VideoCall"),
style: .plain,
target: self,
action: #selector(buttonVideoCallDidPressed)
))
)
buttonVideoCall.accessibilityLabel = VOLocalizedString("channel.actions.videoCall.label")
buttons.append(buttonVideoCall)
}

navigationItem.rightBarButtonItems = buttons
}
}

// MARK: Accessibility

var favoriteButtonAccessibilityLabel: String? = VOLocalizedString("channel.actions.star.label")
var favoriteSelectedButtonAccessibilityLabel: String? = VOLocalizedString("channel.actions.unstar.label")

func updateButtonFavoriteImage(_ force: Bool = false, value: Bool = false) {
guard let buttonFavorite = self.buttonFavorite else { return }
let favorite = force ? value : subscription?.favorite ?? false
var image: UIImage?

if favorite {
image = UIImage(named: "Star-Filled")?.imageWithTint(UIColor.RCFavoriteMark())
buttonFavorite.accessibilityLabel = favoriteSelectedButtonAccessibilityLabel
} else {
image = UIImage(named: "Star")?.imageWithTint(UIColor.RCGray())
buttonFavorite.accessibilityLabel = favoriteButtonAccessibilityLabel
}

buttonFavorite.image = image?.withRenderingMode(.alwaysOriginal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ final class NewRoomViewController: BaseViewController {
override func viewDidLoad() {
super.viewDidLoad()

navigationItem.leftBarButtonItem?.accessibilityLabel = VOLocalizedString("auth.close.label")

NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChangeFrame(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChangeFrame(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ final class SubscriptionsViewController: BaseViewController {
super.viewDidLoad()

navigationItem.leftBarButtonItem?.accessibilityLabel = VOLocalizedString("channel.preferences.label")
navigationItem.rightBarButtonItem?.accessibilityLabel = VOLocalizedString("new_room.title.label")

// If the device is not using the SplitView, we want to show
// the 3D Touch preview for the cells
Expand Down
8 changes: 7 additions & 1 deletion Rocket.Chat/Resources/cs.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"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"; // TODO

"subscriptions.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/de.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "Sitzungsinformationen";
"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.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/el.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "Πληροφορία Συνόδου";
"subscriptions.main.userview.value" = "Εξυπηρετητής: %@. Χρήστης: %@. Κατάσταση: %@.";
"subscriptions.main.userview.hint" = "Πατήστε δύο φορές για αλλαγή κατάστασης.";
"subscriptions.main.channel.hint" = "Double tap to enter"; // TODO
"subscriptions.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
9 changes: 8 additions & 1 deletion Rocket.Chat/Resources/en.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences";
"new_room.title.label" = "Create new channel";
"channel.actions.star.label" = "Star";
"channel.actions.unstar.label" = "Unstar";
"channel.actions.videoCall.label" = "Video Call";

// MARK: Subscriptions
"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.list.message.label" = "Message: ";
"subscriptions.list.notification.label" = "Notification";
"subscriptions.list.notifications.label" = "Notifications";

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture";
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/es.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "Información de la sesión";
"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.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/fr.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"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"; // TODO
"subscriptions.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/it.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "Informazioni Sessione";
"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.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/ja.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "セッション情報";
"subscriptions.main.userview.value" = "サーバー: %@. ユーザー: %@. ステータス: %@.";
"subscriptions.main.userview.hint" = "ステータスを変更するにはダブルタップしてください。";
"subscriptions.main.channel.hint" = "Double tap to enter"; // TODO
"subscriptions.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/pl.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "Informacje o sesji";
"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.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "Informação da sessão";
"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.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "Informação da sessão";
"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.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/ru.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "Информация о сеансе";
"subscriptions.main.userview.value" = "Сервер: %@. Пользователь: %@. Статус: %@.";
"subscriptions.main.userview.hint" = "Дважды нажмите, чтобы изменить статус.";
"subscriptions.main.channel.hint" = "Double tap to enter"; // TODO
"subscriptions.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "会话信息";
"subscriptions.main.userview.value" = "服务器: %@. 用户: %@. 状态: %@.";
"subscriptions.main.userview.hint" = "双击变更状态";
"subscriptions.main.channel.hint" = "Double tap to enter"; // TODO
"subscriptions.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
7 changes: 7 additions & 0 deletions Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

// MARK: Channels
"channel.preferences.label" = "Preferences"; // TODO
"new_room.title.label" = "Create new channel"; // TODO
"channel.actions.star.label" = "Star"; // TODO
"channel.actions.unstar.label" = "Unstar"; // TODO
"channel.actions.videoCall.label" = "Video Call"; // TODO

// MARK: Subscriptions
"subscriptions.main.userview.label" = "聊天訊息";
"subscriptions.main.userview.value" = "伺服器: %@. 訊息: %@. 狀態: %@.";
"subscriptions.main.userview.hint" = "點擊兩下變更狀態";
"subscriptions.main.channel.hint" = "Double tap to enter"; // TODO
"subscriptions.list.message.label" = "Message: "; // TODO
"subscriptions.list.notification.label" = "Notification"; // TODO
"subscriptions.list.notifications.label" = "Notifications"; // TODO

// MARK: Preferences
"preferences.profile.edit.label" = "Profile picture"; // TODO
Expand Down
10 changes: 10 additions & 0 deletions Rocket.Chat/Views/Cells/Subscription/BaseSubscriptionCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ class BaseSubscriptionCell: SwipeTableViewCell, SubscriptionCellProtocol {
if subscription.unread > 0 {
viewUnread.isHidden = false
labelUnread.text = "\(subscription.unread)"

if subscription.unread == 1 {
labelUnread.accessibilityLabel =
["\(subscription.unread) ", VOLocalizedString("subscriptions.list.notification.label")]
.compactMap {$0}.joined()
} else {
labelUnread.accessibilityLabel =
["\(subscription.unread) ", VOLocalizedString("subscriptions.list.notifications.label")]
.compactMap {$0}.joined()
}
} else {
viewUnread.isHidden = true
}
Expand Down