changeset 95:04feeb708833

Minor UI updates
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Tue, 03 Aug 2021 15:02:40 +0100
parents 507ed393a72c
children fa994172c050
files Simoleon.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate Simoleon.xcodeproj/xcshareddata/xcschemes/Simoleon.xcscheme Simoleon/Favorites.swift Simoleon/Helpers/CurrencyRow.swift Simoleon/Helpers/LockedCurrencyPicker.swift Simoleon/Helpers/SearchBar.swift
diffstat 6 files changed, 19 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
Binary file Simoleon.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed
--- a/Simoleon.xcodeproj/xcshareddata/xcschemes/Simoleon.xcscheme	Tue Aug 03 13:20:09 2021 +0100
+++ b/Simoleon.xcodeproj/xcshareddata/xcschemes/Simoleon.xcscheme	Tue Aug 03 15:02:40 2021 +0100
@@ -51,7 +51,7 @@
       </Testables>
    </TestAction>
    <LaunchAction
-      buildConfiguration = "Debug"
+      buildConfiguration = "Release"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       launchStyle = "0"
--- a/Simoleon/Favorites.swift	Tue Aug 03 13:20:09 2021 +0100
+++ b/Simoleon/Favorites.swift	Tue Aug 03 15:02:40 2021 +0100
@@ -23,7 +23,7 @@
                         .padding(.top, 5)
                 }
                 .multilineTextAlignment(.center)
-                .foregroundColor(Color(.systemGray))
+                .foregroundColor(.secondary)
                 .padding(.horizontal, 50)
             } else {
                 List {
@@ -46,7 +46,11 @@
         .if(UIDevice.current.userInterfaceIdiom == .phone) { content in
             NavigationView { content }
         }
-        .onAppear(perform: generateFavoritesToScreenshots)
+        .onAppear {
+            #if DEBUG
+            generateFavoritesToScreenshots()
+            #endif
+        }
     }
     
     private func removeFromFavorites(offsets: IndexSet) {
@@ -61,13 +65,13 @@
             }
         }
     }
-    
+
+    #if DEBUG
     private func generateFavoritesToScreenshots() {
-        #if DEBUG
         if favorite.isEmpty {
             let favoriteCurrencies = [
-                "EUR/USD", "BTC/USD", "USD/HKD", "USD/JPY", "AUD/USD", "XAU/GBP", "DASH/ETH", "EUR/USD",
-                "XAG/CAD", "XRP/RUB"
+                "EUR/USD", "BTC/USD", "USD/HKD", "USD/JPY", "AUD/USD",
+                "XAU/GBP", "DASH/ETH", "EUR/USD", "XAG/CAD"
             ]
             
             for favoriteCurrency in favoriteCurrencies {
@@ -82,8 +86,8 @@
                 }
             }
         }
-        #endif
     }
+    #endif
 }
 
 struct Favorites_Previews: PreviewProvider {
--- a/Simoleon/Helpers/CurrencyRow.swift	Tue Aug 03 13:20:09 2021 +0100
+++ b/Simoleon/Helpers/CurrencyRow.swift	Tue Aug 03 15:02:40 2021 +0100
@@ -20,14 +20,14 @@
                 .aspectRatio(contentMode: .fill)
                 .frame(width: 30, height: 30)
                 .clipShape(Circle())
-                .overlay(Circle().stroke(Color(.systemGray), lineWidth: 1))
+                .overlay(Circle().stroke(Color(.secondaryLabel), lineWidth: 1))
             
             Image(currencyMetadata[String(currencies[1])]!.flag)
                 .resizable()
                 .aspectRatio(contentMode: .fill)
                 .frame(width: 30, height: 30)
                 .clipShape(Circle())
-                .overlay(Circle().stroke(Color(.systemGray), lineWidth: 1))
+                .overlay(Circle().stroke(Color(.secondaryLabel), lineWidth: 1))
                 .offset(x: -20)
                 .padding(.trailing, -20)
             
@@ -40,7 +40,7 @@
             
             if isLocked ?? false {
                 Image(systemName: "lock")
-                    .foregroundColor(Color(.systemGray))
+                    .foregroundColor(.secondary)
             }
         }
     }
@@ -48,6 +48,6 @@
 
 struct CurrencyRow_Previews: PreviewProvider {
     static var previews: some View {
-        CurrencyRow(currencyPairName: "USD/GBP")
+        CurrencyRow(currencyPairName: "USD/GBP", isLocked: true)
     }
 }
--- a/Simoleon/Helpers/LockedCurrencyPicker.swift	Tue Aug 03 13:20:09 2021 +0100
+++ b/Simoleon/Helpers/LockedCurrencyPicker.swift	Tue Aug 03 15:02:40 2021 +0100
@@ -16,10 +16,10 @@
             Text("Default currency")
             Spacer()
             Text(defaultCurrency.first?.pair ?? "USD/GBP")
-                .foregroundColor(Color(.systemGray))
+                .foregroundColor(.secondary)
             
             Image(systemName: "lock")
-                .foregroundColor(Color(.systemGray))
+                .foregroundColor(.secondary)
         }
     }
 }
--- a/Simoleon/Helpers/SearchBar.swift	Tue Aug 03 13:20:09 2021 +0100
+++ b/Simoleon/Helpers/SearchBar.swift	Tue Aug 03 15:02:40 2021 +0100
@@ -18,7 +18,7 @@
             .padding(10)
             .background(
                 RoundedRectangle(cornerRadius: 15)
-                    .foregroundColor(Color(.systemGray6))
+                    .foregroundColor(Color(.tertiarySystemFill))
             )
     }
 }