add accessibility labels for automation test
This commit is contained in:
parent
2d8fa193e2
commit
265659c8cb
|
@ -111,6 +111,7 @@ final class CallVC: UIViewController, VideoPreviewDelegate {
|
||||||
|
|
||||||
private lazy var hangUpButton: UIButton = {
|
private lazy var hangUpButton: UIButton = {
|
||||||
let result = UIButton(type: .custom)
|
let result = UIButton(type: .custom)
|
||||||
|
result.accessibilityLabel = "End call button"
|
||||||
result.setImage(
|
result.setImage(
|
||||||
UIImage(named: "EndCall")?
|
UIImage(named: "EndCall")?
|
||||||
.withRenderingMode(.alwaysTemplate),
|
.withRenderingMode(.alwaysTemplate),
|
||||||
|
|
|
@ -30,6 +30,7 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
|
||||||
|
|
||||||
private lazy var groupNameLabel: UILabel = {
|
private lazy var groupNameLabel: UILabel = {
|
||||||
let result: UILabel = UILabel()
|
let result: UILabel = UILabel()
|
||||||
|
result.accessibilityLabel = "Group name"
|
||||||
result.font = .boldSystemFont(ofSize: Values.veryLargeFontSize)
|
result.font = .boldSystemFont(ofSize: Values.veryLargeFontSize)
|
||||||
result.themeTextColor = .textPrimary
|
result.themeTextColor = .textPrimary
|
||||||
result.lineBreakMode = .byTruncatingTail
|
result.lineBreakMode = .byTruncatingTail
|
||||||
|
@ -50,6 +51,7 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
|
||||||
|
|
||||||
private lazy var addMembersButton: SessionButton = {
|
private lazy var addMembersButton: SessionButton = {
|
||||||
let result: SessionButton = SessionButton(style: .bordered, size: .medium)
|
let result: SessionButton = SessionButton(style: .bordered, size: .medium)
|
||||||
|
result.accessibilityLabel = "Add members"
|
||||||
result.setTitle("vc_conversation_settings_invite_button_title".localized(), for: .normal)
|
result.setTitle("vc_conversation_settings_invite_button_title".localized(), for: .normal)
|
||||||
result.addTarget(self, action: #selector(addMembers), for: UIControl.Event.touchUpInside)
|
result.addTarget(self, action: #selector(addMembers), for: UIControl.Event.touchUpInside)
|
||||||
result.contentEdgeInsets = UIEdgeInsets(top: 0, leading: Values.mediumSpacing, bottom: 0, trailing: Values.mediumSpacing)
|
result.contentEdgeInsets = UIEdgeInsets(top: 0, leading: Values.mediumSpacing, bottom: 0, trailing: Values.mediumSpacing)
|
||||||
|
@ -59,6 +61,7 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
|
||||||
|
|
||||||
@objc private lazy var tableView: UITableView = {
|
@objc private lazy var tableView: UITableView = {
|
||||||
let result: UITableView = UITableView()
|
let result: UITableView = UITableView()
|
||||||
|
result.accessibilityLabel = "Contact"
|
||||||
result.dataSource = self
|
result.dataSource = self
|
||||||
result.delegate = self
|
result.delegate = self
|
||||||
result.separatorStyle = .none
|
result.separatorStyle = .none
|
||||||
|
@ -264,6 +267,12 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
|
||||||
}
|
}
|
||||||
|
|
||||||
let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(handleDoneButtonTapped))
|
let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(handleDoneButtonTapped))
|
||||||
|
if isEditingGroupName {
|
||||||
|
doneButton.accessibilityLabel = "Accept name change"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
doneButton.accessibilityLabel = "Apply changes"
|
||||||
|
}
|
||||||
doneButton.themeTintColor = .textPrimary
|
doneButton.themeTintColor = .textPrimary
|
||||||
navigationItem.rightBarButtonItem = doneButton
|
navigationItem.rightBarButtonItem = doneButton
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ extension ContextMenuVC {
|
||||||
let isEmojiAction: Bool
|
let isEmojiAction: Bool
|
||||||
let isEmojiPlus: Bool
|
let isEmojiPlus: Bool
|
||||||
let isDismissAction: Bool
|
let isDismissAction: Bool
|
||||||
|
let accessibilityLabel: String?
|
||||||
let work: () -> Void
|
let work: () -> Void
|
||||||
|
|
||||||
// MARK: - Initialization
|
// MARK: - Initialization
|
||||||
|
@ -20,6 +21,7 @@ extension ContextMenuVC {
|
||||||
isEmojiAction: Bool = false,
|
isEmojiAction: Bool = false,
|
||||||
isEmojiPlus: Bool = false,
|
isEmojiPlus: Bool = false,
|
||||||
isDismissAction: Bool = false,
|
isDismissAction: Bool = false,
|
||||||
|
accessibilityLabel: String? = nil,
|
||||||
work: @escaping () -> Void
|
work: @escaping () -> Void
|
||||||
) {
|
) {
|
||||||
self.icon = icon
|
self.icon = icon
|
||||||
|
@ -27,6 +29,7 @@ extension ContextMenuVC {
|
||||||
self.isEmojiAction = isEmojiAction
|
self.isEmojiAction = isEmojiAction
|
||||||
self.isEmojiPlus = isEmojiPlus
|
self.isEmojiPlus = isEmojiPlus
|
||||||
self.isDismissAction = isDismissAction
|
self.isDismissAction = isDismissAction
|
||||||
|
self.accessibilityLabel = accessibilityLabel
|
||||||
self.work = work
|
self.work = work
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +38,8 @@ extension ContextMenuVC {
|
||||||
static func reply(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action {
|
static func reply(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action {
|
||||||
return Action(
|
return Action(
|
||||||
icon: UIImage(named: "ic_reply"),
|
icon: UIImage(named: "ic_reply"),
|
||||||
title: "context_menu_reply".localized()
|
title: "context_menu_reply".localized(),
|
||||||
|
accessibilityLabel: "Reply to message"
|
||||||
) { delegate?.reply(cellViewModel) }
|
) { delegate?.reply(cellViewModel) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,14 +60,16 @@ extension ContextMenuVC {
|
||||||
static func delete(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action {
|
static func delete(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action {
|
||||||
return Action(
|
return Action(
|
||||||
icon: UIImage(named: "ic_trash"),
|
icon: UIImage(named: "ic_trash"),
|
||||||
title: "TXT_DELETE_TITLE".localized()
|
title: "TXT_DELETE_TITLE".localized(),
|
||||||
|
accessibilityLabel: "Delete message"
|
||||||
) { delegate?.delete(cellViewModel) }
|
) { delegate?.delete(cellViewModel) }
|
||||||
}
|
}
|
||||||
|
|
||||||
static func save(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action {
|
static func save(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action {
|
||||||
return Action(
|
return Action(
|
||||||
icon: UIImage(named: "ic_download"),
|
icon: UIImage(named: "ic_download"),
|
||||||
title: "context_menu_save".localized()
|
title: "context_menu_save".localized(),
|
||||||
|
accessibilityLabel: "Save attachment"
|
||||||
) { delegate?.save(cellViewModel) }
|
) { delegate?.save(cellViewModel) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ extension ContextMenuVC {
|
||||||
self.dismiss = dismiss
|
self.dismiss = dismiss
|
||||||
|
|
||||||
super.init(frame: CGRect.zero)
|
super.init(frame: CGRect.zero)
|
||||||
|
self.accessibilityLabel = action.accessibilityLabel
|
||||||
setUpViewHierarchy()
|
setUpViewHierarchy()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,8 @@ extension ConversationVC:
|
||||||
title: "modal_call_permission_request_title".localized(),
|
title: "modal_call_permission_request_title".localized(),
|
||||||
explanation: "modal_call_permission_request_explanation".localized(),
|
explanation: "modal_call_permission_request_explanation".localized(),
|
||||||
confirmTitle: "vc_settings_title".localized(),
|
confirmTitle: "vc_settings_title".localized(),
|
||||||
|
confirmAccessibilityLabel: "Settings",
|
||||||
|
cancelAccessibilityLabel: "Cancel",
|
||||||
dismissOnConfirm: false // Custom dismissal logic
|
dismissOnConfirm: false // Custom dismissal logic
|
||||||
) { [weak self] _ in
|
) { [weak self] _ in
|
||||||
self?.dismiss(animated: true) {
|
self?.dismiss(animated: true) {
|
||||||
|
@ -854,6 +856,8 @@ extension ConversationVC:
|
||||||
range: (message as NSString).range(of: cellViewModel.authorName)
|
range: (message as NSString).range(of: cellViewModel.authorName)
|
||||||
),
|
),
|
||||||
confirmTitle: "modal_download_button_title".localized(),
|
confirmTitle: "modal_download_button_title".localized(),
|
||||||
|
confirmAccessibilityLabel: "Download media",
|
||||||
|
cancelAccessibilityLabel: "Don't download media",
|
||||||
dismissOnConfirm: false // Custom dismissal logic
|
dismissOnConfirm: false // Custom dismissal logic
|
||||||
) { [weak self] _ in
|
) { [weak self] _ in
|
||||||
self?.viewModel.trustContact()
|
self?.viewModel.trustContact()
|
||||||
|
|
|
@ -191,8 +191,10 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl
|
||||||
lazy var blockedBanner: InfoBanner = {
|
lazy var blockedBanner: InfoBanner = {
|
||||||
let result: InfoBanner = InfoBanner(
|
let result: InfoBanner = InfoBanner(
|
||||||
message: self.viewModel.blockedBannerMessage,
|
message: self.viewModel.blockedBannerMessage,
|
||||||
backgroundColor: .danger
|
backgroundColor: .danger,
|
||||||
|
messageLabelAccessibilityLabel: "Blocked banner text"
|
||||||
)
|
)
|
||||||
|
result.accessibilityLabel = "Blocked banner"
|
||||||
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(unblock))
|
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(unblock))
|
||||||
result.addGestureRecognizer(tapGestureRecognizer)
|
result.addGestureRecognizer(tapGestureRecognizer)
|
||||||
|
|
||||||
|
@ -240,6 +242,7 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl
|
||||||
|
|
||||||
private lazy var messageRequestAcceptButton: UIButton = {
|
private lazy var messageRequestAcceptButton: UIButton = {
|
||||||
let result: SessionButton = SessionButton(style: .bordered, size: .medium)
|
let result: SessionButton = SessionButton(style: .bordered, size: .medium)
|
||||||
|
result.accessibilityLabel = "Accept message request"
|
||||||
result.translatesAutoresizingMaskIntoConstraints = false
|
result.translatesAutoresizingMaskIntoConstraints = false
|
||||||
result.setTitle("TXT_DELETE_ACCEPT".localized(), for: .normal)
|
result.setTitle("TXT_DELETE_ACCEPT".localized(), for: .normal)
|
||||||
result.addTarget(self, action: #selector(acceptMessageRequest), for: .touchUpInside)
|
result.addTarget(self, action: #selector(acceptMessageRequest), for: .touchUpInside)
|
||||||
|
@ -249,6 +252,7 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl
|
||||||
|
|
||||||
private lazy var messageRequestDeleteButton: UIButton = {
|
private lazy var messageRequestDeleteButton: UIButton = {
|
||||||
let result: SessionButton = SessionButton(style: .destructive, size: .medium)
|
let result: SessionButton = SessionButton(style: .destructive, size: .medium)
|
||||||
|
result.accessibilityLabel = "Decline message request"
|
||||||
result.translatesAutoresizingMaskIntoConstraints = false
|
result.translatesAutoresizingMaskIntoConstraints = false
|
||||||
result.setTitle("TXT_DECLINE_TITLE".localized(), for: .normal)
|
result.setTitle("TXT_DECLINE_TITLE".localized(), for: .normal)
|
||||||
result.addTarget(self, action: #selector(deleteMessageRequest), for: .touchUpInside)
|
result.addTarget(self, action: #selector(deleteMessageRequest), for: .touchUpInside)
|
||||||
|
@ -258,6 +262,7 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl
|
||||||
|
|
||||||
private lazy var messageRequestBlockButton: UIButton = {
|
private lazy var messageRequestBlockButton: UIButton = {
|
||||||
let result: UIButton = UIButton()
|
let result: UIButton = UIButton()
|
||||||
|
result.accessibilityLabel = "Block message request"
|
||||||
result.translatesAutoresizingMaskIntoConstraints = false
|
result.translatesAutoresizingMaskIntoConstraints = false
|
||||||
result.clipsToBounds = true
|
result.clipsToBounds = true
|
||||||
result.titleLabel?.font = UIFont.boldSystemFont(ofSize: 16)
|
result.titleLabel?.font = UIFont.boldSystemFont(ofSize: 16)
|
||||||
|
@ -1036,7 +1041,7 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl
|
||||||
profilePictureView.addGestureRecognizer(tapGestureRecognizer)
|
profilePictureView.addGestureRecognizer(tapGestureRecognizer)
|
||||||
|
|
||||||
let settingsButtonItem: UIBarButtonItem = UIBarButtonItem(customView: profilePictureView)
|
let settingsButtonItem: UIBarButtonItem = UIBarButtonItem(customView: profilePictureView)
|
||||||
settingsButtonItem.accessibilityLabel = "Settings button"
|
settingsButtonItem.accessibilityLabel = "More options"
|
||||||
settingsButtonItem.isAccessibilityElement = true
|
settingsButtonItem.isAccessibilityElement = true
|
||||||
|
|
||||||
if SessionCall.isEnabled && !threadData.threadIsNoteToSelf {
|
if SessionCall.isEnabled && !threadData.threadIsNoteToSelf {
|
||||||
|
@ -1046,6 +1051,7 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl
|
||||||
target: self,
|
target: self,
|
||||||
action: #selector(startCall)
|
action: #selector(startCall)
|
||||||
)
|
)
|
||||||
|
callButton.accessibilityLabel = "Call button"
|
||||||
|
|
||||||
navigationItem.rightBarButtonItems = [settingsButtonItem, callButton]
|
navigationItem.rightBarButtonItems = [settingsButtonItem, callButton]
|
||||||
}
|
}
|
||||||
|
@ -1055,7 +1061,7 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl
|
||||||
|
|
||||||
default:
|
default:
|
||||||
let rightBarButtonItem: UIBarButtonItem = UIBarButtonItem(image: UIImage(named: "Gear"), style: .plain, target: self, action: #selector(openSettings))
|
let rightBarButtonItem: UIBarButtonItem = UIBarButtonItem(image: UIImage(named: "Gear"), style: .plain, target: self, action: #selector(openSettings))
|
||||||
rightBarButtonItem.accessibilityLabel = "Settings button"
|
rightBarButtonItem.accessibilityLabel = "More options"
|
||||||
rightBarButtonItem.isAccessibilityElement = true
|
rightBarButtonItem.isAccessibilityElement = true
|
||||||
|
|
||||||
navigationItem.rightBarButtonItems = [rightBarButtonItem]
|
navigationItem.rightBarButtonItems = [rightBarButtonItem]
|
||||||
|
|
|
@ -26,28 +26,28 @@ final class ExpandingAttachmentsButton: UIView, InputViewButtonDelegate {
|
||||||
// MARK: UI Components
|
// MARK: UI Components
|
||||||
lazy var gifButton: InputViewButton = {
|
lazy var gifButton: InputViewButton = {
|
||||||
let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_gif_black"), delegate: self, hasOpaqueBackground: true)
|
let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_gif_black"), delegate: self, hasOpaqueBackground: true)
|
||||||
result.accessibilityLabel = "accessibility_gif_button".localized()
|
result.accessibilityLabel = "GIF button"
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}()
|
}()
|
||||||
lazy var gifButtonContainer = container(for: gifButton)
|
lazy var gifButtonContainer = container(for: gifButton)
|
||||||
lazy var documentButton: InputViewButton = {
|
lazy var documentButton: InputViewButton = {
|
||||||
let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_document_black"), delegate: self, hasOpaqueBackground: true)
|
let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_document_black"), delegate: self, hasOpaqueBackground: true)
|
||||||
result.accessibilityLabel = "accessibility_document_button".localized()
|
result.accessibilityLabel = "Documents folder"
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}()
|
}()
|
||||||
lazy var documentButtonContainer = container(for: documentButton)
|
lazy var documentButtonContainer = container(for: documentButton)
|
||||||
lazy var libraryButton: InputViewButton = {
|
lazy var libraryButton: InputViewButton = {
|
||||||
let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_camera_roll_black"), delegate: self, hasOpaqueBackground: true)
|
let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_camera_roll_black"), delegate: self, hasOpaqueBackground: true)
|
||||||
result.accessibilityLabel = "accessibility_library_button".localized()
|
result.accessibilityLabel = "Images folder"
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}()
|
}()
|
||||||
lazy var libraryButtonContainer = container(for: libraryButton)
|
lazy var libraryButtonContainer = container(for: libraryButton)
|
||||||
lazy var cameraButton: InputViewButton = {
|
lazy var cameraButton: InputViewButton = {
|
||||||
let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_camera_black"), delegate: self, hasOpaqueBackground: true)
|
let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_camera_black"), delegate: self, hasOpaqueBackground: true)
|
||||||
result.accessibilityLabel = "accessibility_camera_button".localized()
|
result.accessibilityLabel = "Select camera button"
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}()
|
}()
|
||||||
|
|
|
@ -50,12 +50,16 @@ final class InputView: UIView, InputViewButtonDelegate, InputTextViewDelegate, M
|
||||||
// MARK: - UI
|
// MARK: - UI
|
||||||
|
|
||||||
private var bottomStackView: UIStackView?
|
private var bottomStackView: UIStackView?
|
||||||
private lazy var attachmentsButton = ExpandingAttachmentsButton(delegate: delegate)
|
private lazy var attachmentsButton: ExpandingAttachmentsButton = {
|
||||||
|
let result = ExpandingAttachmentsButton(delegate: delegate)
|
||||||
|
result.accessibilityLabel = "Attachments button"
|
||||||
|
|
||||||
|
return result
|
||||||
|
}()
|
||||||
|
|
||||||
private lazy var voiceMessageButton: InputViewButton = {
|
private lazy var voiceMessageButton: InputViewButton = {
|
||||||
let result = InputViewButton(icon: #imageLiteral(resourceName: "Microphone"), delegate: self)
|
let result = InputViewButton(icon: #imageLiteral(resourceName: "Microphone"), delegate: self)
|
||||||
result.accessibilityLabel = "VOICE_MESSAGE_TOO_SHORT_ALERT_TITLE".localized()
|
result.accessibilityLabel = "New voice message"
|
||||||
result.accessibilityHint = "VOICE_MESSAGE_TOO_SHORT_ALERT_MESSAGE".localized()
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}()
|
}()
|
||||||
|
@ -63,7 +67,7 @@ final class InputView: UIView, InputViewButtonDelegate, InputTextViewDelegate, M
|
||||||
private lazy var sendButton: InputViewButton = {
|
private lazy var sendButton: InputViewButton = {
|
||||||
let result = InputViewButton(icon: #imageLiteral(resourceName: "ArrowUp"), isSendButton: true, delegate: self)
|
let result = InputViewButton(icon: #imageLiteral(resourceName: "ArrowUp"), isSendButton: true, delegate: self)
|
||||||
result.isHidden = true
|
result.isHidden = true
|
||||||
result.accessibilityLabel = "ATTACHMENT_APPROVAL_SEND_BUTTON".localized()
|
result.accessibilityLabel = "Send message button"
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}()
|
}()
|
||||||
|
@ -78,6 +82,7 @@ final class InputView: UIView, InputViewButtonDelegate, InputTextViewDelegate, M
|
||||||
|
|
||||||
private lazy var mentionsViewContainer: UIView = {
|
private lazy var mentionsViewContainer: UIView = {
|
||||||
let result: UIView = UIView()
|
let result: UIView = UIView()
|
||||||
|
result.accessibilityLabel = "Mentions list"
|
||||||
result.alpha = 0
|
result.alpha = 0
|
||||||
|
|
||||||
let backgroundView = UIView()
|
let backgroundView = UIView()
|
||||||
|
@ -107,7 +112,10 @@ final class InputView: UIView, InputViewButtonDelegate, InputTextViewDelegate, M
|
||||||
// setUpViewHierarchy() for why these values are the way they are.
|
// setUpViewHierarchy() for why these values are the way they are.
|
||||||
let adjustment = (InputViewButton.expandedSize - InputViewButton.size) / 2
|
let adjustment = (InputViewButton.expandedSize - InputViewButton.size) / 2
|
||||||
let maxWidth = UIScreen.main.bounds.width - 2 * InputViewButton.expandedSize - 2 * Values.smallSpacing - 2 * (Values.mediumSpacing - adjustment)
|
let maxWidth = UIScreen.main.bounds.width - 2 * InputViewButton.expandedSize - 2 * Values.smallSpacing - 2 * (Values.mediumSpacing - adjustment)
|
||||||
return InputTextView(delegate: self, maxWidth: maxWidth)
|
let result = InputTextView(delegate: self, maxWidth: maxWidth)
|
||||||
|
result.accessibilityLabel = "Message input box"
|
||||||
|
|
||||||
|
return result
|
||||||
}()
|
}()
|
||||||
|
|
||||||
private lazy var disabledInputLabel: UILabel = {
|
private lazy var disabledInputLabel: UILabel = {
|
||||||
|
|
|
@ -24,6 +24,7 @@ final class MentionSelectionView: UIView, UITableViewDataSource, UITableViewDele
|
||||||
|
|
||||||
private lazy var tableView: UITableView = {
|
private lazy var tableView: UITableView = {
|
||||||
let result: UITableView = UITableView()
|
let result: UITableView = UITableView()
|
||||||
|
result.accessibilityLabel = "Contact"
|
||||||
result.dataSource = self
|
result.dataSource = self
|
||||||
result.delegate = self
|
result.delegate = self
|
||||||
result.separatorStyle = .none
|
result.separatorStyle = .none
|
||||||
|
|
|
@ -12,7 +12,7 @@ final class MediaPlaceholderView: UIView {
|
||||||
|
|
||||||
init(cellViewModel: MessageViewModel, textColor: ThemeValue) {
|
init(cellViewModel: MessageViewModel, textColor: ThemeValue) {
|
||||||
super.init(frame: CGRect.zero)
|
super.init(frame: CGRect.zero)
|
||||||
|
self.accessibilityLabel = "Untrusted attachment message"
|
||||||
setUpViewHierarchy(cellViewModel: cellViewModel, textColor: textColor)
|
setUpViewHierarchy(cellViewModel: cellViewModel, textColor: textColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,7 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate {
|
||||||
|
|
||||||
internal lazy var messageStatusImageView: UIImageView = {
|
internal lazy var messageStatusImageView: UIImageView = {
|
||||||
let result = UIImageView()
|
let result = UIImageView()
|
||||||
|
result.accessibilityLabel = "Message sent status tick"
|
||||||
result.contentMode = .scaleAspectFit
|
result.contentMode = .scaleAspectFit
|
||||||
result.layer.cornerRadius = VisibleMessageCell.messageStatusImageViewSize / 2
|
result.layer.cornerRadius = VisibleMessageCell.messageStatusImageViewSize / 2
|
||||||
result.layer.masksToBounds = true
|
result.layer.masksToBounds = true
|
||||||
|
|
|
@ -151,7 +151,8 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
NavItem(
|
NavItem(
|
||||||
id: .edit,
|
id: .edit,
|
||||||
systemItem: .edit,
|
systemItem: .edit,
|
||||||
accessibilityIdentifier: "Edit button"
|
accessibilityIdentifier: "Edit button",
|
||||||
|
accessibilityLabel: "Edit user nickname"
|
||||||
) { [weak self] in self?.setIsEditing(true) }
|
) { [weak self] in self?.setIsEditing(true) }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -240,6 +241,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
"vc_conversation_settings_copy_session_id_button_title".localized()
|
"vc_conversation_settings_copy_session_id_button_title".localized()
|
||||||
),
|
),
|
||||||
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).copy_thread_id",
|
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).copy_thread_id",
|
||||||
|
accessibilityLabel: "Copy Session ID",
|
||||||
onTap: {
|
onTap: {
|
||||||
UIPasteboard.general.string = threadId
|
UIPasteboard.general.string = threadId
|
||||||
self?.showToast(
|
self?.showToast(
|
||||||
|
@ -258,6 +260,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
),
|
),
|
||||||
title: MediaStrings.allMedia,
|
title: MediaStrings.allMedia,
|
||||||
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).all_media",
|
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).all_media",
|
||||||
|
accessibilityLabel: "All media",
|
||||||
onTap: { [weak self] in
|
onTap: { [weak self] in
|
||||||
self?.transitionToScreen(
|
self?.transitionToScreen(
|
||||||
MediaGalleryViewModel.createAllMediaViewController(
|
MediaGalleryViewModel.createAllMediaViewController(
|
||||||
|
@ -277,6 +280,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
),
|
),
|
||||||
title: "CONVERSATION_SETTINGS_SEARCH".localized(),
|
title: "CONVERSATION_SETTINGS_SEARCH".localized(),
|
||||||
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).search",
|
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).search",
|
||||||
|
accessibilityLabel: "Search",
|
||||||
onTap: { [weak self] in
|
onTap: { [weak self] in
|
||||||
self?.didTriggerSearch()
|
self?.didTriggerSearch()
|
||||||
}
|
}
|
||||||
|
@ -324,6 +328,8 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
"DISAPPEARING_MESSAGES_SUBTITLE_OFF".localized()
|
"DISAPPEARING_MESSAGES_SUBTITLE_OFF".localized()
|
||||||
),
|
),
|
||||||
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).disappearing_messages",
|
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).disappearing_messages",
|
||||||
|
accessibilityLabel: "Disappearing messages",
|
||||||
|
leftAccessoryAccessibilityLabel: "Timer icon",
|
||||||
onTap: { [weak self] in
|
onTap: { [weak self] in
|
||||||
self?.transitionToScreen(
|
self?.transitionToScreen(
|
||||||
SessionTableViewController(
|
SessionTableViewController(
|
||||||
|
@ -346,6 +352,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
),
|
),
|
||||||
title: "EDIT_GROUP_ACTION".localized(),
|
title: "EDIT_GROUP_ACTION".localized(),
|
||||||
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).edit_group",
|
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).edit_group",
|
||||||
|
accessibilityLabel: "Edit group",
|
||||||
onTap: { [weak self] in
|
onTap: { [weak self] in
|
||||||
self?.transitionToScreen(EditClosedGroupVC(threadId: threadId))
|
self?.transitionToScreen(EditClosedGroupVC(threadId: threadId))
|
||||||
}
|
}
|
||||||
|
@ -361,6 +368,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
),
|
),
|
||||||
title: "LEAVE_GROUP_ACTION".localized(),
|
title: "LEAVE_GROUP_ACTION".localized(),
|
||||||
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).leave_group",
|
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).leave_group",
|
||||||
|
accessibilityLabel: "Leave group",
|
||||||
confirmationInfo: ConfirmationModal.Info(
|
confirmationInfo: ConfirmationModal.Info(
|
||||||
title: "CONFIRM_LEAVE_GROUP_TITLE".localized(),
|
title: "CONFIRM_LEAVE_GROUP_TITLE".localized(),
|
||||||
explanation: (currentUserIsClosedGroupMember ?
|
explanation: (currentUserIsClosedGroupMember ?
|
||||||
|
@ -417,6 +425,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
currentUserIsClosedGroupMember
|
currentUserIsClosedGroupMember
|
||||||
),
|
),
|
||||||
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).notify_for_mentions_only",
|
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).notify_for_mentions_only",
|
||||||
|
accessibilityLabel: "Mentions only",
|
||||||
onTap: {
|
onTap: {
|
||||||
let newValue: Bool = !(threadViewModel.threadOnlyNotifyForMentions == true)
|
let newValue: Bool = !(threadViewModel.threadOnlyNotifyForMentions == true)
|
||||||
|
|
||||||
|
@ -449,6 +458,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
currentUserIsClosedGroupMember
|
currentUserIsClosedGroupMember
|
||||||
),
|
),
|
||||||
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).mute",
|
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).mute",
|
||||||
|
accessibilityLabel: "Mute notifications",
|
||||||
onTap: {
|
onTap: {
|
||||||
dependencies.storage.writeAsync { db in
|
dependencies.storage.writeAsync { db in
|
||||||
let currentValue: TimeInterval? = try SessionThread
|
let currentValue: TimeInterval? = try SessionThread
|
||||||
|
@ -485,6 +495,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
.boolValue(threadViewModel.threadIsBlocked == true)
|
.boolValue(threadViewModel.threadIsBlocked == true)
|
||||||
),
|
),
|
||||||
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).block",
|
accessibilityIdentifier: "\(ThreadSettingsViewModel.self).block",
|
||||||
|
accessibilityLabel: "Block",
|
||||||
confirmationInfo: ConfirmationModal.Info(
|
confirmationInfo: ConfirmationModal.Info(
|
||||||
title: {
|
title: {
|
||||||
guard threadViewModel.threadIsBlocked == true else {
|
guard threadViewModel.threadIsBlocked == true else {
|
||||||
|
@ -503,10 +514,12 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
nil :
|
nil :
|
||||||
"BLOCK_USER_BEHAVIOR_EXPLANATION".localized()
|
"BLOCK_USER_BEHAVIOR_EXPLANATION".localized()
|
||||||
),
|
),
|
||||||
|
accessibilityLabel: "Confirm block",
|
||||||
confirmTitle: (threadViewModel.threadIsBlocked == true ?
|
confirmTitle: (threadViewModel.threadIsBlocked == true ?
|
||||||
"BLOCK_LIST_UNBLOCK_BUTTON".localized() :
|
"BLOCK_LIST_UNBLOCK_BUTTON".localized() :
|
||||||
"BLOCK_LIST_BLOCK_BUTTON".localized()
|
"BLOCK_LIST_BLOCK_BUTTON".localized()
|
||||||
),
|
),
|
||||||
|
confirmAccessibilityLabel: "Confirm blocked user",
|
||||||
confirmStyle: .danger,
|
confirmStyle: .danger,
|
||||||
cancelStyle: .alert_text
|
cancelStyle: .alert_text
|
||||||
),
|
),
|
||||||
|
@ -638,6 +651,7 @@ class ThreadSettingsViewModel: SessionTableViewModel<ThreadSettingsViewModel.Nav
|
||||||
) :
|
) :
|
||||||
nil
|
nil
|
||||||
),
|
),
|
||||||
|
accessibilityLabel: oldBlockedState == false ? "User blocked" : "Confirm unblock",
|
||||||
cancelTitle: "BUTTON_OK".localized(),
|
cancelTitle: "BUTTON_OK".localized(),
|
||||||
cancelStyle: .alert_text
|
cancelStyle: .alert_text
|
||||||
)
|
)
|
||||||
|
|
|
@ -22,6 +22,7 @@ final class ConversationTitleView: UIView {
|
||||||
|
|
||||||
private lazy var titleLabel: UILabel = {
|
private lazy var titleLabel: UILabel = {
|
||||||
let result: UILabel = UILabel()
|
let result: UILabel = UILabel()
|
||||||
|
result.accessibilityLabel = "Username"
|
||||||
result.font = .boldSystemFont(ofSize: Values.mediumFontSize)
|
result.font = .boldSystemFont(ofSize: Values.mediumFontSize)
|
||||||
result.themeTextColor = .textPrimary
|
result.themeTextColor = .textPrimary
|
||||||
result.lineBreakMode = .byTruncatingTail
|
result.lineBreakMode = .byTruncatingTail
|
||||||
|
|
|
@ -4,10 +4,10 @@ import UIKit
|
||||||
import SessionUIKit
|
import SessionUIKit
|
||||||
|
|
||||||
final class InfoBanner: UIView {
|
final class InfoBanner: UIView {
|
||||||
init(message: String, backgroundColor: ThemeValue) {
|
init(message: String, backgroundColor: ThemeValue, messageLabelAccessibilityLabel: String? = nil) {
|
||||||
super.init(frame: CGRect.zero)
|
super.init(frame: CGRect.zero)
|
||||||
|
|
||||||
setUpViewHierarchy(message: message, backgroundColor: backgroundColor)
|
setUpViewHierarchy(message: message, backgroundColor: backgroundColor, messageLabelAccessibilityLabel: messageLabelAccessibilityLabel)
|
||||||
}
|
}
|
||||||
|
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
|
@ -18,10 +18,11 @@ final class InfoBanner: UIView {
|
||||||
preconditionFailure("Use init(coder:) instead.")
|
preconditionFailure("Use init(coder:) instead.")
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setUpViewHierarchy(message: String, backgroundColor: ThemeValue) {
|
private func setUpViewHierarchy(message: String, backgroundColor: ThemeValue, messageLabelAccessibilityLabel: String?) {
|
||||||
themeBackgroundColor = backgroundColor
|
themeBackgroundColor = backgroundColor
|
||||||
|
|
||||||
let label: UILabel = UILabel()
|
let label: UILabel = UILabel()
|
||||||
|
label.accessibilityLabel = messageLabelAccessibilityLabel
|
||||||
label.font = .boldSystemFont(ofSize: Values.smallFontSize)
|
label.font = .boldSystemFont(ofSize: Values.smallFontSize)
|
||||||
label.text = message
|
label.text = message
|
||||||
label.themeTextColor = .textPrimary
|
label.themeTextColor = .textPrimary
|
||||||
|
|
|
@ -42,6 +42,7 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
|
||||||
|
|
||||||
private lazy var seedReminderView: SeedReminderView = {
|
private lazy var seedReminderView: SeedReminderView = {
|
||||||
let result = SeedReminderView(hasContinueButton: true)
|
let result = SeedReminderView(hasContinueButton: true)
|
||||||
|
result.accessibilityLabel = "Recovery phrase reminder"
|
||||||
let title = "You're almost finished! 80%"
|
let title = "You're almost finished! 80%"
|
||||||
result.subtitle = "view_seed_reminder_subtitle_1".localized()
|
result.subtitle = "view_seed_reminder_subtitle_1".localized()
|
||||||
result.setProgress(0.8, animated: false)
|
result.setProgress(0.8, animated: false)
|
||||||
|
@ -107,6 +108,7 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
|
||||||
result.set(.height, to: HomeVC.newConversationButtonSize)
|
result.set(.height, to: HomeVC.newConversationButtonSize)
|
||||||
|
|
||||||
let button = UIButton()
|
let button = UIButton()
|
||||||
|
button.accessibilityLabel = "New conversation button"
|
||||||
button.clipsToBounds = true
|
button.clipsToBounds = true
|
||||||
button.setImage(
|
button.setImage(
|
||||||
UIImage(named: "Plus")?
|
UIImage(named: "Plus")?
|
||||||
|
@ -463,7 +465,7 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
|
||||||
// Profile picture view
|
// Profile picture view
|
||||||
let profilePictureSize = Values.verySmallProfilePictureSize
|
let profilePictureSize = Values.verySmallProfilePictureSize
|
||||||
let profilePictureView = ProfilePictureView()
|
let profilePictureView = ProfilePictureView()
|
||||||
profilePictureView.accessibilityLabel = "Settings button"
|
profilePictureView.accessibilityLabel = "User settings"
|
||||||
profilePictureView.size = profilePictureSize
|
profilePictureView.size = profilePictureSize
|
||||||
profilePictureView.update(
|
profilePictureView.update(
|
||||||
publicKey: getUserHexEncodedPublicKey(),
|
publicKey: getUserHexEncodedPublicKey(),
|
||||||
|
@ -482,7 +484,6 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
|
||||||
|
|
||||||
// Container view
|
// Container view
|
||||||
let profilePictureViewContainer = UIView()
|
let profilePictureViewContainer = UIView()
|
||||||
profilePictureViewContainer.accessibilityLabel = "Settings button"
|
|
||||||
profilePictureViewContainer.addSubview(profilePictureView)
|
profilePictureViewContainer.addSubview(profilePictureView)
|
||||||
profilePictureView.autoPinEdgesToSuperviewEdges()
|
profilePictureView.autoPinEdgesToSuperviewEdges()
|
||||||
profilePictureViewContainer.addSubview(pathStatusView)
|
profilePictureViewContainer.addSubview(pathStatusView)
|
||||||
|
@ -491,7 +492,6 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
|
||||||
|
|
||||||
// Left bar button item
|
// Left bar button item
|
||||||
let leftBarButtonItem = UIBarButtonItem(customView: profilePictureViewContainer)
|
let leftBarButtonItem = UIBarButtonItem(customView: profilePictureViewContainer)
|
||||||
leftBarButtonItem.accessibilityLabel = "Settings button"
|
|
||||||
leftBarButtonItem.isAccessibilityElement = true
|
leftBarButtonItem.isAccessibilityElement = true
|
||||||
navigationItem.leftBarButtonItem = leftBarButtonItem
|
navigationItem.leftBarButtonItem = leftBarButtonItem
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,19 @@ final class NewConversationVC: BaseVC, ThemedNavigation, UITableViewDelegate, UI
|
||||||
|
|
||||||
var navigationBackground: ThemeValue { .newConversation_background }
|
var navigationBackground: ThemeValue { .newConversation_background }
|
||||||
|
|
||||||
private lazy var newDMButton: NewConversationButton = NewConversationButton(icon: #imageLiteral(resourceName: "Message"), title: "vc_create_private_chat_title".localized())
|
private lazy var newDMButton: NewConversationButton = {
|
||||||
private lazy var newGroupButton: NewConversationButton = NewConversationButton(icon: #imageLiteral(resourceName: "Group"), title: "vc_create_closed_group_title".localized())
|
let result = NewConversationButton(icon: #imageLiteral(resourceName: "Message"), title: "vc_create_private_chat_title".localized())
|
||||||
|
result.accessibilityLabel = "New direct message"
|
||||||
|
|
||||||
|
return result
|
||||||
|
}()
|
||||||
|
|
||||||
|
private lazy var newGroupButton: NewConversationButton = {
|
||||||
|
let result = NewConversationButton(icon: #imageLiteral(resourceName: "Group"), title: "vc_create_closed_group_title".localized())
|
||||||
|
result.accessibilityLabel = "Create group"
|
||||||
|
|
||||||
|
return result
|
||||||
|
}()
|
||||||
private lazy var joinCommunityButton: NewConversationButton = NewConversationButton(icon: #imageLiteral(resourceName: "Globe"), title: "vc_join_public_chat_title".localized(), shouldShowSeparator: false)
|
private lazy var joinCommunityButton: NewConversationButton = NewConversationButton(icon: #imageLiteral(resourceName: "Globe"), title: "vc_join_public_chat_title".localized(), shouldShowSeparator: false)
|
||||||
|
|
||||||
private lazy var buttonStackView: UIStackView = {
|
private lazy var buttonStackView: UIStackView = {
|
||||||
|
|
|
@ -240,6 +240,7 @@ private final class EnterPublicKeyVC: UIViewController {
|
||||||
let result = TextView(placeholder: "vc_enter_public_key_text_field_hint".localized()) { [weak self] text in
|
let result = TextView(placeholder: "vc_enter_public_key_text_field_hint".localized()) { [weak self] text in
|
||||||
self?.nextButton.isEnabled = !text.isEmpty
|
self?.nextButton.isEnabled = !text.isEmpty
|
||||||
}
|
}
|
||||||
|
result.accessibilityLabel = "Session id input box"
|
||||||
result.autocapitalizationType = .none
|
result.autocapitalizationType = .none
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
@ -387,6 +388,7 @@ private final class EnterPublicKeyVC: UIViewController {
|
||||||
|
|
||||||
private lazy var nextButton: SessionButton = {
|
private lazy var nextButton: SessionButton = {
|
||||||
let result = SessionButton(style: .bordered, size: .large)
|
let result = SessionButton(style: .bordered, size: .large)
|
||||||
|
result.accessibilityLabel = "Next"
|
||||||
result.setTitle("next".localized(), for: .normal)
|
result.setTitle("next".localized(), for: .normal)
|
||||||
result.isEnabled = false
|
result.isEnabled = false
|
||||||
result.addTarget(self, action: #selector(startNewDMIfPossible), for: .touchUpInside)
|
result.addTarget(self, action: #selector(startNewDMIfPossible), for: .touchUpInside)
|
||||||
|
|
|
@ -455,6 +455,7 @@ import SignalUtilitiesKit
|
||||||
result.addArrangedSubview(cancelButton)
|
result.addArrangedSubview(cancelButton)
|
||||||
|
|
||||||
let doneButton = createButton(title: CommonStrings.doneButton, action: #selector(donePressed))
|
let doneButton = createButton(title: CommonStrings.doneButton, action: #selector(donePressed))
|
||||||
|
doneButton.accessibilityLabel = "Done"
|
||||||
result.addArrangedSubview(doneButton)
|
result.addArrangedSubview(doneButton)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -211,6 +211,7 @@ class SendMediaNavigationController: UINavigationController {
|
||||||
private lazy var mediaLibraryViewController: ImagePickerGridController = {
|
private lazy var mediaLibraryViewController: ImagePickerGridController = {
|
||||||
let vc = ImagePickerGridController()
|
let vc = ImagePickerGridController()
|
||||||
vc.delegate = self
|
vc.delegate = self
|
||||||
|
vc.collectionView.accessibilityLabel = "Images"
|
||||||
|
|
||||||
return vc
|
return vc
|
||||||
}()
|
}()
|
||||||
|
|
|
@ -15,8 +15,8 @@ final class DisplayNameVC: BaseVC {
|
||||||
|
|
||||||
private lazy var displayNameTextField: TextField = {
|
private lazy var displayNameTextField: TextField = {
|
||||||
let result = TextField(placeholder: "vc_display_name_text_field_hint".localized())
|
let result = TextField(placeholder: "vc_display_name_text_field_hint".localized())
|
||||||
|
result.accessibilityLabel = "Enter display name"
|
||||||
result.themeBorderColor = .textPrimary
|
result.themeBorderColor = .textPrimary
|
||||||
result.accessibilityLabel = "Display name text field"
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}()
|
}()
|
||||||
|
@ -56,6 +56,7 @@ final class DisplayNameVC: BaseVC {
|
||||||
|
|
||||||
// Set up register button
|
// Set up register button
|
||||||
let registerButton = SessionButton(style: .filled, size: .large)
|
let registerButton = SessionButton(style: .filled, size: .large)
|
||||||
|
registerButton.accessibilityLabel = "Continue"
|
||||||
registerButton.setTitle("continue_2".localized(), for: UIControl.State.normal)
|
registerButton.setTitle("continue_2".localized(), for: UIControl.State.normal)
|
||||||
registerButton.addTarget(self, action: #selector(register), for: UIControl.Event.touchUpInside)
|
registerButton.addTarget(self, action: #selector(register), for: UIControl.Event.touchUpInside)
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ final class LandingVC: BaseVC {
|
||||||
|
|
||||||
private lazy var registerButton: SessionButton = {
|
private lazy var registerButton: SessionButton = {
|
||||||
let result = SessionButton(style: .filled, size: .large)
|
let result = SessionButton(style: .filled, size: .large)
|
||||||
|
result.accessibilityLabel = "Create session ID"
|
||||||
result.setTitle("vc_landing_register_button_title".localized(), for: .normal)
|
result.setTitle("vc_landing_register_button_title".localized(), for: .normal)
|
||||||
result.addTarget(self, action: #selector(register), for: .touchUpInside)
|
result.addTarget(self, action: #selector(register), for: .touchUpInside)
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@ final class LandingVC: BaseVC {
|
||||||
|
|
||||||
// Link button
|
// Link button
|
||||||
let linkButton = UIButton()
|
let linkButton = UIButton()
|
||||||
|
linkButton.accessibilityLabel = "Link a device"
|
||||||
linkButton.titleLabel?.font = .boldSystemFont(ofSize: Values.smallFontSize)
|
linkButton.titleLabel?.font = .boldSystemFont(ofSize: Values.smallFontSize)
|
||||||
linkButton.setTitle("vc_landing_link_button_title".localized(), for: .normal)
|
linkButton.setTitle("vc_landing_link_button_title".localized(), for: .normal)
|
||||||
linkButton.setThemeTitleColor(.textPrimary, for: .normal)
|
linkButton.setThemeTitleColor(.textPrimary, for: .normal)
|
||||||
|
|
|
@ -186,7 +186,7 @@ private final class RecoveryPhraseVC: UIViewController {
|
||||||
private lazy var mnemonicTextView: TextView = {
|
private lazy var mnemonicTextView: TextView = {
|
||||||
let result = TextView(placeholder: "vc_restore_seed_text_field_hint".localized())
|
let result = TextView(placeholder: "vc_restore_seed_text_field_hint".localized())
|
||||||
result.themeBorderColor = .textPrimary
|
result.themeBorderColor = .textPrimary
|
||||||
result.accessibilityLabel = "Recovery phrase text view"
|
result.accessibilityLabel = "Enter your recovery phrase"
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}()
|
}()
|
||||||
|
@ -224,6 +224,7 @@ private final class RecoveryPhraseVC: UIViewController {
|
||||||
|
|
||||||
// Continue button
|
// Continue button
|
||||||
let continueButton = SessionButton(style: .filled, size: .large)
|
let continueButton = SessionButton(style: .filled, size: .large)
|
||||||
|
continueButton.accessibilityLabel = "Link device"
|
||||||
continueButton.setTitle("continue_2".localized(), for: UIControl.State.normal)
|
continueButton.setTitle("continue_2".localized(), for: UIControl.State.normal)
|
||||||
continueButton.addTarget(self, action: #selector(handleContinueButtonTapped), for: UIControl.Event.touchUpInside)
|
continueButton.addTarget(self, action: #selector(handleContinueButtonTapped), for: UIControl.Event.touchUpInside)
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,7 @@ final class PNModeVC: BaseVC, OptionViewDelegate {
|
||||||
|
|
||||||
// Set up register button
|
// Set up register button
|
||||||
let registerButton = SessionButton(style: .filled, size: .large)
|
let registerButton = SessionButton(style: .filled, size: .large)
|
||||||
|
registerButton.accessibilityLabel = "Continue with settings"
|
||||||
registerButton.setTitle("continue_2".localized(), for: .normal)
|
registerButton.setTitle("continue_2".localized(), for: .normal)
|
||||||
registerButton.addTarget(self, action: #selector(register), for: UIControl.Event.touchUpInside)
|
registerButton.addTarget(self, action: #selector(register), for: UIControl.Event.touchUpInside)
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ final class RegisterVC : BaseVC {
|
||||||
let result = UILabel()
|
let result = UILabel()
|
||||||
result.font = Fonts.spaceMono(ofSize: isIPhone5OrSmaller ? Values.mediumFontSize : 20)
|
result.font = Fonts.spaceMono(ofSize: isIPhone5OrSmaller ? Values.mediumFontSize : 20)
|
||||||
result.themeTextColor = .textPrimary
|
result.themeTextColor = .textPrimary
|
||||||
result.accessibilityLabel = "Session ID label"
|
result.accessibilityLabel = "Session ID"
|
||||||
result.lineBreakMode = .byCharWrapping
|
result.lineBreakMode = .byCharWrapping
|
||||||
result.numberOfLines = 0
|
result.numberOfLines = 0
|
||||||
|
|
||||||
|
@ -86,6 +86,7 @@ final class RegisterVC : BaseVC {
|
||||||
|
|
||||||
// Set up register button
|
// Set up register button
|
||||||
let registerButton = SessionButton(style: .filled, size: .large)
|
let registerButton = SessionButton(style: .filled, size: .large)
|
||||||
|
registerButton.accessibilityLabel = "Continue"
|
||||||
registerButton.setTitle("continue_2".localized(), for: .normal)
|
registerButton.setTitle("continue_2".localized(), for: .normal)
|
||||||
registerButton.addTarget(self, action: #selector(register), for: UIControl.Event.touchUpInside)
|
registerButton.addTarget(self, action: #selector(register), for: UIControl.Event.touchUpInside)
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ final class SeedReminderView: UIView {
|
||||||
|
|
||||||
// Set up button
|
// Set up button
|
||||||
let button = SessionButton(style: .bordered, size: .small)
|
let button = SessionButton(style: .bordered, size: .small)
|
||||||
|
button.accessibilityLabel = "Continue"
|
||||||
button.setTitle("continue_2".localized(), for: UIControl.State.normal)
|
button.setTitle("continue_2".localized(), for: UIControl.State.normal)
|
||||||
button.set(.width, to: 96)
|
button.set(.width, to: 96)
|
||||||
button.addTarget(self, action: #selector(handleContinueButtonTapped), for: UIControl.Event.touchUpInside)
|
button.addTarget(self, action: #selector(handleContinueButtonTapped), for: UIControl.Event.touchUpInside)
|
||||||
|
|
|
@ -46,6 +46,7 @@ final class SeedVC: BaseVC {
|
||||||
|
|
||||||
private lazy var mnemonicLabel: UILabel = {
|
private lazy var mnemonicLabel: UILabel = {
|
||||||
let result = UILabel()
|
let result = UILabel()
|
||||||
|
result.accessibilityLabel = "Recovery Phrase"
|
||||||
result.font = Fonts.spaceMono(ofSize: Values.mediumFontSize)
|
result.font = Fonts.spaceMono(ofSize: Values.mediumFontSize)
|
||||||
result.themeTextColor = .primary
|
result.themeTextColor = .primary
|
||||||
result.textAlignment = .center
|
result.textAlignment = .center
|
||||||
|
@ -72,6 +73,7 @@ final class SeedVC: BaseVC {
|
||||||
|
|
||||||
// Set up navigation bar buttons
|
// Set up navigation bar buttons
|
||||||
let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close))
|
let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close))
|
||||||
|
closeButton.accessibilityLabel = "Navigate up"
|
||||||
closeButton.themeTintColor = .textPrimary
|
closeButton.themeTintColor = .textPrimary
|
||||||
navigationItem.leftBarButtonItem = closeButton
|
navigationItem.leftBarButtonItem = closeButton
|
||||||
|
|
||||||
|
|
|
@ -189,11 +189,13 @@ class PrivacySettingsViewModel: SessionTableViewModel<PrivacySettingsViewModel.N
|
||||||
title: "PRIVACY_CALLS_TITLE".localized(),
|
title: "PRIVACY_CALLS_TITLE".localized(),
|
||||||
subtitle: "PRIVACY_CALLS_DESCRIPTION".localized(),
|
subtitle: "PRIVACY_CALLS_DESCRIPTION".localized(),
|
||||||
rightAccessory: .toggle(.settingBool(key: .areCallsEnabled)),
|
rightAccessory: .toggle(.settingBool(key: .areCallsEnabled)),
|
||||||
|
accessibilityLabel: "Allow voice and video calls",
|
||||||
confirmationInfo: ConfirmationModal.Info(
|
confirmationInfo: ConfirmationModal.Info(
|
||||||
title: "PRIVACY_CALLS_WARNING_TITLE".localized(),
|
title: "PRIVACY_CALLS_WARNING_TITLE".localized(),
|
||||||
explanation: "PRIVACY_CALLS_WARNING_DESCRIPTION".localized(),
|
explanation: "PRIVACY_CALLS_WARNING_DESCRIPTION".localized(),
|
||||||
stateToShow: .whenDisabled,
|
stateToShow: .whenDisabled,
|
||||||
confirmTitle: "continue_2".localized(),
|
confirmTitle: "continue_2".localized(),
|
||||||
|
confirmAccessibilityLabel: "Enable",
|
||||||
confirmStyle: .textPrimary,
|
confirmStyle: .textPrimary,
|
||||||
onConfirm: { _ in Permissions.requestMicrophonePermissionIfNeeded() }
|
onConfirm: { _ in Permissions.requestMicrophonePermissionIfNeeded() }
|
||||||
),
|
),
|
||||||
|
|
|
@ -393,13 +393,15 @@ class SettingsViewModel: SessionTableViewModel<SettingsViewModel.NavButton, Sett
|
||||||
message: nil,
|
message: nil,
|
||||||
preferredStyle: .actionSheet
|
preferredStyle: .actionSheet
|
||||||
)
|
)
|
||||||
actionSheet.addAction(UIAlertAction(
|
let action = UIAlertAction(
|
||||||
title: "MEDIA_FROM_LIBRARY_BUTTON".localized(),
|
title: "MEDIA_FROM_LIBRARY_BUTTON".localized(),
|
||||||
style: .default,
|
style: .default,
|
||||||
handler: { [weak self] _ in
|
handler: { [weak self] _ in
|
||||||
self?.showPhotoLibraryForAvatar()
|
self?.showPhotoLibraryForAvatar()
|
||||||
}
|
}
|
||||||
))
|
)
|
||||||
|
action.accessibilityLabel = "Photo library"
|
||||||
|
actionSheet.addAction(action)
|
||||||
actionSheet.addAction(UIAlertAction(title: "cancel".localized(), style: .cancel, handler: nil))
|
actionSheet.addAction(UIAlertAction(title: "cancel".localized(), style: .cancel, handler: nil))
|
||||||
|
|
||||||
self.transitionToScreen(actionSheet, transitionType: .present)
|
self.transitionToScreen(actionSheet, transitionType: .present)
|
||||||
|
|
|
@ -17,6 +17,9 @@ extension SessionCell {
|
||||||
let isEnabled: Bool
|
let isEnabled: Bool
|
||||||
let shouldHaveBackground: Bool
|
let shouldHaveBackground: Bool
|
||||||
let accessibilityIdentifier: String?
|
let accessibilityIdentifier: String?
|
||||||
|
let accessibilityLabel: String?
|
||||||
|
let leftAccessoryAccessibilityLabel: String?
|
||||||
|
let rightAccessoryAccessibilityLabel: String?
|
||||||
let confirmationInfo: ConfirmationModal.Info?
|
let confirmationInfo: ConfirmationModal.Info?
|
||||||
let onTap: ((UIView?) -> Void)?
|
let onTap: ((UIView?) -> Void)?
|
||||||
|
|
||||||
|
@ -41,6 +44,9 @@ extension SessionCell {
|
||||||
isEnabled: Bool = true,
|
isEnabled: Bool = true,
|
||||||
shouldHaveBackground: Bool = true,
|
shouldHaveBackground: Bool = true,
|
||||||
accessibilityIdentifier: String? = nil,
|
accessibilityIdentifier: String? = nil,
|
||||||
|
accessibilityLabel: String? = nil,
|
||||||
|
leftAccessoryAccessibilityLabel: String? = nil,
|
||||||
|
rightAccessoryAccessibilityLabel: String? = nil,
|
||||||
confirmationInfo: ConfirmationModal.Info? = nil,
|
confirmationInfo: ConfirmationModal.Info? = nil,
|
||||||
onTap: ((UIView?) -> Void)?
|
onTap: ((UIView?) -> Void)?
|
||||||
) {
|
) {
|
||||||
|
@ -55,6 +61,9 @@ extension SessionCell {
|
||||||
self.isEnabled = isEnabled
|
self.isEnabled = isEnabled
|
||||||
self.shouldHaveBackground = shouldHaveBackground
|
self.shouldHaveBackground = shouldHaveBackground
|
||||||
self.accessibilityIdentifier = accessibilityIdentifier
|
self.accessibilityIdentifier = accessibilityIdentifier
|
||||||
|
self.accessibilityLabel = accessibilityLabel
|
||||||
|
self.leftAccessoryAccessibilityLabel = leftAccessoryAccessibilityLabel
|
||||||
|
self.rightAccessoryAccessibilityLabel = rightAccessoryAccessibilityLabel
|
||||||
self.confirmationInfo = confirmationInfo
|
self.confirmationInfo = confirmationInfo
|
||||||
self.onTap = onTap
|
self.onTap = onTap
|
||||||
}
|
}
|
||||||
|
@ -71,6 +80,9 @@ extension SessionCell {
|
||||||
isEnabled: Bool = true,
|
isEnabled: Bool = true,
|
||||||
shouldHaveBackground: Bool = true,
|
shouldHaveBackground: Bool = true,
|
||||||
accessibilityIdentifier: String? = nil,
|
accessibilityIdentifier: String? = nil,
|
||||||
|
accessibilityLabel: String? = nil,
|
||||||
|
leftAccessoryAccessibilityLabel: String? = nil,
|
||||||
|
rightAccessoryAccessibilityLabel: String? = nil,
|
||||||
confirmationInfo: ConfirmationModal.Info? = nil,
|
confirmationInfo: ConfirmationModal.Info? = nil,
|
||||||
onTap: (() -> Void)? = nil
|
onTap: (() -> Void)? = nil
|
||||||
) {
|
) {
|
||||||
|
@ -85,6 +97,9 @@ extension SessionCell {
|
||||||
self.isEnabled = isEnabled
|
self.isEnabled = isEnabled
|
||||||
self.shouldHaveBackground = shouldHaveBackground
|
self.shouldHaveBackground = shouldHaveBackground
|
||||||
self.accessibilityIdentifier = accessibilityIdentifier
|
self.accessibilityIdentifier = accessibilityIdentifier
|
||||||
|
self.accessibilityLabel = accessibilityLabel
|
||||||
|
self.leftAccessoryAccessibilityLabel = leftAccessoryAccessibilityLabel
|
||||||
|
self.rightAccessoryAccessibilityLabel = rightAccessoryAccessibilityLabel
|
||||||
self.confirmationInfo = confirmationInfo
|
self.confirmationInfo = confirmationInfo
|
||||||
self.onTap = (onTap != nil ? { _ in onTap?() } : nil)
|
self.onTap = (onTap != nil ? { _ in onTap?() } : nil)
|
||||||
}
|
}
|
||||||
|
@ -104,6 +119,9 @@ extension SessionCell {
|
||||||
isEnabled.hash(into: &hasher)
|
isEnabled.hash(into: &hasher)
|
||||||
shouldHaveBackground.hash(into: &hasher)
|
shouldHaveBackground.hash(into: &hasher)
|
||||||
accessibilityIdentifier.hash(into: &hasher)
|
accessibilityIdentifier.hash(into: &hasher)
|
||||||
|
accessibilityLabel.hash(into: &hasher)
|
||||||
|
leftAccessoryAccessibilityLabel.hash(into: &hasher)
|
||||||
|
rightAccessoryAccessibilityLabel.hash(into: &hasher)
|
||||||
confirmationInfo.hash(into: &hasher)
|
confirmationInfo.hash(into: &hasher)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +136,10 @@ extension SessionCell {
|
||||||
lhs.extraAction == rhs.extraAction &&
|
lhs.extraAction == rhs.extraAction &&
|
||||||
lhs.isEnabled == rhs.isEnabled &&
|
lhs.isEnabled == rhs.isEnabled &&
|
||||||
lhs.shouldHaveBackground == rhs.shouldHaveBackground &&
|
lhs.shouldHaveBackground == rhs.shouldHaveBackground &&
|
||||||
lhs.accessibilityIdentifier == rhs.accessibilityIdentifier
|
lhs.accessibilityIdentifier == rhs.accessibilityIdentifier &&
|
||||||
|
lhs.accessibilityLabel == rhs.accessibilityLabel &&
|
||||||
|
lhs.leftAccessoryAccessibilityLabel == rhs.leftAccessoryAccessibilityLabel &&
|
||||||
|
lhs.rightAccessoryAccessibilityLabel == rhs.rightAccessoryAccessibilityLabel
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ extension SessionTableViewModel {
|
||||||
let style: UIBarButtonItem.Style
|
let style: UIBarButtonItem.Style
|
||||||
let systemItem: UIBarButtonItem.SystemItem?
|
let systemItem: UIBarButtonItem.SystemItem?
|
||||||
let accessibilityIdentifier: String
|
let accessibilityIdentifier: String
|
||||||
|
let accessibilityLabel: String?
|
||||||
let action: (() -> Void)?
|
let action: (() -> Void)?
|
||||||
|
|
||||||
// MARK: - Initialization
|
// MARK: - Initialization
|
||||||
|
@ -20,6 +21,7 @@ extension SessionTableViewModel {
|
||||||
id: NavItemId,
|
id: NavItemId,
|
||||||
systemItem: UIBarButtonItem.SystemItem?,
|
systemItem: UIBarButtonItem.SystemItem?,
|
||||||
accessibilityIdentifier: String,
|
accessibilityIdentifier: String,
|
||||||
|
accessibilityLabel: String? = nil,
|
||||||
action: (() -> Void)? = nil
|
action: (() -> Void)? = nil
|
||||||
) {
|
) {
|
||||||
self.id = id
|
self.id = id
|
||||||
|
@ -27,6 +29,7 @@ extension SessionTableViewModel {
|
||||||
self.style = .plain
|
self.style = .plain
|
||||||
self.systemItem = systemItem
|
self.systemItem = systemItem
|
||||||
self.accessibilityIdentifier = accessibilityIdentifier
|
self.accessibilityIdentifier = accessibilityIdentifier
|
||||||
|
self.accessibilityLabel = accessibilityLabel
|
||||||
self.action = action
|
self.action = action
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +38,7 @@ extension SessionTableViewModel {
|
||||||
image: UIImage?,
|
image: UIImage?,
|
||||||
style: UIBarButtonItem.Style,
|
style: UIBarButtonItem.Style,
|
||||||
accessibilityIdentifier: String,
|
accessibilityIdentifier: String,
|
||||||
|
accessibilityLabel: String? = nil,
|
||||||
action: (() -> Void)? = nil
|
action: (() -> Void)? = nil
|
||||||
) {
|
) {
|
||||||
self.id = id
|
self.id = id
|
||||||
|
@ -42,6 +46,7 @@ extension SessionTableViewModel {
|
||||||
self.style = style
|
self.style = style
|
||||||
self.systemItem = nil
|
self.systemItem = nil
|
||||||
self.accessibilityIdentifier = accessibilityIdentifier
|
self.accessibilityIdentifier = accessibilityIdentifier
|
||||||
|
self.accessibilityLabel = accessibilityLabel
|
||||||
self.action = action
|
self.action = action
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +59,8 @@ extension SessionTableViewModel {
|
||||||
style: style,
|
style: style,
|
||||||
target: nil,
|
target: nil,
|
||||||
action: nil,
|
action: nil,
|
||||||
accessibilityIdentifier: accessibilityIdentifier
|
accessibilityIdentifier: accessibilityIdentifier,
|
||||||
|
accessibilityLabel: accessibilityLabel
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +68,8 @@ extension SessionTableViewModel {
|
||||||
barButtonSystemItem: systemItem,
|
barButtonSystemItem: systemItem,
|
||||||
target: nil,
|
target: nil,
|
||||||
action: nil,
|
action: nil,
|
||||||
accessibilityIdentifier: accessibilityIdentifier
|
accessibilityIdentifier: accessibilityIdentifier,
|
||||||
|
accessibilityLabel: accessibilityLabel
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,10 @@ final class UserSelectionVC: BaseVC, UITableViewDataSource, UITableViewDelegate
|
||||||
|
|
||||||
setNavBarTitle(navBarTitle)
|
setNavBarTitle(navBarTitle)
|
||||||
|
|
||||||
navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(handleDoneButtonTapped))
|
let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(handleDoneButtonTapped))
|
||||||
|
doneButton.accessibilityLabel = "Done"
|
||||||
|
navigationItem.rightBarButtonItem = doneButton
|
||||||
|
|
||||||
view.addSubview(tableView)
|
view.addSubview(tableView)
|
||||||
tableView.pin(to: view)
|
tableView.pin(to: view)
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ class SessionAvatarCell: UITableViewCell {
|
||||||
|
|
||||||
fileprivate let profilePictureView: ProfilePictureView = {
|
fileprivate let profilePictureView: ProfilePictureView = {
|
||||||
let view: ProfilePictureView = ProfilePictureView()
|
let view: ProfilePictureView = ProfilePictureView()
|
||||||
|
view.accessibilityLabel = "Profile picture"
|
||||||
view.translatesAutoresizingMaskIntoConstraints = false
|
view.translatesAutoresizingMaskIntoConstraints = false
|
||||||
view.size = Values.largeProfilePictureSize
|
view.size = Values.largeProfilePictureSize
|
||||||
|
|
||||||
|
@ -69,6 +70,7 @@ class SessionAvatarCell: UITableViewCell {
|
||||||
|
|
||||||
private lazy var displayNameLabel: UILabel = {
|
private lazy var displayNameLabel: UILabel = {
|
||||||
let label: UILabel = UILabel()
|
let label: UILabel = UILabel()
|
||||||
|
label.accessibilityLabel = "Username"
|
||||||
label.translatesAutoresizingMaskIntoConstraints = false
|
label.translatesAutoresizingMaskIntoConstraints = false
|
||||||
label.font = .ows_mediumFont(withSize: Values.veryLargeFontSize)
|
label.font = .ows_mediumFont(withSize: Values.veryLargeFontSize)
|
||||||
label.themeTextColor = .textPrimary
|
label.themeTextColor = .textPrimary
|
||||||
|
@ -98,6 +100,7 @@ class SessionAvatarCell: UITableViewCell {
|
||||||
|
|
||||||
private let descriptionLabel: SRCopyableLabel = {
|
private let descriptionLabel: SRCopyableLabel = {
|
||||||
let label: SRCopyableLabel = SRCopyableLabel()
|
let label: SRCopyableLabel = SRCopyableLabel()
|
||||||
|
label.accessibilityLabel = "Session ID"
|
||||||
label.translatesAutoresizingMaskIntoConstraints = false
|
label.translatesAutoresizingMaskIntoConstraints = false
|
||||||
label.themeTextColor = .textPrimary
|
label.themeTextColor = .textPrimary
|
||||||
label.textAlignment = .center
|
label.textAlignment = .center
|
||||||
|
|
|
@ -225,7 +225,8 @@ extension SessionCell {
|
||||||
public func update(
|
public func update(
|
||||||
with accessory: Accessory?,
|
with accessory: Accessory?,
|
||||||
tintColor: ThemeValue,
|
tintColor: ThemeValue,
|
||||||
isEnabled: Bool
|
isEnabled: Bool,
|
||||||
|
accessibilityLabel: String?
|
||||||
) {
|
) {
|
||||||
guard let accessory: Accessory = accessory else { return }
|
guard let accessory: Accessory = accessory else { return }
|
||||||
|
|
||||||
|
@ -234,6 +235,7 @@ extension SessionCell {
|
||||||
|
|
||||||
switch accessory {
|
switch accessory {
|
||||||
case .icon(let image, let iconSize, let customTint, let shouldFill):
|
case .icon(let image, let iconSize, let customTint, let shouldFill):
|
||||||
|
imageView.accessibilityLabel = accessibilityLabel
|
||||||
imageView.image = image
|
imageView.image = image
|
||||||
imageView.themeTintColor = (customTint ?? tintColor)
|
imageView.themeTintColor = (customTint ?? tintColor)
|
||||||
imageView.contentMode = (shouldFill ? .scaleAspectFill : .scaleAspectFit)
|
imageView.contentMode = (shouldFill ? .scaleAspectFill : .scaleAspectFit)
|
||||||
|
@ -256,6 +258,7 @@ extension SessionCell {
|
||||||
|
|
||||||
case .iconAsync(let iconSize, let customTint, let shouldFill, let setter):
|
case .iconAsync(let iconSize, let customTint, let shouldFill, let setter):
|
||||||
setter(imageView)
|
setter(imageView)
|
||||||
|
imageView.accessibilityLabel = accessibilityLabel
|
||||||
imageView.themeTintColor = (customTint ?? tintColor)
|
imageView.themeTintColor = (customTint ?? tintColor)
|
||||||
imageView.contentMode = (shouldFill ? .scaleAspectFill : .scaleAspectFit)
|
imageView.contentMode = (shouldFill ? .scaleAspectFill : .scaleAspectFit)
|
||||||
imageView.isHidden = false
|
imageView.isHidden = false
|
||||||
|
@ -276,6 +279,7 @@ extension SessionCell {
|
||||||
imageViewConstraints.forEach { $0.isActive = true }
|
imageViewConstraints.forEach { $0.isActive = true }
|
||||||
|
|
||||||
case .toggle(let dataSource):
|
case .toggle(let dataSource):
|
||||||
|
toggleSwitch.accessibilityLabel = accessibilityLabel
|
||||||
toggleSwitch.isHidden = false
|
toggleSwitch.isHidden = false
|
||||||
toggleSwitch.isEnabled = isEnabled
|
toggleSwitch.isEnabled = isEnabled
|
||||||
toggleSwitchConstraints.forEach { $0.isActive = true }
|
toggleSwitchConstraints.forEach { $0.isActive = true }
|
||||||
|
@ -287,6 +291,7 @@ extension SessionCell {
|
||||||
}
|
}
|
||||||
|
|
||||||
case .dropDown(let dataSource):
|
case .dropDown(let dataSource):
|
||||||
|
dropDownLabel.accessibilityLabel = accessibilityLabel
|
||||||
dropDownLabel.text = dataSource.currentStringValue
|
dropDownLabel.text = dataSource.currentStringValue
|
||||||
dropDownStackView.isHidden = false
|
dropDownStackView.isHidden = false
|
||||||
dropDownStackViewConstraints.forEach { $0.isActive = true }
|
dropDownStackViewConstraints.forEach { $0.isActive = true }
|
||||||
|
@ -302,6 +307,7 @@ extension SessionCell {
|
||||||
)
|
)
|
||||||
radioBorderView.layer.cornerRadius = (size.borderSize / 2)
|
radioBorderView.layer.cornerRadius = (size.borderSize / 2)
|
||||||
|
|
||||||
|
radioView.accessibilityLabel = accessibilityLabel
|
||||||
radioView.alpha = (wasOldSelection ? 0.3 : 1)
|
radioView.alpha = (wasOldSelection ? 0.3 : 1)
|
||||||
radioView.isHidden = (!isSelected && !storedSelection)
|
radioView.isHidden = (!isSelected && !storedSelection)
|
||||||
radioView.themeBackgroundColor = (isSelected || wasOldSelection ?
|
radioView.themeBackgroundColor = (isSelected || wasOldSelection ?
|
||||||
|
@ -322,12 +328,14 @@ extension SessionCell {
|
||||||
radioBorderViewConstraints.forEach { $0.isActive = true }
|
radioBorderViewConstraints.forEach { $0.isActive = true }
|
||||||
|
|
||||||
case .highlightingBackgroundLabel(let title):
|
case .highlightingBackgroundLabel(let title):
|
||||||
|
highlightingBackgroundLabel.accessibilityLabel = accessibilityLabel
|
||||||
highlightingBackgroundLabel.text = title
|
highlightingBackgroundLabel.text = title
|
||||||
highlightingBackgroundLabel.themeTextColor = tintColor
|
highlightingBackgroundLabel.themeTextColor = tintColor
|
||||||
highlightingBackgroundLabel.isHidden = false
|
highlightingBackgroundLabel.isHidden = false
|
||||||
highlightingBackgroundLabelConstraints.forEach { $0.isActive = true }
|
highlightingBackgroundLabelConstraints.forEach { $0.isActive = true }
|
||||||
|
|
||||||
case .profile(let profileId, let profile):
|
case .profile(let profileId, let profile):
|
||||||
|
profilePictureView.accessibilityLabel = accessibilityLabel
|
||||||
profilePictureView.update(
|
profilePictureView.update(
|
||||||
publicKey: profileId,
|
publicKey: profileId,
|
||||||
profile: profile,
|
profile: profile,
|
||||||
|
@ -338,6 +346,7 @@ extension SessionCell {
|
||||||
|
|
||||||
case .customView(let viewGenerator):
|
case .customView(let viewGenerator):
|
||||||
let generatedView: UIView = viewGenerator()
|
let generatedView: UIView = viewGenerator()
|
||||||
|
generatedView.accessibilityLabel = accessibilityLabel
|
||||||
addSubview(generatedView)
|
addSubview(generatedView)
|
||||||
|
|
||||||
generatedView.pin(.top, to: .top, of: self)
|
generatedView.pin(.top, to: .top, of: self)
|
||||||
|
|
|
@ -308,6 +308,7 @@ public class SessionCell: UITableViewCell {
|
||||||
self.subtitleExtraView = info.subtitleExtraViewGenerator?()
|
self.subtitleExtraView = info.subtitleExtraViewGenerator?()
|
||||||
self.onExtraActionTap = info.extraAction?.onTap
|
self.onExtraActionTap = info.extraAction?.onTap
|
||||||
self.accessibilityIdentifier = info.accessibilityIdentifier
|
self.accessibilityIdentifier = info.accessibilityIdentifier
|
||||||
|
self.accessibilityLabel = info.accessibilityLabel
|
||||||
|
|
||||||
let leftFitToEdge: Bool = (info.leftAccessory?.shouldFitToEdge == true)
|
let leftFitToEdge: Bool = (info.leftAccessory?.shouldFitToEdge == true)
|
||||||
let rightFitToEdge: Bool = (!leftFitToEdge && info.rightAccessory?.shouldFitToEdge == true)
|
let rightFitToEdge: Bool = (!leftFitToEdge && info.rightAccessory?.shouldFitToEdge == true)
|
||||||
|
@ -315,12 +316,14 @@ public class SessionCell: UITableViewCell {
|
||||||
leftAccessoryView.update(
|
leftAccessoryView.update(
|
||||||
with: info.leftAccessory,
|
with: info.leftAccessory,
|
||||||
tintColor: info.tintColor,
|
tintColor: info.tintColor,
|
||||||
isEnabled: info.isEnabled
|
isEnabled: info.isEnabled,
|
||||||
|
accessibilityLabel: info.leftAccessoryAccessibilityLabel
|
||||||
)
|
)
|
||||||
rightAccessoryView.update(
|
rightAccessoryView.update(
|
||||||
with: info.rightAccessory,
|
with: info.rightAccessory,
|
||||||
tintColor: info.tintColor,
|
tintColor: info.tintColor,
|
||||||
isEnabled: info.isEnabled
|
isEnabled: info.isEnabled,
|
||||||
|
accessibilityLabel: info.rightAccessoryAccessibilityLabel
|
||||||
)
|
)
|
||||||
rightAccessoryFillConstraint.isActive = rightFitToEdge
|
rightAccessoryFillConstraint.isActive = rightFitToEdge
|
||||||
contentStackView.layoutMargins = UIEdgeInsets(
|
contentStackView.layoutMargins = UIEdgeInsets(
|
||||||
|
|
|
@ -21,10 +21,13 @@ public class ConfirmationModal: Modal {
|
||||||
let title: String
|
let title: String
|
||||||
let explanation: String?
|
let explanation: String?
|
||||||
let attributedExplanation: NSAttributedString?
|
let attributedExplanation: NSAttributedString?
|
||||||
|
let accessibilityLabel: String?
|
||||||
public let stateToShow: State
|
public let stateToShow: State
|
||||||
let confirmTitle: String?
|
let confirmTitle: String?
|
||||||
|
let confirmAccessibilityLabel: String?
|
||||||
let confirmStyle: ThemeValue
|
let confirmStyle: ThemeValue
|
||||||
let cancelTitle: String
|
let cancelTitle: String
|
||||||
|
let cancelAccessibilityLabel: String?
|
||||||
let cancelStyle: ThemeValue
|
let cancelStyle: ThemeValue
|
||||||
let dismissOnConfirm: Bool
|
let dismissOnConfirm: Bool
|
||||||
let onConfirm: ((UIViewController) -> ())?
|
let onConfirm: ((UIViewController) -> ())?
|
||||||
|
@ -36,10 +39,13 @@ public class ConfirmationModal: Modal {
|
||||||
title: String,
|
title: String,
|
||||||
explanation: String? = nil,
|
explanation: String? = nil,
|
||||||
attributedExplanation: NSAttributedString? = nil,
|
attributedExplanation: NSAttributedString? = nil,
|
||||||
|
accessibilityLabel: String? = nil,
|
||||||
stateToShow: State = .always,
|
stateToShow: State = .always,
|
||||||
confirmTitle: String? = nil,
|
confirmTitle: String? = nil,
|
||||||
|
confirmAccessibilityLabel: String? = nil,
|
||||||
confirmStyle: ThemeValue = .alert_text,
|
confirmStyle: ThemeValue = .alert_text,
|
||||||
cancelTitle: String = "TXT_CANCEL_TITLE".localized(),
|
cancelTitle: String = "TXT_CANCEL_TITLE".localized(),
|
||||||
|
cancelAccessibilityLabel: String? = nil,
|
||||||
cancelStyle: ThemeValue = .danger,
|
cancelStyle: ThemeValue = .danger,
|
||||||
dismissOnConfirm: Bool = true,
|
dismissOnConfirm: Bool = true,
|
||||||
onConfirm: ((UIViewController) -> ())? = nil,
|
onConfirm: ((UIViewController) -> ())? = nil,
|
||||||
|
@ -48,10 +54,13 @@ public class ConfirmationModal: Modal {
|
||||||
self.title = title
|
self.title = title
|
||||||
self.explanation = explanation
|
self.explanation = explanation
|
||||||
self.attributedExplanation = attributedExplanation
|
self.attributedExplanation = attributedExplanation
|
||||||
|
self.accessibilityLabel = accessibilityLabel
|
||||||
self.stateToShow = stateToShow
|
self.stateToShow = stateToShow
|
||||||
self.confirmTitle = confirmTitle
|
self.confirmTitle = confirmTitle
|
||||||
|
self.confirmAccessibilityLabel = confirmAccessibilityLabel
|
||||||
self.confirmStyle = confirmStyle
|
self.confirmStyle = confirmStyle
|
||||||
self.cancelTitle = cancelTitle
|
self.cancelTitle = cancelTitle
|
||||||
|
self.cancelAccessibilityLabel = cancelAccessibilityLabel
|
||||||
self.cancelStyle = cancelStyle
|
self.cancelStyle = cancelStyle
|
||||||
self.dismissOnConfirm = dismissOnConfirm
|
self.dismissOnConfirm = dismissOnConfirm
|
||||||
self.onConfirm = onConfirm
|
self.onConfirm = onConfirm
|
||||||
|
@ -67,10 +76,14 @@ public class ConfirmationModal: Modal {
|
||||||
return Info(
|
return Info(
|
||||||
title: self.title,
|
title: self.title,
|
||||||
explanation: self.explanation,
|
explanation: self.explanation,
|
||||||
|
attributedExplanation: self.attributedExplanation,
|
||||||
|
accessibilityLabel: self.accessibilityLabel,
|
||||||
stateToShow: self.stateToShow,
|
stateToShow: self.stateToShow,
|
||||||
confirmTitle: self.confirmTitle,
|
confirmTitle: self.confirmTitle,
|
||||||
|
confirmAccessibilityLabel: self.confirmAccessibilityLabel,
|
||||||
confirmStyle: self.confirmStyle,
|
confirmStyle: self.confirmStyle,
|
||||||
cancelTitle: self.cancelTitle,
|
cancelTitle: self.cancelTitle,
|
||||||
|
cancelAccessibilityLabel: self.cancelAccessibilityLabel,
|
||||||
cancelStyle: self.cancelStyle,
|
cancelStyle: self.cancelStyle,
|
||||||
dismissOnConfirm: self.dismissOnConfirm,
|
dismissOnConfirm: self.dismissOnConfirm,
|
||||||
onConfirm: (onConfirm ?? self.onConfirm),
|
onConfirm: (onConfirm ?? self.onConfirm),
|
||||||
|
@ -85,10 +98,13 @@ public class ConfirmationModal: Modal {
|
||||||
lhs.title == rhs.title &&
|
lhs.title == rhs.title &&
|
||||||
lhs.explanation == rhs.explanation &&
|
lhs.explanation == rhs.explanation &&
|
||||||
lhs.attributedExplanation == rhs.attributedExplanation &&
|
lhs.attributedExplanation == rhs.attributedExplanation &&
|
||||||
|
lhs.accessibilityLabel == rhs.accessibilityLabel &&
|
||||||
lhs.stateToShow == rhs.stateToShow &&
|
lhs.stateToShow == rhs.stateToShow &&
|
||||||
lhs.confirmTitle == rhs.confirmTitle &&
|
lhs.confirmTitle == rhs.confirmTitle &&
|
||||||
|
lhs.confirmAccessibilityLabel == rhs.confirmAccessibilityLabel &&
|
||||||
lhs.confirmStyle == rhs.confirmStyle &&
|
lhs.confirmStyle == rhs.confirmStyle &&
|
||||||
lhs.cancelTitle == rhs.cancelTitle &&
|
lhs.cancelTitle == rhs.cancelTitle &&
|
||||||
|
lhs.cancelAccessibilityLabel == rhs.cancelAccessibilityLabel &&
|
||||||
lhs.cancelStyle == rhs.cancelStyle &&
|
lhs.cancelStyle == rhs.cancelStyle &&
|
||||||
lhs.dismissOnConfirm == rhs.dismissOnConfirm
|
lhs.dismissOnConfirm == rhs.dismissOnConfirm
|
||||||
)
|
)
|
||||||
|
@ -98,10 +114,13 @@ public class ConfirmationModal: Modal {
|
||||||
title.hash(into: &hasher)
|
title.hash(into: &hasher)
|
||||||
explanation.hash(into: &hasher)
|
explanation.hash(into: &hasher)
|
||||||
attributedExplanation.hash(into: &hasher)
|
attributedExplanation.hash(into: &hasher)
|
||||||
|
accessibilityLabel.hash(into: &hasher)
|
||||||
stateToShow.hash(into: &hasher)
|
stateToShow.hash(into: &hasher)
|
||||||
confirmTitle.hash(into: &hasher)
|
confirmTitle.hash(into: &hasher)
|
||||||
|
confirmAccessibilityLabel.hash(into: &hasher)
|
||||||
confirmStyle.hash(into: &hasher)
|
confirmStyle.hash(into: &hasher)
|
||||||
cancelTitle.hash(into: &hasher)
|
cancelTitle.hash(into: &hasher)
|
||||||
|
cancelAccessibilityLabel.hash(into: &hasher)
|
||||||
cancelStyle.hash(into: &hasher)
|
cancelStyle.hash(into: &hasher)
|
||||||
dismissOnConfirm.hash(into: &hasher)
|
dismissOnConfirm.hash(into: &hasher)
|
||||||
}
|
}
|
||||||
|
@ -207,11 +226,15 @@ public class ConfirmationModal: Modal {
|
||||||
info.explanation == nil &&
|
info.explanation == nil &&
|
||||||
info.attributedExplanation == nil
|
info.attributedExplanation == nil
|
||||||
)
|
)
|
||||||
|
confirmButton.accessibilityLabel = info.confirmAccessibilityLabel
|
||||||
confirmButton.setTitle(info.confirmTitle, for: .normal)
|
confirmButton.setTitle(info.confirmTitle, for: .normal)
|
||||||
confirmButton.setThemeTitleColor(info.confirmStyle, for: .normal)
|
confirmButton.setThemeTitleColor(info.confirmStyle, for: .normal)
|
||||||
confirmButton.isHidden = (info.confirmTitle == nil)
|
confirmButton.isHidden = (info.confirmTitle == nil)
|
||||||
|
cancelButton.accessibilityLabel = info.cancelAccessibilityLabel
|
||||||
cancelButton.setTitle(info.cancelTitle, for: .normal)
|
cancelButton.setTitle(info.cancelTitle, for: .normal)
|
||||||
cancelButton.setThemeTitleColor(info.cancelStyle, for: .normal)
|
cancelButton.setThemeTitleColor(info.cancelStyle, for: .normal)
|
||||||
|
|
||||||
|
self.accessibilityLabel = info.accessibilityLabel
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder: NSCoder) {
|
required init?(coder: NSCoder) {
|
||||||
|
|
|
@ -291,43 +291,43 @@ public extension UIBezierPath {
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
public extension UIBarButtonItem {
|
public extension UIBarButtonItem {
|
||||||
convenience init(image: UIImage?, style: UIBarButtonItem.Style, target: Any?, action: Selector?, accessibilityIdentifier: String) {
|
convenience init(image: UIImage?, style: UIBarButtonItem.Style, target: Any?, action: Selector?, accessibilityIdentifier: String, accessibilityLabel: String? = nil) {
|
||||||
self.init(image: image, style: style, target: target, action: action)
|
self.init(image: image, style: style, target: target, action: action)
|
||||||
|
|
||||||
self.accessibilityIdentifier = accessibilityIdentifier
|
self.accessibilityIdentifier = accessibilityIdentifier
|
||||||
self.accessibilityLabel = accessibilityIdentifier
|
self.accessibilityLabel = accessibilityLabel == nil ? accessibilityIdentifier : accessibilityLabel
|
||||||
self.isAccessibilityElement = true
|
self.isAccessibilityElement = true
|
||||||
}
|
}
|
||||||
|
|
||||||
convenience init(image: UIImage?, landscapeImagePhone: UIImage?, style: UIBarButtonItem.Style, target: Any?, action: Selector?, accessibilityIdentifier: String) {
|
convenience init(image: UIImage?, landscapeImagePhone: UIImage?, style: UIBarButtonItem.Style, target: Any?, action: Selector?, accessibilityIdentifier: String, accessibilityLabel: String? = nil) {
|
||||||
self.init(image: image, landscapeImagePhone: landscapeImagePhone, style: style, target: target, action: action)
|
self.init(image: image, landscapeImagePhone: landscapeImagePhone, style: style, target: target, action: action)
|
||||||
|
|
||||||
self.accessibilityIdentifier = accessibilityIdentifier
|
self.accessibilityIdentifier = accessibilityIdentifier
|
||||||
self.accessibilityLabel = accessibilityIdentifier
|
self.accessibilityLabel = accessibilityLabel == nil ? accessibilityIdentifier : accessibilityLabel
|
||||||
self.isAccessibilityElement = true
|
self.isAccessibilityElement = true
|
||||||
}
|
}
|
||||||
|
|
||||||
convenience init(title: String?, style: UIBarButtonItem.Style, target: Any?, action: Selector?, accessibilityIdentifier: String) {
|
convenience init(title: String?, style: UIBarButtonItem.Style, target: Any?, action: Selector?, accessibilityIdentifier: String, accessibilityLabel: String? = nil) {
|
||||||
self.init(title: title, style: style, target: target, action: action)
|
self.init(title: title, style: style, target: target, action: action)
|
||||||
|
|
||||||
self.accessibilityIdentifier = accessibilityIdentifier
|
self.accessibilityIdentifier = accessibilityIdentifier
|
||||||
self.accessibilityLabel = accessibilityIdentifier
|
self.accessibilityLabel = accessibilityLabel == nil ? accessibilityIdentifier : accessibilityLabel
|
||||||
self.isAccessibilityElement = true
|
self.isAccessibilityElement = true
|
||||||
}
|
}
|
||||||
|
|
||||||
convenience init(barButtonSystemItem systemItem: UIBarButtonItem.SystemItem, target: Any?, action: Selector?, accessibilityIdentifier: String) {
|
convenience init(barButtonSystemItem systemItem: UIBarButtonItem.SystemItem, target: Any?, action: Selector?, accessibilityIdentifier: String, accessibilityLabel: String? = nil) {
|
||||||
self.init(barButtonSystemItem: systemItem, target: target, action: action)
|
self.init(barButtonSystemItem: systemItem, target: target, action: action)
|
||||||
|
|
||||||
self.accessibilityIdentifier = accessibilityIdentifier
|
self.accessibilityIdentifier = accessibilityIdentifier
|
||||||
self.accessibilityLabel = accessibilityIdentifier
|
self.accessibilityLabel = accessibilityLabel == nil ? accessibilityIdentifier : accessibilityLabel
|
||||||
self.isAccessibilityElement = true
|
self.isAccessibilityElement = true
|
||||||
}
|
}
|
||||||
|
|
||||||
convenience init(customView: UIView, accessibilityIdentifier: String) {
|
convenience init(customView: UIView, accessibilityIdentifier: String, accessibilityLabel: String? = nil) {
|
||||||
self.init(customView: customView)
|
self.init(customView: customView)
|
||||||
|
|
||||||
self.accessibilityIdentifier = accessibilityIdentifier
|
self.accessibilityIdentifier = accessibilityIdentifier
|
||||||
self.accessibilityLabel = accessibilityIdentifier
|
self.accessibilityLabel = accessibilityLabel == nil ? accessibilityIdentifier : accessibilityLabel
|
||||||
self.isAccessibilityElement = true
|
self.isAccessibilityElement = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue