From bff4d59b9446da58ff36c24fa301f7a6a06824a0 Mon Sep 17 00:00:00 2001
From: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
Date: Tue, 19 Nov 2024 10:30:01 -0500
Subject: [PATCH] UI: update settings for location sharing

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

Change-Id: I400f8eb2e3119479502acd0d29c8f58f4d743c0c
---
 .../Settings/Me/GeneralSettingsViews.swift    | 36 ++++++++++---------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/Ring/Ring/Features/Settings/Me/GeneralSettingsViews.swift b/Ring/Ring/Features/Settings/Me/GeneralSettingsViews.swift
index ed44eff71..b08353f56 100644
--- a/Ring/Ring/Features/Settings/Me/GeneralSettingsViews.swift
+++ b/Ring/Ring/Features/Settings/Me/GeneralSettingsViews.swift
@@ -90,31 +90,33 @@ struct LocationSharingSettingsView: View {
                             Text(L10n.GeneralSettings.limitLocationSharingDuration)
                             Spacer()
                             Text(model.locationSharingDurationString)
-                                .onTapGesture {
-                                    showingDurationPicker = true
-                                }
+                            Image(systemName: "chevron.down")
+                        }
+                        .onTapGesture {
+                            withAnimation(.spring(response: 0.3, dampingFraction: 0.9, blendDuration: 0.4)) {
+                                showingDurationPicker = true
+                            }
                         }
                     }
-
                 }
                 .navigationBarTitleDisplayMode(.inline)
                 .navigationTitle(L10n.GeneralSettings.locationSharing)
             }
             if showingDurationPicker {
-                Color.black.opacity(0.4)
-                    .edgesIgnoringSafeArea(.all)
-                    .onTapGesture {
-                        withAnimation {
-                            showingDurationPicker = false
+                Group {
+                    Color.black.opacity(showingDurationPicker ? 0.4 : 0)
+                        .edgesIgnoringSafeArea(.all)
+                        .onTapGesture {
+                            withAnimation {
+                                showingDurationPicker = false
+                            }
                         }
-                    }
-
-                DurationPickerView(duration: $model.locationSharingDuration, isPresented: $showingDurationPicker)
-                    .background(Color(UIColor.systemBackground))
-                    .cornerRadius(12)
-                    .shadow(radius: 5)
-                    .transition(.move(edge: .bottom))
-                    .animation(.easeInOut)
+                    DurationPickerView(duration: $model.locationSharingDuration, isPresented: $showingDurationPicker)
+                        .background(Color(UIColor.systemBackground))
+                        .cornerRadius(12)
+                        .shadow(radius: 5)
+                        .transition(.move(edge: .bottom))
+                }
             }
         }
     }
-- 
GitLab