diff --git a/flo.xcodeproj/project.pbxproj b/flo.xcodeproj/project.pbxproj index 47b055e..e0367aa 100644 --- a/flo.xcodeproj/project.pbxproj +++ b/flo.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + B02A003F2F36662C0024E8EC /* UIScreen+.swift in Sources */ = {isa = PBXBuildFile; fileRef = B02A003E2F3666240024E8EC /* UIScreen+.swift */; }; B0BAAAA62F31F0A0002A5FBB /* RadiosView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0BAAAA52F31F0A0002A5FBB /* RadiosView.swift */; }; B0BAAAA92F3213AF002A5FBB /* RadiosViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0BAAAA82F3213AB002A5FBB /* RadiosViewModel.swift */; }; B0BAAAAB2F3214F7002A5FBB /* Radio.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0BAAAAA2F3214F7002A5FBB /* Radio.swift */; }; @@ -82,6 +83,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + B02A003E2F3666240024E8EC /* UIScreen+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIScreen+.swift"; sourceTree = ""; }; B0BAAAA52F31F0A0002A5FBB /* RadiosView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadiosView.swift; sourceTree = ""; }; B0BAAAA82F3213AB002A5FBB /* RadiosViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadiosViewModel.swift; sourceTree = ""; }; B0BAAAAA2F3214F7002A5FBB /* Radio.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Radio.swift; sourceTree = ""; }; @@ -213,6 +215,7 @@ C4289F4D2C1253EB00C3A4FD /* Utils */ = { isa = PBXGroup; children = ( + B02A003E2F3666240024E8EC /* UIScreen+.swift */, C456D8F92F2FF33B002AAB8B /* LRCParser.swift */, C4F0B0A12F3A111100ABC002 /* AirPlayRoutePicker.swift */, C415F5592C11953000E3E1D2 /* Constants.swift */, @@ -450,6 +453,7 @@ C4100A6B2CE78B62001BC9BE /* Playlist.swift in Sources */, C4A4BF332C14437700363290 /* LibraryView.swift in Sources */, C46B8DD72CF4B89000B40644 /* Stats.swift in Sources */, + B02A003F2F36662C0024E8EC /* UIScreen+.swift in Sources */, C4F0B0A22F3A111100ABC002 /* AirPlayRoutePicker.swift in Sources */, C415F5642C11AA8700E3E1D2 /* Fonts.swift in Sources */, C456D8FE2F300D3D002AAB8B /* LyricsView.swift in Sources */, diff --git a/flo/ContentView.swift b/flo/ContentView.swift index 1816c10..c434947 100644 --- a/flo/ContentView.swift +++ b/flo/ContentView.swift @@ -74,6 +74,7 @@ struct ContentView: View { Spacer() if playerViewModel.hasNowPlaying() && !playerViewModel.shouldHidePlayer { + let bottomPaddingForSmallerScreens: CGFloat = UIScreen.screenWidth <= 375 ? 32 : 0 FloatingPlayerView(viewModel: playerViewModel) .padding(.bottom, 50) .opacity(playerViewModel.hasNowPlaying() ? 1 : 0) @@ -106,6 +107,7 @@ struct ContentView: View { self.isSwipping = false } ) + .padding(.bottom, bottomPaddingForSmallerScreens) } } } diff --git a/flo/Navigation/HomeView.swift b/flo/Navigation/HomeView.swift index 5af6def..84d757b 100644 --- a/flo/Navigation/HomeView.swift +++ b/flo/Navigation/HomeView.swift @@ -105,8 +105,10 @@ struct HomeView: View { VStack(alignment: .leading, spacing: 16) { Text("Listening Activity (all time)").customFont(.title2).fontWeight(.bold) .multilineTextAlignment(.leading) - - EqualHeightHStack(alignment: .top, spacing: 16) { + + let statCardSpacing: CGFloat = UIScreen.screenWidth <= 375 ? 8 : 16 + + EqualHeightHStack(alignment: .top, spacing: statCardSpacing) { EqualHeightItem { StatCard( title: "Total Listens", diff --git a/flo/Shared/Utils/UIScreen+.swift b/flo/Shared/Utils/UIScreen+.swift new file mode 100644 index 0000000..859813e --- /dev/null +++ b/flo/Shared/Utils/UIScreen+.swift @@ -0,0 +1,10 @@ +// flo + +import SwiftUI + +extension UIScreen { + static let screenWidth = UIScreen.main.bounds.size.width + static let screenHeight = UIScreen.main.bounds.size.height + static let screenSize = UIScreen.main.bounds.size +} + diff --git a/flo/StatCardView.swift b/flo/StatCardView.swift index ce2d0f7..18be8c4 100644 --- a/flo/StatCardView.swift +++ b/flo/StatCardView.swift @@ -43,6 +43,7 @@ struct StatCard: View { Text(title) .foregroundColor(.secondary) .customFont(.body) + .minimumScaleFactor(0.7) Spacer() @@ -60,6 +61,7 @@ struct StatCard: View { .lineSpacing(2) .fontWeight(.bold) .lineLimit(2) + .minimumScaleFactor(0.7) if let subtitle = subtitle { Text(subtitle) @@ -67,6 +69,7 @@ struct StatCard: View { .customFont(.subheadline) .lineSpacing(2) .lineLimit(2) + .minimumScaleFactor(0.7) } } } @@ -81,6 +84,7 @@ struct StatCard: View { Text(title) .foregroundColor(.secondary) .customFont(.body) + .minimumScaleFactor(0.7) Spacer() @@ -98,6 +102,7 @@ struct StatCard: View { .lineSpacing(2) .fontWeight(.bold) .lineLimit(2) + .minimumScaleFactor(0.7) if let subtitle = subtitle { Text(subtitle) @@ -105,6 +110,7 @@ struct StatCard: View { .customFont(.subheadline) .lineSpacing(2) .lineLimit(2) + .minimumScaleFactor(0.7) } } }