mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 13:53:37 +00:00
[ios] Display navigation voice and change instructions in settings
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Yannik Bloscheck
parent
96d51dfcf9
commit
053f35b519
@@ -4,6 +4,10 @@ import SwiftUI
|
||||
struct SettingsNavigationView: View {
|
||||
// MARK: Properties
|
||||
|
||||
/// The scene phase of the environment
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
|
||||
|
||||
/// If the perspective view should be used during routing
|
||||
@State var hasPerspectiveViewWhileRouting: Bool = true
|
||||
|
||||
@@ -48,6 +52,10 @@ struct SettingsNavigationView: View {
|
||||
@State var shouldAvoidStepsWhileRouting: Bool = false
|
||||
|
||||
|
||||
/// A date for forcing a refresh of the view
|
||||
@State var forceRefreshDate: Date = Date.now
|
||||
|
||||
|
||||
/// The actual view
|
||||
var body: some View {
|
||||
List {
|
||||
@@ -73,6 +81,28 @@ struct SettingsNavigationView: View {
|
||||
Text("pref_tts_language_title")
|
||||
}
|
||||
|
||||
HStack {
|
||||
VStack(alignment: .leading) {
|
||||
Text("voice")
|
||||
|
||||
if #available(iOS 26, *) {
|
||||
Text("voice_explanation")
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.secondary)
|
||||
} else {
|
||||
Text("voice_explanation_before_version26")
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
Text(Settings.voiceForVoiceRouting ?? "unknown")
|
||||
.foregroundStyle(.secondary)
|
||||
.id(UUID())
|
||||
}
|
||||
|
||||
Toggle(isOn: $shouldAnnounceStreetnamesWhileVoiceRouting) {
|
||||
VStack(alignment: .leading) {
|
||||
Text("pref_tts_street_names_title")
|
||||
@@ -111,6 +141,7 @@ struct SettingsNavigationView: View {
|
||||
.listRowInsets(.init(top: 0, leading: 0, bottom: 0, trailing: 0))
|
||||
}
|
||||
}
|
||||
.id(forceRefreshDate)
|
||||
|
||||
Section {
|
||||
Toggle("avoid_tolls", isOn: $shouldAvoidTollRoadsWhileRouting)
|
||||
@@ -147,6 +178,9 @@ struct SettingsNavigationView: View {
|
||||
shouldAvoidMotorwaysWhileRouting = Settings.shouldAvoidMotorwaysWhileRouting
|
||||
shouldAvoidStepsWhileRouting = Settings.shouldAvoidStepsWhileRouting
|
||||
}
|
||||
.onChange(of: scenePhase) { _ in
|
||||
forceRefreshDate = Date.now
|
||||
}
|
||||
.onChange(of: hasPerspectiveViewWhileRouting) { changedHasPerspectiveViewWhileRouting in
|
||||
Settings.hasPerspectiveViewWhileRouting = changedHasPerspectiveViewWhileRouting
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user