diff --git a/MedoDelirioBrasilia.xcodeproj/project.pbxproj b/MedoDelirioBrasilia.xcodeproj/project.pbxproj index 0e185874..ef5695a6 100644 --- a/MedoDelirioBrasilia.xcodeproj/project.pbxproj +++ b/MedoDelirioBrasilia.xcodeproj/project.pbxproj @@ -1090,7 +1090,6 @@ D992146F2A8F21C2004E82BC /* RecurringDonationBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = D992146E2A8F21C2004E82BC /* RecurringDonationBanner.swift */; }; D9943F152863CC4D002C6B97 /* A impiedosa justica de Deus.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = D9943F142863CC4D002C6B97 /* A impiedosa justica de Deus.mp3 */; }; D9943F172863DAE1002C6B97 /* FolderDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9943F162863DAE1002C6B97 /* FolderDetailView.swift */; }; - D9943F1A286406AF002C6B97 /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = D9943F19286406AF002C6B97 /* Kingfisher */; }; D9943F1C28641917002C6B97 /* LocalDatabase+Favorite.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9943F1B28641917002C6B97 /* LocalDatabase+Favorite.swift */; }; D9943F1E286419C2002C6B97 /* LocalDatabase+TopChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9943F1D286419C2002C6B97 /* LocalDatabase+TopChart.swift */; }; D9943F20286419CE002C6B97 /* LocalDatabase+Statistic.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9943F1F286419CE002C6B97 /* LocalDatabase+Statistic.swift */; }; @@ -2823,7 +2822,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D9943F1A286406AF002C6B97 /* Kingfisher in Frameworks */, D9E69592283D2E2C00C341B2 /* SQLite in Frameworks */, D94656D928450535008B4785 /* SQLiteMigrationManager in Frameworks */, ); @@ -4769,7 +4767,6 @@ packageProductDependencies = ( D9E69591283D2E2C00C341B2 /* SQLite */, D94656D828450535008B4785 /* SQLiteMigrationManager */, - D9943F19286406AF002C6B97 /* Kingfisher */, ); productName = MedoDelirioBrasilia; productReference = D9625E7A28238F9A00080852 /* MedoDelirio.app */; @@ -4825,7 +4822,6 @@ packageReferences = ( D9E69590283D2E2C00C341B2 /* XCRemoteSwiftPackageReference "SQLite" */, D94656D728450535008B4785 /* XCRemoteSwiftPackageReference "SQLiteMigrationManager" */, - D9943F18286406AF002C6B97 /* XCRemoteSwiftPackageReference "Kingfisher" */, ); productRefGroup = D9625E7B28238F9A00080852 /* Products */; projectDirPath = ""; @@ -6426,9 +6422,10 @@ MARKETING_VERSION = 6.38; PRODUCT_BUNDLE_IDENTIFIER = com.rafaelschmitt.MedoDelirioBrasilia; PRODUCT_NAME = MedoDelirio; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator"; SUPPORTS_MACCATALYST = NO; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -6466,9 +6463,10 @@ MARKETING_VERSION = 6.38; PRODUCT_BUNDLE_IDENTIFIER = com.rafaelschmitt.MedoDelirioBrasilia; PRODUCT_NAME = MedoDelirio; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator"; SUPPORTS_MACCATALYST = NO; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -6562,14 +6560,6 @@ minimumVersion = 0.8.0; }; }; - D9943F18286406AF002C6B97 /* XCRemoteSwiftPackageReference "Kingfisher" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/onevcat/Kingfisher"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 7.3.2; - }; - }; D9E69590283D2E2C00C341B2 /* XCRemoteSwiftPackageReference "SQLite" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/stephencelis/SQLite.swift"; @@ -6586,11 +6576,6 @@ package = D94656D728450535008B4785 /* XCRemoteSwiftPackageReference "SQLiteMigrationManager" */; productName = SQLiteMigrationManager; }; - D9943F19286406AF002C6B97 /* Kingfisher */ = { - isa = XCSwiftPackageProductDependency; - package = D9943F18286406AF002C6B97 /* XCRemoteSwiftPackageReference "Kingfisher" */; - productName = Kingfisher; - }; D9E69591283D2E2C00C341B2 /* SQLite */ = { isa = XCSwiftPackageProductDependency; package = D9E69590283D2E2C00C341B2 /* XCRemoteSwiftPackageReference "SQLite" */; diff --git a/MedoDelirioBrasilia.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/MedoDelirioBrasilia.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index a75e0f06..982ffd3a 100644 --- a/MedoDelirioBrasilia.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/MedoDelirioBrasilia.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,14 +1,5 @@ { "pins" : [ - { - "identity" : "kingfisher", - "kind" : "remoteSourceControl", - "location" : "https://github.com/onevcat/Kingfisher", - "state" : { - "revision" : "c1f60c63f356d364f4284ba82961acbe7de79bcc", - "version" : "7.8.1" - } - }, { "identity" : "sqlite.swift", "kind" : "remoteSourceControl", diff --git a/MedoDelirioBrasilia/Sources/AppSupport/MedoDelirioBrasiliaApp.swift b/MedoDelirioBrasilia/Sources/AppSupport/MedoDelirioBrasiliaApp.swift index a9576a98..32afe814 100644 --- a/MedoDelirioBrasilia/Sources/AppSupport/MedoDelirioBrasiliaApp.swift +++ b/MedoDelirioBrasilia/Sources/AppSupport/MedoDelirioBrasiliaApp.swift @@ -50,6 +50,9 @@ class AppDelegate: NSObject, UIApplicationDelegate { prepareAudioPlayerOnMac() collectTelemetry() + print(UIDevice.current.systemName) + print(ProcessInfo.processInfo.isiOSAppOnMac) + return true } diff --git a/MedoDelirioBrasilia/Sources/Extensions/UIDevice+Extensions.swift b/MedoDelirioBrasilia/Sources/Extensions/UIDevice+Extensions.swift index b463afee..4bc35f04 100644 --- a/MedoDelirioBrasilia/Sources/Extensions/UIDevice+Extensions.swift +++ b/MedoDelirioBrasilia/Sources/Extensions/UIDevice+Extensions.swift @@ -4,10 +4,11 @@ import UIKit extension UIDevice { static var is4InchDevice: Bool { - guard UIDevice.current.userInterfaceIdiom == .phone else { - return false - } - return UIScreen.main.bounds.width == 320 +// guard UIDevice.current.userInterfaceIdiom == .phone else { +// return false +// } +// return UIScreen.main.bounds.width == 320 + return false } static var isiPadMini: Bool { @@ -103,11 +104,14 @@ public extension UIDevice { case "iPad8,11", "iPad8,12": return "iPad Pro (12.9-inch) (4th generation)" case "iPad13,8", "iPad13,9", "iPad13,10", "iPad13,11": return "iPad Pro (12.9-inch) (5th generation)" case "iPad14,5", "iPad14,6": return "iPad Pro (12.9-inch) (6th generation)" - case "RealityDevice14,1": return "Apple Vision Pro" case "i386", "x86_64", "arm64": return "Simulator \(mapToDevice(identifier: ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] ?? "iOS"))" default: return identifier } #endif + + #if os(visionOS) + return "Apple Vision Pro" + #endif } return mapToDevice(identifier: identifier) diff --git a/MedoDelirioBrasilia/Sources/Helpers/TapticHelper.swift b/MedoDelirioBrasilia/Sources/Helpers/TapticHelper.swift index 69562f38..624965ec 100644 --- a/MedoDelirioBrasilia/Sources/Helpers/TapticHelper.swift +++ b/MedoDelirioBrasilia/Sources/Helpers/TapticHelper.swift @@ -3,23 +3,31 @@ import UIKit class TapticFeedback { static func success() { + #if !os (xrOS) let generator = UINotificationFeedbackGenerator() generator.notificationOccurred(.success) + #endif } static func warning() { + #if !os (xrOS) let generator = UINotificationFeedbackGenerator() generator.notificationOccurred(.warning) + #endif } static func error() { + #if !os (xrOS) let generator = UINotificationFeedbackGenerator() generator.notificationOccurred(.error) + #endif } static func open() { + #if !os (xrOS) let generator = UIImpactFeedbackGenerator(style: .medium) generator.impactOccurred() + #endif } } diff --git a/MedoDelirioBrasilia/Sources/Helpers/VideoMaker.swift b/MedoDelirioBrasilia/Sources/Helpers/VideoMaker.swift index 6b5e5471..000bdaca 100644 --- a/MedoDelirioBrasilia/Sources/Helpers/VideoMaker.swift +++ b/MedoDelirioBrasilia/Sources/Helpers/VideoMaker.swift @@ -55,8 +55,8 @@ class VideoMaker { let textColor = UIColor.black let textFont = UIFont.systemFont(ofSize: 72, weight: .bold) - let scale = UIScreen.main.scale - UIGraphicsBeginImageContextWithOptions(image.size, false, scale) + //let scale = UIScreen.main.scale + UIGraphicsBeginImageContextWithOptions(image.size, false, 1.0) let textFontAttributes = [ NSAttributedString.Key.font: textFont, @@ -79,104 +79,7 @@ class VideoMaker { exportType: IntendedVideoDestination, success: @escaping ((URL) -> Void), failure: @escaping ((Error?) -> Void)) { - let mixComposition: AVMutableComposition = AVMutableComposition() - var mutableCompositionVideoTrack: [AVMutableCompositionTrack] = [] - var mutableCompositionAudioTrack: [AVMutableCompositionTrack] = [] - let totalVideoCompositionInstruction: AVMutableVideoCompositionInstruction = AVMutableVideoCompositionInstruction() - - let aVideoAsset: AVAsset = AVAsset(url: videoUrl) - let aAudioAsset: AVAsset = AVAsset(url: audioUrl) - - if let videoTrack = mixComposition.addMutableTrack(withMediaType: .video, preferredTrackID: kCMPersistentTrackID_Invalid), let audioTrack = mixComposition.addMutableTrack(withMediaType: .audio, preferredTrackID: kCMPersistentTrackID_Invalid) { - mutableCompositionVideoTrack.append(videoTrack) - mutableCompositionAudioTrack.append(audioTrack) - - if let aVideoAssetTrack: AVAssetTrack = aVideoAsset.tracks(withMediaType: .video).first, let aAudioAssetTrack: AVAssetTrack = aAudioAsset.tracks(withMediaType: .audio).first { - do { - try mutableCompositionVideoTrack.first?.insertTimeRange(CMTimeRangeMake(start: CMTime.zero, duration: aVideoAssetTrack.timeRange.duration), of: aVideoAssetTrack, at: CMTime.zero) - - let videoDuration = aVideoAsset.duration - if CMTimeCompare(videoDuration, aAudioAsset.duration) == -1 { - try mutableCompositionAudioTrack.first?.insertTimeRange(CMTimeRangeMake(start: CMTime.zero, duration: aVideoAssetTrack.timeRange.duration), of: aAudioAssetTrack, at: CMTime.zero) - } else if CMTimeCompare(videoDuration, aAudioAsset.duration) == 1 { - var currentTime = CMTime.zero - while true { - var audioDuration = aAudioAsset.duration - let totalDuration = CMTimeAdd(currentTime, audioDuration) - if CMTimeCompare(totalDuration, videoDuration) == 1 { - audioDuration = CMTimeSubtract(totalDuration, videoDuration) - } - try mutableCompositionAudioTrack.first?.insertTimeRange(CMTimeRangeMake(start: CMTime.zero, duration: aVideoAssetTrack.timeRange.duration), of: aAudioAssetTrack, at: currentTime) - - currentTime = CMTimeAdd(currentTime, audioDuration) - if CMTimeCompare(currentTime, videoDuration) == 1 || CMTimeCompare(currentTime, videoDuration) == 0 { - break - } - } - } - videoTrack.preferredTransform = aVideoAssetTrack.preferredTransform - } catch { - print(error) - } - - totalVideoCompositionInstruction.timeRange = CMTimeRangeMake(start: CMTime.zero, duration: aVideoAssetTrack.timeRange.duration) - } - } - - let mutableVideoComposition: AVMutableVideoComposition = AVMutableVideoComposition() - mutableVideoComposition.frameDuration = CMTimeMake(value: 1, timescale: 30) - - var videoWidth: Int = 0 - var videoHeight: Int = 0 - - if exportType == IntendedVideoDestination.twitter { - videoWidth = 1000 - videoHeight = 1000 - } else { - videoWidth = 1080 - videoHeight = 1920 - } - - mutableVideoComposition.renderSize = CGSize(width: videoWidth, height: videoHeight) - - if let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first { - let outputURL = URL(fileURLWithPath: documentsPath).appendingPathComponent("\(videoName).mov") - - do { - if FileManager.default.fileExists(atPath: outputURL.path) { - try FileManager.default.removeItem(at: outputURL) - } - } catch { - print("Could not remove file: \(error.localizedDescription)") - } - - if let exportSession = AVAssetExportSession(asset: mixComposition, presetName: AVAssetExportPresetHighestQuality) { - exportSession.outputURL = outputURL - exportSession.outputFileType = AVFileType.mp4 - exportSession.shouldOptimizeForNetworkUse = true - - // try to export the file and handle the status cases - exportSession.exportAsynchronously(completionHandler: { - switch exportSession.status { - case .failed: - if let error = exportSession.error { - failure(error) - } - - case .cancelled: - if let error = exportSession.error { - failure(error) - } - - default: - print("finished") - success(outputURL) - } - }) - } else { - failure(nil) - } - } + return } static func createVideo(fromImage image: UIImage, diff --git a/MedoDelirioBrasilia/Sources/Views/Authors/AuthorCell.swift b/MedoDelirioBrasilia/Sources/Views/Authors/AuthorCell.swift index 40441ffd..51b80a5d 100644 --- a/MedoDelirioBrasilia/Sources/Views/Authors/AuthorCell.swift +++ b/MedoDelirioBrasilia/Sources/Views/Authors/AuthorCell.swift @@ -6,7 +6,7 @@ // import SwiftUI -import Kingfisher +//import Kingfisher struct AuthorCell: View { @@ -23,21 +23,21 @@ struct AuthorCell: View { .opacity(colorScheme == .dark ? 0.25 : 0.15) HStack { - if authorImageURL.isEmpty == false { - KFImage(URL(string: authorImageURL)) - .placeholder { - Image(systemName: "person.circle") - .resizable() - .scaledToFit() - .frame(height: 50) - .foregroundColor(.gray) - .opacity(0.3) - } - .resizable() - .scaledToFit() - .frame(width: 55) - .clipShape(Circle()) - } +// if authorImageURL.isEmpty == false { +// KFImage(URL(string: authorImageURL)) +// .placeholder { +// Image(systemName: "person.circle") +// .resizable() +// .scaledToFit() +// .frame(height: 50) +// .foregroundColor(.gray) +// .opacity(0.3) +// } +// .resizable() +// .scaledToFit() +// .frame(width: 55) +// .clipShape(Circle()) +// } VStack(alignment: .leading, spacing: 8) { Text(authorName) diff --git a/MedoDelirioBrasilia/Sources/Views/Authors/AuthorDetailView.swift b/MedoDelirioBrasilia/Sources/Views/Authors/AuthorDetailView.swift index e2a5d3ae..b48c0079 100644 --- a/MedoDelirioBrasilia/Sources/Views/Authors/AuthorDetailView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Authors/AuthorDetailView.swift @@ -6,7 +6,7 @@ // import SwiftUI -import Kingfisher +//import Kingfisher struct AuthorDetailView: View { @@ -113,24 +113,24 @@ struct AuthorDetailView: View { } else { GeometryReader { scrollViewGeometry in ScrollView { - if author.photo != nil { - GeometryReader { headerPhotoGeometry in - KFImage(URL(string: author.photo ?? .empty)) - .placeholder { - Image(systemName: "photo.on.rectangle") - .resizable() - .scaledToFit() - .frame(height: 100) - .foregroundColor(.gray) - .opacity(0.3) - } - .resizable() - .scaledToFill() - .frame(width: headerPhotoGeometry.size.width, height: self.getHeightForHeaderImage(headerPhotoGeometry)) - .clipped() - .offset(x: 0, y: self.getOffsetForHeaderImage(headerPhotoGeometry)) - }.frame(height: 250) - } +// if author.photo != nil { +// GeometryReader { headerPhotoGeometry in +// KFImage(URL(string: author.photo ?? .empty)) +// .placeholder { +// Image(systemName: "photo.on.rectangle") +// .resizable() +// .scaledToFit() +// .frame(height: 100) +// .foregroundColor(.gray) +// .opacity(0.3) +// } +// .resizable() +// .scaledToFill() +// .frame(width: headerPhotoGeometry.size.width, height: self.getHeightForHeaderImage(headerPhotoGeometry)) +// .clipped() +// .offset(x: 0, y: self.getOffsetForHeaderImage(headerPhotoGeometry)) +// }.frame(height: 250) +// } VStack(alignment: .leading, spacing: 15) { HStack { diff --git a/MedoDelirioBrasilia/Sources/Views/Authors/AuthorsView.swift b/MedoDelirioBrasilia/Sources/Views/Authors/AuthorsView.swift index 4e042488..a948144c 100644 --- a/MedoDelirioBrasilia/Sources/Views/Authors/AuthorsView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Authors/AuthorsView.swift @@ -48,7 +48,7 @@ struct AuthorsView: View { LazyVGrid(columns: columns, spacing: 20) { if searchResults.isEmpty { NoSearchResultsView(searchText: $searchText) - .padding(.vertical, UIScreen.main.bounds.height / 4) + //.padding(.vertical, UIScreen.main.bounds.height / 4) } else { ForEach(searchResults) { author in NavigationLink(destination: AuthorDetailView(viewModel: AuthorDetailViewViewModel(originatingScreenName: searchText.isEmpty ? Shared.ScreenNames.authorsView : "\(Shared.ScreenNames.authorsView)(\(searchText))", authorName: author.name, currentSoundsListMode: $currentSoundsListMode), author: author, currentSoundsListMode: $currentSoundsListMode)) { diff --git a/MedoDelirioBrasilia/Sources/Views/Banners/FoldersAreTagsBannerView.swift b/MedoDelirioBrasilia/Sources/Views/Banners/FoldersAreTagsBannerView.swift index 10b115d0..df295496 100644 --- a/MedoDelirioBrasilia/Sources/Views/Banners/FoldersAreTagsBannerView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Banners/FoldersAreTagsBannerView.swift @@ -6,16 +6,7 @@ struct FoldersAreTagsBannerView: View { var roundedRectangleHeight: CGFloat { if UIDevice.current.userInterfaceIdiom == .phone { - switch UIScreen.main.bounds.width { - case 320: // iPod touch 7 - return 204 - case 375: // iPhone 8 - return 164 - case 390: // iPhone 13 - return 160 - default: // iPhone 11, 13 Pro Max - return 150 - } + return 150 } else { return 100 } diff --git a/MedoDelirioBrasilia/Sources/Views/Banners/FoldersBannerView.swift b/MedoDelirioBrasilia/Sources/Views/Banners/FoldersBannerView.swift index 694fa60b..a395820c 100644 --- a/MedoDelirioBrasilia/Sources/Views/Banners/FoldersBannerView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Banners/FoldersBannerView.swift @@ -5,16 +5,7 @@ struct FoldersBannerView: View { @Binding var displayMe: Bool var roundedRectangleHeight: CGFloat { - switch UIScreen.main.bounds.width { - case 320: - return 220 - case 375: - return 180 - case 390: - return 176 - default: - return 166 - } + return 166 } var body: some View { diff --git a/MedoDelirioBrasilia/Sources/Views/Banners/JoinFolderResearchBannerView.swift b/MedoDelirioBrasilia/Sources/Views/Banners/JoinFolderResearchBannerView.swift index eac053a0..b9bb3963 100644 --- a/MedoDelirioBrasilia/Sources/Views/Banners/JoinFolderResearchBannerView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Banners/JoinFolderResearchBannerView.swift @@ -7,17 +7,7 @@ struct JoinFolderResearchBannerView: View { @Environment(\.colorScheme) var colorScheme var backgroundHeight: CGFloat { - guard UIDevice.current.userInterfaceIdiom == .phone else { - return 140 - } - switch UIScreen.main.bounds.width { - case 320: - return 240 - case 428, 430: - return 180 - default: - return 200 - } + return 140 } var backgroundOpacity: Double { @@ -29,17 +19,7 @@ struct JoinFolderResearchBannerView: View { } var buttonInternalPadding: CGFloat { - guard UIDevice.current.userInterfaceIdiom == .phone else { - return 20 - } - switch UIScreen.main.bounds.width { - case 320: - return 0 - case 375: - return 10 - default: - return 20 - } + return 20 } var body: some View { diff --git a/MedoDelirioBrasilia/Sources/Views/Collections/CollectionCell.swift b/MedoDelirioBrasilia/Sources/Views/Collections/CollectionCell.swift index 76d2f402..1852ac81 100644 --- a/MedoDelirioBrasilia/Sources/Views/Collections/CollectionCell.swift +++ b/MedoDelirioBrasilia/Sources/Views/Collections/CollectionCell.swift @@ -6,7 +6,6 @@ // import SwiftUI -import Kingfisher struct CollectionCell: View { @@ -17,18 +16,20 @@ struct CollectionCell: View { var body: some View { ZStack { - KFImage(URL(string: imageURL)) - .placeholder { - Image(systemName: "photo") - .resizable() - .scaledToFit() - .frame(height: 35) - .foregroundColor(.gray) - } - .resizable() - .scaledToFill() - .frame(width: 180) - .clipShape(RoundedRectangle(cornerRadius: 20, style: .continuous)) +// #if !os (xrOS) +// KFImage(URL(string: imageURL)) +// .placeholder { +// Image(systemName: "photo") +// .resizable() +// .scaledToFit() +// .frame(height: 35) +// .foregroundColor(.gray) +// } +// .resizable() +// .scaledToFill() +// .frame(width: 180) +// .clipShape(RoundedRectangle(cornerRadius: 20, style: .continuous)) +// #endif // RoundedRectangle(cornerRadius: 20, style: .continuous) // .fill(regularGradient) diff --git a/MedoDelirioBrasilia/Sources/Views/FirstOpen/WhatsNewView.swift b/MedoDelirioBrasilia/Sources/Views/FirstOpen/WhatsNewView.swift index b474d273..bd7fe6d0 100644 --- a/MedoDelirioBrasilia/Sources/Views/FirstOpen/WhatsNewView.swift +++ b/MedoDelirioBrasilia/Sources/Views/FirstOpen/WhatsNewView.swift @@ -12,7 +12,7 @@ struct WhatsNewView: View { @Binding var isBeingShown: Bool private var spacingTopBottom: CGFloat { - UIScreen.main.bounds.width > 389 ? 100 : 50 + 100 } private var systemName: String { diff --git a/MedoDelirioBrasilia/Sources/Views/Folders/AddToFolderView.swift b/MedoDelirioBrasilia/Sources/Views/Folders/AddToFolderView.swift index eef8770a..10836e0f 100644 --- a/MedoDelirioBrasilia/Sources/Views/Folders/AddToFolderView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Folders/AddToFolderView.swift @@ -21,11 +21,7 @@ struct AddToFolderView: View { @State private var folderForSomeSoundsAlreadyInFolder: UserFolder? = nil private var createNewFolderCellWidth: CGFloat { - if UIDevice.current.userInterfaceIdiom == .phone { - return (UIScreen.main.bounds.size.width / 2) - 20 - } else { - return 250 - } + return 250 } private let columns = [ diff --git a/MedoDelirioBrasilia/Sources/Views/Folders/FolderList/FolderList.swift b/MedoDelirioBrasilia/Sources/Views/Folders/FolderList/FolderList.swift index 6751df2e..7495e358 100644 --- a/MedoDelirioBrasilia/Sources/Views/Folders/FolderList/FolderList.swift +++ b/MedoDelirioBrasilia/Sources/Views/Folders/FolderList/FolderList.swift @@ -35,18 +35,7 @@ struct FolderList: View { } private var noFoldersScrollHeight: CGFloat { - if UIDevice.current.userInterfaceIdiom == .phone { - let screenWidth = UIScreen.main.bounds.height - if screenWidth < 600 { - return 0 - } else if screenWidth < 800 { - return 50 - } else { - return 100 - } - } else { - return 100 - } + return 100 } var body: some View { diff --git a/MedoDelirioBrasilia/Sources/Views/Settings/SettingsView.swift b/MedoDelirioBrasilia/Sources/Views/Settings/SettingsView.swift index 6d1ab202..a7697d5d 100644 --- a/MedoDelirioBrasilia/Sources/Views/Settings/SettingsView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Settings/SettingsView.swift @@ -209,7 +209,7 @@ extension SettingsView { @Binding var showToastView: Bool private var copyPixKeyButtonHorizontalPadding: CGFloat { - UIScreen.main.bounds.width > 400 ? 20 : 10 + return 20 } private let pixKey: String = "medodeliriosuporte@gmail.com" diff --git a/MedoDelirioBrasilia/Sources/Views/Shared/HitsMedoDelirioBannerView.swift b/MedoDelirioBrasilia/Sources/Views/Shared/HitsMedoDelirioBannerView.swift index 4c199635..65efae0c 100644 --- a/MedoDelirioBrasilia/Sources/Views/Shared/HitsMedoDelirioBannerView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Shared/HitsMedoDelirioBannerView.swift @@ -3,22 +3,7 @@ import SwiftUI struct HitsMedoDelirioBannerView: View { var roundedRectangleHeight: CGFloat { - if UIDevice.current.userInterfaceIdiom == .phone { - switch UIScreen.main.bounds.width { - case 320: // iPhone SE 1 - return 237 - case 375: // iPhone 8 - return 242 - case 390: // iPhone 12/13 - return 243 - case 428: // iPhone 13 Pro Max - return 210 - default: // iPhone 11/8 Plus - return 230 - } - } else { // iPad/Mac - return 150 - } + return 150 } var body: some View { diff --git a/MedoDelirioBrasilia/Sources/Views/Shared/HotWeatherAdBannerView.swift b/MedoDelirioBrasilia/Sources/Views/Shared/HotWeatherAdBannerView.swift index 3b772b52..0f752ea2 100644 --- a/MedoDelirioBrasilia/Sources/Views/Shared/HotWeatherAdBannerView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Shared/HotWeatherAdBannerView.swift @@ -6,22 +6,7 @@ struct HotWeatherAdBannerView: View { @Environment(\.colorScheme) var colorScheme var roundedRectangleHeight: CGFloat { - if UIDevice.current.userInterfaceIdiom == .phone { - switch UIScreen.main.bounds.width { - case 320: // iPhone SE 1 - return 510 - case 375: // iPhone 8 - return 500 - case 390: // iPhone 12/13 - return 475 - case 428: // iPhone 13 Pro Max - return 380 - default: // iPhone 11/8 Plus - return 400 - } - } else { // iPad/Mac - return 200 - } + return 200 } var adTitle: String { diff --git a/MedoDelirioBrasilia/Sources/Views/Songs/SongsView.swift b/MedoDelirioBrasilia/Sources/Views/Songs/SongsView.swift index 7d3aabe8..1f4ac54d 100644 --- a/MedoDelirioBrasilia/Sources/Views/Songs/SongsView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Songs/SongsView.swift @@ -64,7 +64,7 @@ struct SongsView: View { LazyVGrid(columns: columns, spacing: 14) { if searchResults.isEmpty { NoSearchResultsView(searchText: $searchText) - .padding(.vertical, UIScreen.main.bounds.height / 4) + //.padding(.vertical, UIScreen.main.bounds.height / 4) } else { ForEach(searchResults) { song in SongCell(song: song, nowPlaying: $viewModel.nowPlayingKeeper) diff --git a/MedoDelirioBrasilia/Sources/Views/Sounds/SoundCell.swift b/MedoDelirioBrasilia/Sources/Views/Sounds/SoundCell.swift index c53d6cc1..f193073a 100644 --- a/MedoDelirioBrasilia/Sources/Views/Sounds/SoundCell.swift +++ b/MedoDelirioBrasilia/Sources/Views/Sounds/SoundCell.swift @@ -94,11 +94,7 @@ struct SoundCell: View { } private var authorNameLineLimit: Int { - if (UIScreen.main.bounds.width <= 390) && (sound.title.count > 20) { - return 1 - } else { - return 2 - } + return 2 } private var cellHeight: CGFloat { diff --git a/MedoDelirioBrasilia/Sources/Views/Sounds/SoundsView.swift b/MedoDelirioBrasilia/Sources/Views/Sounds/SoundsView.swift index a7ae25b4..b6021ca0 100644 --- a/MedoDelirioBrasilia/Sources/Views/Sounds/SoundsView.swift +++ b/MedoDelirioBrasilia/Sources/Views/Sounds/SoundsView.swift @@ -120,11 +120,12 @@ struct SoundsView: View { var body: some View { ZStack { VStack { - NavigationLink(destination: AuthorDetailView(viewModel: AuthorDetailViewViewModel(originatingScreenName: Shared.ScreenNames.soundsView, - authorName: authorToAutoOpen.name, currentSoundsListMode: $currentSoundsListMode), - author: authorToAutoOpen, - currentSoundsListMode: $currentSoundsListMode), - isActive: $autoOpenAuthor) { EmptyView() } + // TODO: Replace this with a more modern solution since visionOS shows it as a transparent circle on the window. +// NavigationLink(destination: AuthorDetailView(viewModel: AuthorDetailViewViewModel(originatingScreenName: Shared.ScreenNames.soundsView, +// authorName: authorToAutoOpen.name, currentSoundsListMode: $currentSoundsListMode), +// author: authorToAutoOpen, +// currentSoundsListMode: $currentSoundsListMode), +// isActive: $autoOpenAuthor) { EmptyView() } if showNoFavoritesView { NoFavoritesView() @@ -147,7 +148,7 @@ struct SoundsView: View { LazyVGrid(columns: columns, spacing: UIDevice.current.userInterfaceIdiom == .phone ? 14 : 20) { if searchResults.isEmpty { NoSearchResultsView(searchText: $searchText) - .padding(.vertical, UIScreen.main.bounds.height / 4) + //.padding(.vertical, UIScreen.main.bounds.height / 4) } else { ForEach(searchResults) { sound in SoundCell(sound: sound,