mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
* Fixes #660 - Expose message actions to voice over rotor * Expose "message actions" accessibility action on polls and voice messages too.
This commit is contained in:
@@ -114,6 +114,7 @@
|
||||
"common_link_copied_to_clipboard" = "Link copied to clipboard";
|
||||
"common_loading" = "Loading…";
|
||||
"common_message" = "Message";
|
||||
"common_message_actions" = "Message actions";
|
||||
"common_message_layout" = "Message layout";
|
||||
"common_message_removed" = "Message removed";
|
||||
"common_modern" = "Modern";
|
||||
@@ -543,7 +544,6 @@
|
||||
"screen_signed_out_subtitle" = "You might have been signed out for one of the reasons listed below. Please sign in again to continue using %@.";
|
||||
"screen_signed_out_title" = "You’re signed out";
|
||||
"screen_signout_confirmation_dialog_content" = "Are you sure you want to sign out?";
|
||||
"screen_signout_confirmation_dialog_title" = "Sign out";
|
||||
"screen_signout_in_progress_dialog_content" = "Signing out…";
|
||||
"screen_signout_key_backup_disabled_subtitle" = "You are about to sign out of your last session. If you sign out now, you will lose access to your encrypted messages.";
|
||||
"screen_signout_key_backup_disabled_title" = "You have turned off backup";
|
||||
@@ -561,7 +561,7 @@
|
||||
"screen_waitlist_title" = "You’re almost there.";
|
||||
"screen_waitlist_title_success" = "You're in.";
|
||||
"screen_welcome_bullet_1" = "Calls, polls, search and more will be added later this year.";
|
||||
"screen_welcome_bullet_2" = "Message history for encrypted rooms won’t be available in this update.";
|
||||
"screen_welcome_bullet_2" = "Message history for encrypted rooms isn’t available yet.";
|
||||
"screen_welcome_bullet_3" = "We’d love to hear from you, let us know what you think via the settings page.";
|
||||
"screen_welcome_button" = "Let's go!";
|
||||
"screen_welcome_subtitle" = "Here’s what you need to know:";
|
||||
@@ -651,5 +651,6 @@
|
||||
"screen_room_error_failed_processing_media" = "Failed processing media to upload, please try again.";
|
||||
"screen_room_notification_settings_mode_mentions_and_keywords" = "Mentions and Keywords only";
|
||||
"screen_signout_confirmation_dialog_submit" = "Sign out";
|
||||
"screen_signout_confirmation_dialog_title" = "Sign out";
|
||||
"screen_signout_preference_item" = "Sign out";
|
||||
"screen_waitlist_message_success" = "Welcome to %1$@!";
|
||||
|
||||
@@ -254,6 +254,8 @@ public enum L10n {
|
||||
}
|
||||
/// Message
|
||||
public static var commonMessage: String { return L10n.tr("Localizable", "common_message") }
|
||||
/// Message actions
|
||||
public static var commonMessageActions: String { return L10n.tr("Localizable", "common_message_actions") }
|
||||
/// Message layout
|
||||
public static var commonMessageLayout: String { return L10n.tr("Localizable", "common_message_layout") }
|
||||
/// Message removed
|
||||
@@ -1344,7 +1346,7 @@ public enum L10n {
|
||||
public static var screenWaitlistTitleSuccess: String { return L10n.tr("Localizable", "screen_waitlist_title_success") }
|
||||
/// Calls, polls, search and more will be added later this year.
|
||||
public static var screenWelcomeBullet1: String { return L10n.tr("Localizable", "screen_welcome_bullet_1") }
|
||||
/// Message history for encrypted rooms won’t be available in this update.
|
||||
/// Message history for encrypted rooms isn’t available yet.
|
||||
public static var screenWelcomeBullet2: String { return L10n.tr("Localizable", "screen_welcome_bullet_2") }
|
||||
/// We’d love to hear from you, let us know what you think via the settings page.
|
||||
public static var screenWelcomeBullet3: String { return L10n.tr("Localizable", "screen_welcome_bullet_3") }
|
||||
|
||||
+14
-3
@@ -16,14 +16,20 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
private struct TimelineAccessibilityModifier: ViewModifier {
|
||||
private struct TimelineItemAccessibilityModifier: ViewModifier {
|
||||
let timelineItem: RoomTimelineItemProtocol
|
||||
let action: () -> Void
|
||||
|
||||
@ViewBuilder
|
||||
func body(content: Content) -> some View {
|
||||
switch timelineItem {
|
||||
case is PollRoomTimelineItem, is VoiceMessageRoomTimelineItem:
|
||||
content
|
||||
.accessibilityActions {
|
||||
Button(L10n.commonMessageActions) {
|
||||
action()
|
||||
}
|
||||
}
|
||||
case let timelineItem as EventBasedTimelineItemProtocol:
|
||||
content
|
||||
.accessibilityRepresentation {
|
||||
@@ -33,6 +39,11 @@ private struct TimelineAccessibilityModifier: ViewModifier {
|
||||
}
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
.accessibilityActions {
|
||||
Button(L10n.commonMessageActions) {
|
||||
action()
|
||||
}
|
||||
}
|
||||
default:
|
||||
content
|
||||
.accessibilityElement(children: .combine)
|
||||
@@ -41,7 +52,7 @@ private struct TimelineAccessibilityModifier: ViewModifier {
|
||||
}
|
||||
|
||||
extension View {
|
||||
func timelineAccessibility(_ timelineItem: RoomTimelineItemProtocol) -> some View {
|
||||
modifier(TimelineAccessibilityModifier(timelineItem: timelineItem))
|
||||
func timelineItemAccessibility(_ timelineItem: RoomTimelineItemProtocol, action: @escaping () -> Void) -> some View {
|
||||
modifier(TimelineItemAccessibilityModifier(timelineItem: timelineItem, action: action))
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,9 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
||||
// Figma overlaps reactions by 3
|
||||
VStack(alignment: alignment, spacing: -3) {
|
||||
messageBubble
|
||||
.timelineAccessibility(timelineItem)
|
||||
.timelineItemAccessibility(timelineItem) {
|
||||
context.send(viewAction: .timelineItemMenu(itemID: timelineItem.id))
|
||||
}
|
||||
|
||||
if !timelineItem.properties.reactions.isEmpty {
|
||||
TimelineReactionsView(context: context,
|
||||
|
||||
@@ -64,7 +64,9 @@ struct TimelineItemPlainStylerView<Content: View>: View {
|
||||
|
||||
content()
|
||||
.layoutPriority(1)
|
||||
.timelineAccessibility(timelineItem)
|
||||
.timelineItemAccessibility(timelineItem) {
|
||||
context.send(viewAction: .timelineItemMenu(itemID: timelineItem.id))
|
||||
}
|
||||
}
|
||||
.onTapGesture(count: 2) {
|
||||
context.send(viewAction: .displayEmojiPicker(itemID: timelineItem.id))
|
||||
|
||||
Reference in New Issue
Block a user