Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ private extension DefaultCameraScreen.BottomBar {
)
.frame(maxWidth: .infinity, alignment: .leading)
.transition(.scale)
.accessibilityLabel("Camera light")
.accessibilityHint("Toggles the camera light on or off.")
.accessibilityValue(parent.lightMode == .on ? "On" : "Off")
}}
@ViewBuilder func createCaptureButton() -> some View { if isCaptureButtonActive {
DefaultCameraScreen.CaptureButton(
Expand All @@ -68,6 +71,9 @@ private extension DefaultCameraScreen.BottomBar {
)
.frame(maxWidth: .infinity, alignment: .trailing)
.transition(.scale)
.accessibilityLabel("Camera chooser")
.accessibilityHint("Switches between front and back cameras.")
.accessibilityValue(parent.cameraPosition == .front ? "Front camera" : "Back camera")
}}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,22 @@ extension DefaultCameraScreen { struct CameraOutputSwitch: View {
}}
private extension DefaultCameraScreen.CameraOutputSwitch {
func createOutputTypeButton(_ outputType: CameraOutputType) -> some View {
Button(icon: getOutputTypeButtonIcon(outputType), active: isOutputTypeButtonActive(outputType)) {
let a11yValue: LocalizedStringKey = switch outputType {
case .photo: "Photo"
case .video: "Video"
}
let a11yHint: LocalizedStringKey = switch outputType {
case .photo: "Switch to video mode"
case .video: "Switch to photo mode"
}

return Button(icon: getOutputTypeButtonIcon(outputType), active: isOutputTypeButtonActive(outputType)) {
parent.setOutputType(outputType)
}
.rotationEffect(parent.iconAngle)
.accessibilityLabel("Camera type")
.accessibilityValue(a11yValue)
.accessibilityHint(a11yHint)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ extension DefaultCameraScreen { struct CaptureButton: View {

var body: some View {
Button(action: action, label: createButtonLabel).buttonStyle(ButtonScaleStyle())
.accessibilityLabel("Take picture")
.accessibilityHint("Takes a picture with the camera")
}
}}
private extension DefaultCameraScreen.CaptureButton {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,39 @@ private extension DefaultCameraScreen.TopBar {
iconRotationAngle: parent.iconAngle,
action: changeGridVisibility
)
.accessibilityLabel("Grid")
.accessibilityValue("\(parent.isGridVisible ? "on" : "off")")
.accessibilityHint("Turns the grid guide \(parent.isGridVisible ? "off" : "on")")
}}
@ViewBuilder func createFlipOutputButton() -> some View { if isFlipOutputButtonActive {
DefaultCameraScreen.TopButton(
icon: flipButtonIcon,
iconRotationAngle: parent.iconAngle,
action: changeMirrorOutput
)
.accessibilityLabel("Flip output \(parent.isOutputMirrored ? "on" : "off")")
.accessibilityHint("Flips the camera output horizontally.")
}}
@ViewBuilder func createFlashButton() -> some View { if isFlashButtonActive {
let a11yHint: LocalizedStringKey = switch parent.flashMode {
case .off: "Turns the camera flash on"
case .on: "Sets the camera flash to auto"
case .auto: "Turns the camera flash off"
}
let a11yValue: LocalizedStringKey = switch parent.flashMode {
case .off: "off"
case .on: "on"
case .auto: "auto"
}

DefaultCameraScreen.TopButton(
icon: flashButtonIcon,
iconRotationAngle: parent.iconAngle,
action: changeFlashMode
)
.accessibilityLabel("Chnge flash mode")
.accessibilityHint(a11yHint)
.accessibilityValue(a11yValue)
}}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ private extension DefaultCapturedMediaScreen {
action: retakeAction
)
.transition(.scale)
.accessibilityLabel("Retake")
.accessibilityHint("Retake the photo or video")
}}
@ViewBuilder func createSaveButton() -> some View { if isInitialized {
BottomButton(
Expand All @@ -79,6 +81,8 @@ private extension DefaultCapturedMediaScreen {
action: acceptMediaAction
)
.transition(.scale)
.accessibilityLabel("Accept")
.accessibilityHint("Accept the photo or video")
}}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ struct CloseButton: View {

var body: some View {
Button(action: action, label: createButtonLabel)
.accessibilityLabel("Close")
.accessibilityHint("Closes the camera")
}
}
private extension CloseButton {
Expand Down