Skip to content
Snippets Groups Projects
Commit bff4d59b authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

UI: update settings for location sharing

This patch makes the UI for selecting the location sharing time
more explicit.

Change-Id: I400f8eb2e3119479502acd0d29c8f58f4d743c0c
parent 38b62dcd
Branches
No related tags found
No related merge requests found
...@@ -90,31 +90,33 @@ struct LocationSharingSettingsView: View { ...@@ -90,31 +90,33 @@ struct LocationSharingSettingsView: View {
Text(L10n.GeneralSettings.limitLocationSharingDuration) Text(L10n.GeneralSettings.limitLocationSharingDuration)
Spacer() Spacer()
Text(model.locationSharingDurationString) Text(model.locationSharingDurationString)
Image(systemName: "chevron.down")
}
.onTapGesture { .onTapGesture {
withAnimation(.spring(response: 0.3, dampingFraction: 0.9, blendDuration: 0.4)) {
showingDurationPicker = true showingDurationPicker = true
} }
} }
} }
} }
.navigationBarTitleDisplayMode(.inline) .navigationBarTitleDisplayMode(.inline)
.navigationTitle(L10n.GeneralSettings.locationSharing) .navigationTitle(L10n.GeneralSettings.locationSharing)
} }
if showingDurationPicker { if showingDurationPicker {
Color.black.opacity(0.4) Group {
Color.black.opacity(showingDurationPicker ? 0.4 : 0)
.edgesIgnoringSafeArea(.all) .edgesIgnoringSafeArea(.all)
.onTapGesture { .onTapGesture {
withAnimation { withAnimation {
showingDurationPicker = false showingDurationPicker = false
} }
} }
DurationPickerView(duration: $model.locationSharingDuration, isPresented: $showingDurationPicker) DurationPickerView(duration: $model.locationSharingDuration, isPresented: $showingDurationPicker)
.background(Color(UIColor.systemBackground)) .background(Color(UIColor.systemBackground))
.cornerRadius(12) .cornerRadius(12)
.shadow(radius: 5) .shadow(radius: 5)
.transition(.move(edge: .bottom)) .transition(.move(edge: .bottom))
.animation(.easeInOut) }
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment