diff --git a/pedi-foods/Sources/PediFoods/Components/StoreCard.swift b/pedi-foods/Sources/PediFoods/Components/StoreCard.swift index d5c2e85..0406447 100644 --- a/pedi-foods/Sources/PediFoods/Components/StoreCard.swift +++ b/pedi-foods/Sources/PediFoods/Components/StoreCard.swift @@ -96,18 +96,12 @@ struct FeaturedStoreCard: View { private var storeIconPlaceholder: some View { ZStack { #if os(Android) - AsyncImage(url: Bundle.module.url(forResource: "placeholder-product", withExtension: "png")) { phase in - if let image = phase.image { - image - .resizable() - } else { - Color.clear - } - } - .scaledToFill() - .opacity(0.7) - .frame(maxWidth: .infinity, maxHeight: .infinity) - .clipped() + SwiftUI.Image("placeholder-product") + .resizable() + .scaledToFill() + .opacity(0.7) + .frame(maxWidth: .infinity, maxHeight: .infinity) + .clipped() #else Image("placeholder-product") .resizable() diff --git a/pedi-foods/Sources/PediFoods/Views/Auth/LoginEmailView.swift b/pedi-foods/Sources/PediFoods/Views/Auth/LoginEmailView.swift index 40e96dc..c5e523c 100644 --- a/pedi-foods/Sources/PediFoods/Views/Auth/LoginEmailView.swift +++ b/pedi-foods/Sources/PediFoods/Views/Auth/LoginEmailView.swift @@ -15,14 +15,8 @@ struct LoginEmailView: View { @ViewBuilder private var logoImage: some View { #if os(Android) - AsyncImage(url: Bundle.module.url(forResource: "pedifoods", withExtension: "png")) { phase in - if let image = phase.image { - image - .resizable() - } else { - Color.clear - } - } + SwiftUI.Image("pedifoods") + .resizable() #else SwiftUI.Image("pedifoods") .resizable() diff --git a/pedi-foods/Sources/PediFoods/Views/Auth/LoginView.swift b/pedi-foods/Sources/PediFoods/Views/Auth/LoginView.swift index acfed33..645924e 100644 --- a/pedi-foods/Sources/PediFoods/Views/Auth/LoginView.swift +++ b/pedi-foods/Sources/PediFoods/Views/Auth/LoginView.swift @@ -16,14 +16,8 @@ struct LoginView: View { @ViewBuilder private var logoImage: some View { #if os(Android) - AsyncImage(url: Bundle.module.url(forResource: "pedifoods", withExtension: "png")) { phase in - if let image = phase.image { - image - .resizable() - } else { - Color.clear - } - } + SwiftUI.Image("pedifoods") + .resizable() #else SwiftUI.Image("pedifoods") .resizable() @@ -32,14 +26,8 @@ struct LoginView: View { @ViewBuilder private var pinHeroImage: some View { #if os(Android) - AsyncImage(url: Bundle.module.url(forResource: colorScheme == .dark ? "pin_image_app_dark" : "pin_image_app", withExtension: "png")) { phase in - if let image = phase.image { - image - .resizable() - } else { - Color.clear - } - } + SwiftUI.Image(colorScheme == .dark ? "pin_image_app_dark" : "pin_image_app") + .resizable() #else SwiftUI.Image("pin_image_app") .resizable() @@ -120,15 +108,36 @@ struct LoginView: View { } .ignoresSafeArea() .onAppear { +#if os(Android) + // No Android, rodamos a animação localmente de forma direta + applyHiddenStateWithoutAnimation() + Task { + try? await Task.sleep(nanoseconds: 100_000_000) + withAnimation(.easeOut(duration: 0.5)) { + heroVisible = true + } + try? await Task.sleep(nanoseconds: 150_000_000) + withAnimation(.easeOut(duration: 0.4)) { + textVisible = true + } + try? await Task.sleep(nanoseconds: 150_000_000) + withAnimation(.easeOut(duration: 0.4)) { + buttonVisible = true + } + } +#else if shouldPrepareEntryAnimation { applyHiddenStateWithoutAnimation() } else { showFinalStateWithoutAnimation() } +#endif } +#if os(iOS) .task(id: authEntryAnimationToken) { await runEntryAnimationIfNeeded(for: authEntryAnimationToken) } +#endif } } diff --git a/pedi-foods/Sources/PediFoods/Views/Auth/OtpView.swift b/pedi-foods/Sources/PediFoods/Views/Auth/OtpView.swift index fc44543..7fa4ace 100644 --- a/pedi-foods/Sources/PediFoods/Views/Auth/OtpView.swift +++ b/pedi-foods/Sources/PediFoods/Views/Auth/OtpView.swift @@ -26,17 +26,11 @@ struct OtpView: View { ScrollView { VStack(spacing: 0) { #if os(Android) - AsyncImage(url: Bundle.module.url(forResource: "pedifoods", withExtension: "png")) { phase in - if let image = phase.image { - image - .resizable() - } else { - Color.clear - } - } - .scaledToFit() - .frame(width: 74, height: 74) - .padding(.top, 140) + SwiftUI.Image("pedifoods") + .resizable() + .scaledToFit() + .frame(width: 74, height: 74) + .padding(.top, 140) #else SwiftUI.Image("pedifoods") .resizable() diff --git a/pedi-foods/Sources/PediFoods/Views/Auth/RegistrationView.swift b/pedi-foods/Sources/PediFoods/Views/Auth/RegistrationView.swift index 6057c16..58abc04 100644 --- a/pedi-foods/Sources/PediFoods/Views/Auth/RegistrationView.swift +++ b/pedi-foods/Sources/PediFoods/Views/Auth/RegistrationView.swift @@ -19,14 +19,8 @@ struct RegistrationView: View { @ViewBuilder private var logoImage: some View { #if os(Android) - AsyncImage(url: Bundle.module.url(forResource: "pedifoods", withExtension: "png")) { phase in - if let image = phase.image { - image - .resizable() - } else { - Color.clear - } - } + SwiftUI.Image("pedifoods") + .resizable() #else SwiftUI.Image("pedifoods") .resizable() diff --git a/pedi-foods/Sources/PediFoods/Views/Launch/LaunchSplashView.swift b/pedi-foods/Sources/PediFoods/Views/Launch/LaunchSplashView.swift index 6a6bc29..3b076d1 100644 --- a/pedi-foods/Sources/PediFoods/Views/Launch/LaunchSplashView.swift +++ b/pedi-foods/Sources/PediFoods/Views/Launch/LaunchSplashView.swift @@ -37,14 +37,8 @@ struct LaunchSplashView: View { @ViewBuilder var splashLogo: some View { #if os(Android) - AsyncImage(url: Bundle.module.url(forResource: "pedifoods", withExtension: "png")) { phase in - if let image = phase.image { - image - .resizable() - } else { - Color.clear - } - } + SwiftUI.Image("pedifoods") + .resizable() #else SwiftUI.Image("pedifoods") .resizable() diff --git a/pedi-foods/Sources/PediFoods/Views/Main/AddAddressFormView.swift b/pedi-foods/Sources/PediFoods/Views/Main/AddAddressFormView.swift index 90a360c..95066da 100644 --- a/pedi-foods/Sources/PediFoods/Views/Main/AddAddressFormView.swift +++ b/pedi-foods/Sources/PediFoods/Views/Main/AddAddressFormView.swift @@ -33,14 +33,8 @@ struct AddAddressFormView: View { @ViewBuilder private var logoImage: some View { #if os(Android) - AsyncImage(url: Bundle.module.url(forResource: "pedifoods", withExtension: "png")) { phase in - if let image = phase.image { - image - .resizable() - } else { - Color.clear - } - } + SwiftUI.Image("pedifoods") + .resizable() #else SwiftUI.Image("pedifoods") .resizable() diff --git a/pedi-foods/Sources/PediFoods/Views/Main/OrderTrackingView.swift b/pedi-foods/Sources/PediFoods/Views/Main/OrderTrackingView.swift index 326646d..d4854dc 100644 --- a/pedi-foods/Sources/PediFoods/Views/Main/OrderTrackingView.swift +++ b/pedi-foods/Sources/PediFoods/Views/Main/OrderTrackingView.swift @@ -223,16 +223,10 @@ struct OrderTrackingView: View { Group { if hasTrackingImage { #if os(Android) - AsyncImage(url: Bundle.module.url(forResource: trackingImageName, withExtension: "png")) { phase in - if let image = phase.image { - image - .renderingMode(.original) - .resizable() - } else { - Color.clear - } - } - .scaledToFit() + SwiftUI.Image(trackingImageName) + .renderingMode(.original) + .resizable() + .scaledToFit() #else Image(trackingImageName) .renderingMode(.original) @@ -241,16 +235,10 @@ struct OrderTrackingView: View { #endif } else if hasPlaceholderProductImage { #if os(Android) - AsyncImage(url: Bundle.module.url(forResource: "placeholder-product", withExtension: "png")) { phase in - if let image = phase.image { - image - .renderingMode(.original) - .resizable() - } else { - Color.clear - } - } - .scaledToFit() + SwiftUI.Image("placeholder-product") + .renderingMode(.original) + .resizable() + .scaledToFit() #else Image("placeholder-product") .renderingMode(.original)