Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[P1] There's no alternative to the slider gesture #826

Open
wants to merge 2 commits into
base: qualif
Choose a base branch
from
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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/Orange-OpenSource/ods-ios/compare/1.1.0...qualif)
## [Unreleased](https://github.com/Orange-OpenSource/ods-ios/compare/1.2.0...qualif)

### Fixed

- [A11Y] There's no alternative to the slider gesture ([#734](https://github.com/Orange-OpenSource/ods-ios/issues/734))

## [1.2.0](https://github.com/Orange-OpenSource/ods-ios/compare/1.0.0...1.2.0) - 2024-05-06

### Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,28 @@ struct SliderVariant: View {
ODSSlider(value: $value, in: range, step: 0.5) {
Text("screens.components.sliders.sample.volume")
} minimumValueLabel: {
SliderLabel(show: model.showSideIcons, systemName: "speaker.wave.1.fill")
SliderLabel(show: model.showSideIcons, systemName: "speaker.wave.1.fill") {
value = max(value - 0.5, range.lowerBound)
}
} maximumValueLabel: {
SliderLabel(show: model.showSideIcons, systemName: "speaker.wave.3.fill")
SliderLabel(show: model.showSideIcons, systemName: "speaker.wave.3.fill") {
value = min(value + 0.5, range.upperBound)
}
} onEditingChanged: { isEditing in
Log.debug("isEdition: \(isEditing)")
}
} else {
ODSSlider(value: $value, in: range) {
Text("screens.components.sliders.sample.volume")
} minimumValueLabel: {
SliderLabel(show: model.showSideIcons, systemName: "speaker.wave.1.fill")
SliderLabel(show: model.showSideIcons, systemName: "speaker.wave.1.fill") {
value = max(value - 1.0, range.lowerBound)
}

} maximumValueLabel: {
SliderLabel(show: model.showSideIcons, systemName: "speaker.wave.3.fill")
SliderLabel(show: model.showSideIcons, systemName: "speaker.wave.3.fill") {
value = min(value + 1.0, range.upperBound)
}
} onEditingChanged: { isEditing in
Log.debug("isEdition: \(isEditing)")
}
Expand All @@ -77,9 +86,9 @@ struct SliderVariant: View {
}

@ViewBuilder
func SliderLabel(show: Bool, systemName: String) -> some View {
func SliderLabel(show: Bool, systemName: String, action: @escaping () -> Void) -> some View {
if show {
Image(systemName: systemName).accessibilityHidden(true)
ODSIconButton(image: Image(systemName: systemName), action: action)
}
}
}
Expand Down
Loading