Skip to content

Commit

Permalink
added accessbility
Browse files Browse the repository at this point in the history
  • Loading branch information
Velin92 committed May 3, 2024
1 parent 0fa62fa commit 15fded8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
8 changes: 8 additions & 0 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions RiotSwiftUI/Modules/Room/Composer/View/Composer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -171,6 +175,7 @@ struct Composer: View {
.frame(width: 16, height: 16)
}
.accessibilityIdentifier(toggleButtonAcccessibilityIdentifier)
.accessibilityLabel(toggleButtonAccessibilityLabel)
.padding(.leading, 12)
.padding(.trailing, 4)
}
Expand Down

0 comments on commit 15fded8

Please sign in to comment.