From 15fded87c6f64e4658a90b40ff71ae6e721b7a0b Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Fri, 3 May 2024 14:09:38 +0200 Subject: [PATCH] added accessbility --- Riot/Assets/en.lproj/Vector.strings | 2 ++ Riot/Generated/Strings.swift | 8 ++++++++ RiotSwiftUI/Modules/Room/Composer/View/Composer.swift | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 6a7f09c6e9..924bda31c6 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -2603,6 +2603,8 @@ To enable access, tap Settings> Location and select Always"; // MARK: - WYSIWYG Composer +"wysiwyg_composer_action_minimise_action" = "Shrink composer"; +"wysiwyg_composer_action_maximise_action" = "Expand composer"; // Send Media Actions "wysiwyg_composer_start_action_media_picker" = "Photo Library"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index f5cc6ae5be..999f821c35 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -9567,6 +9567,14 @@ public class VectorL10n: NSObject { public static var widgetStickerPickerNoStickerpacksAlertAddNow: String { return VectorL10n.tr("Vector", "widget_sticker_picker_no_stickerpacks_alert_add_now") } + /// Expand composer + public static var wysiwygComposerActionMaximiseAction: String { + return VectorL10n.tr("Vector", "wysiwyg_composer_action_maximise_action") + } + /// Shrink composer + public static var wysiwygComposerActionMinimiseAction: String { + return VectorL10n.tr("Vector", "wysiwyg_composer_action_minimise_action") + } /// Apply bold format public static var wysiwygComposerFormatActionBold: String { return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_bold") diff --git a/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift b/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift index 5850980920..54f42cf746 100644 --- a/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift +++ b/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift @@ -82,6 +82,10 @@ struct Composer: View { wysiwygViewModel.maximised ? "minimiseButton" : "maximiseButton" } + private var toggleButtonAccessibilityLabel: String { + wysiwygViewModel.maximised ? VectorL10n.wysiwygComposerActionMinimiseAction : VectorL10n.wysiwygComposerActionMaximiseAction + } + private var toggleButtonImageName: String { wysiwygViewModel.maximised ? Asset.Images.minimiseComposer.name : Asset.Images.maximiseComposer.name } @@ -171,6 +175,7 @@ struct Composer: View { .frame(width: 16, height: 16) } .accessibilityIdentifier(toggleButtonAcccessibilityIdentifier) + .accessibilityLabel(toggleButtonAccessibilityLabel) .padding(.leading, 12) .padding(.trailing, 4) }