mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
a11y label for pinned items + fix for the pinned items banner when voice over is on
This commit is contained in:
@@ -13,6 +13,7 @@ struct RoomScreen: View {
|
|||||||
@ObservedObject private var context: RoomScreenViewModelType.Context
|
@ObservedObject private var context: RoomScreenViewModelType.Context
|
||||||
@ObservedObject private var timelineContext: TimelineViewModelType.Context
|
@ObservedObject private var timelineContext: TimelineViewModelType.Context
|
||||||
let composerToolbar: ComposerToolbar
|
let composerToolbar: ComposerToolbar
|
||||||
|
@Environment(\.accessibilityVoiceOverEnabled) private var isVoiceOverEnabled
|
||||||
|
|
||||||
init(context: RoomScreenViewModelType.Context,
|
init(context: RoomScreenViewModelType.Context,
|
||||||
timelineContext: TimelineViewModelType.Context,
|
timelineContext: TimelineViewModelType.Context,
|
||||||
@@ -32,12 +33,22 @@ struct RoomScreen: View {
|
|||||||
}
|
}
|
||||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||||
.overlay(alignment: .top) {
|
.overlay(alignment: .top) {
|
||||||
pinnedItemsBanner
|
if !isVoiceOverEnabled {
|
||||||
|
pinnedItemsBanner
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// This can overlay on top of the pinnedItemsBanner
|
// This can overlay on top of the pinnedItemsBanner
|
||||||
.overlay(alignment: .top) {
|
.overlay(alignment: .top) {
|
||||||
knockRequestsBanner
|
knockRequestsBanner
|
||||||
}
|
}
|
||||||
|
.safeAreaInset(edge: .top) {
|
||||||
|
// When voice over is on the table view is not reversed
|
||||||
|
// and the scroll gestures are not intercepted
|
||||||
|
// so we render the pinned banner on top.
|
||||||
|
if isVoiceOverEnabled {
|
||||||
|
pinnedItemsBanner
|
||||||
|
}
|
||||||
|
}
|
||||||
.safeAreaInset(edge: .bottom, spacing: 0) {
|
.safeAreaInset(edge: .bottom, spacing: 0) {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
RoomScreenFooterView(details: context.viewState.footerDetails,
|
RoomScreenFooterView(details: context.viewState.footerDetails,
|
||||||
|
|||||||
@@ -309,6 +309,7 @@ private struct PinnedIndicatorViewModifier: ViewModifier {
|
|||||||
private var pinnedIndicator: some View {
|
private var pinnedIndicator: some View {
|
||||||
CompoundIcon(\.pinSolid, size: .xSmall, relativeTo: .compound.bodyMD)
|
CompoundIcon(\.pinSolid, size: .xSmall, relativeTo: .compound.bodyMD)
|
||||||
.foregroundStyle(Color.compound.iconTertiary)
|
.foregroundStyle(Color.compound.iconTertiary)
|
||||||
|
.accessibilityLabel(L10n.commonPinned)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user