Skip to content

Commit a1bf26b

Browse files
address review comments
1 parent ea6e00c commit a1bf26b

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

Horizon/Horizon/Sources/Features/LearningObjects/Assignment/AssignmentDetails/View/AssignmentDetails.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ struct AssignmentDetails: View {
7777
.refreshable {
7878
await viewModel.refresh()
7979
}
80+
.onChange(of: viewModel.isOverlayToolsPresented) { _, isPresented in
81+
if !isPresented && UIAccessibility.isVoiceOverRunning {
82+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
83+
NotificationCenter.default.post(name: .restoreAssignmentOptionsFocus, object: nil)
84+
}
85+
}
86+
}
8087
}
8188

8289
private var topView: some View {

Horizon/Horizon/Sources/Features/ModuleItemSequence/Sequence/View/ModuleNavBar/ModuleNavBarButtons.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ enum ModuleNavBarUtilityButtons: Equatable, Hashable {
105105
}
106106
}
107107

108+
var isAssignmentMoreOptions: Bool {
109+
switch self {
110+
case .assignmentMoreOptions:
111+
return true
112+
default:
113+
return false
114+
}
115+
}
116+
108117
static func == (lhs: ModuleNavBarUtilityButtons, rhs: ModuleNavBarUtilityButtons) -> Bool {
109118
switch (lhs, rhs) {
110119
case (.tts, .tts),

Horizon/Horizon/Sources/Features/ModuleItemSequence/Sequence/View/ModuleNavBar/ModuleNavBarView.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ struct ModuleNavBarView: View {
4040
// MARK: - Private Properties
4141

4242
@Environment(\.viewController) private var controller
43+
@AccessibilityFocusState private var isAssignmentOptionsButtonFocused: Bool
4344

4445
// MARK: - Dependencies
4546

@@ -72,6 +73,9 @@ struct ModuleNavBarView: View {
7273
Spacer()
7374
nextButtonView
7475
}
76+
.onReceive(NotificationCenter.default.publisher(for: .restoreAssignmentOptionsFocus)) { _ in
77+
isAssignmentOptionsButtonFocused = true
78+
}
7579
}
7680

7781
private var previousButtonView: some View {
@@ -114,5 +118,10 @@ struct ModuleNavBarView: View {
114118
.accessibilityElement(children: .ignore)
115119
.accessibilityLabel(button.accessibilityLabel)
116120
.accessibilityAddTraits(.isButton)
121+
.accessibilityFocused($isAssignmentOptionsButtonFocused, equals: button.isAssignmentMoreOptions)
117122
}
118123
}
124+
125+
extension Notification.Name {
126+
static let restoreAssignmentOptionsFocus = Notification.Name("restoreAssignmentOptionsFocus")
127+
}

0 commit comments

Comments
 (0)