mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +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:
@@ -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