From d60475be99bc97891a4282aedd8427a06ff4b44d Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Wed, 25 Aug 2021 11:54:41 +1000 Subject: [PATCH] add accessibility to send button and voice message button --- Session/Conversations/Input View/InputView.swift | 8 +++++++- Session/Conversations/Input View/InputViewButton.swift | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Session/Conversations/Input View/InputView.swift b/Session/Conversations/Input View/InputView.swift index af84dec92..599af7599 100644 --- a/Session/Conversations/Input View/InputView.swift +++ b/Session/Conversations/Input View/InputView.swift @@ -22,11 +22,17 @@ final class InputView : UIView, InputViewButtonDelegate, InputTextViewDelegate, // MARK: UI Components private lazy var attachmentsButton = ExpandingAttachmentsButton(delegate: delegate) - private lazy var voiceMessageButton = InputViewButton(icon: #imageLiteral(resourceName: "Microphone"), delegate: self) + private lazy var voiceMessageButton: InputViewButton = { + let result = InputViewButton(icon: #imageLiteral(resourceName: "Microphone"), delegate: self) + result.accessibilityLabel = NSLocalizedString("VOICE_MESSAGE_TOO_SHORT_ALERT_TITLE", comment: "") + result.accessibilityHint = NSLocalizedString("VOICE_MESSAGE_TOO_SHORT_ALERT_MESSAGE", comment: "") + return result + }() private lazy var sendButton: InputViewButton = { let result = InputViewButton(icon: #imageLiteral(resourceName: "ArrowUp"), isSendButton: true, delegate: self) result.isHidden = true + result.accessibilityLabel = NSLocalizedString("ATTACHMENT_APPROVAL_SEND_BUTTON", comment: "") return result }() private lazy var voiceMessageButtonContainer = container(for: voiceMessageButton) diff --git a/Session/Conversations/Input View/InputViewButton.swift b/Session/Conversations/Input View/InputViewButton.swift index 92707c7fc..082442faa 100644 --- a/Session/Conversations/Input View/InputViewButton.swift +++ b/Session/Conversations/Input View/InputViewButton.swift @@ -25,6 +25,7 @@ final class InputViewButton : UIView { self.hasOpaqueBackground = hasOpaqueBackground super.init(frame: CGRect.zero) setUpViewHierarchy() + self.isAccessibilityElement = true } override init(frame: CGRect) {