fix(android): resolve background image visibility and local flow animations on login
This commit is contained in:
@@ -96,14 +96,8 @@ 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
|
||||
SwiftUI.Image("placeholder-product")
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
.scaledToFill()
|
||||
.opacity(0.7)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
|
||||
@@ -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
|
||||
SwiftUI.Image("pedifoods")
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
#else
|
||||
SwiftUI.Image("pedifoods")
|
||||
.resizable()
|
||||
|
||||
@@ -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
|
||||
SwiftUI.Image("pedifoods")
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
#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
|
||||
SwiftUI.Image(colorScheme == .dark ? "pin_image_app_dark" : "pin_image_app")
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
#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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,14 +26,8 @@ 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
|
||||
SwiftUI.Image("pedifoods")
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
.scaledToFit()
|
||||
.frame(width: 74, height: 74)
|
||||
.padding(.top, 140)
|
||||
|
||||
@@ -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
|
||||
SwiftUI.Image("pedifoods")
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
#else
|
||||
SwiftUI.Image("pedifoods")
|
||||
.resizable()
|
||||
|
||||
@@ -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
|
||||
SwiftUI.Image("pedifoods")
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
#else
|
||||
SwiftUI.Image("pedifoods")
|
||||
.resizable()
|
||||
|
||||
@@ -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
|
||||
SwiftUI.Image("pedifoods")
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
#else
|
||||
SwiftUI.Image("pedifoods")
|
||||
.resizable()
|
||||
|
||||
@@ -223,15 +223,9 @@ 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
|
||||
SwiftUI.Image(trackingImageName)
|
||||
.renderingMode(.original)
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
.scaledToFit()
|
||||
#else
|
||||
Image(trackingImageName)
|
||||
@@ -241,15 +235,9 @@ 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
|
||||
SwiftUI.Image("placeholder-product")
|
||||
.renderingMode(.original)
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
.scaledToFit()
|
||||
#else
|
||||
Image("placeholder-product")
|
||||
|
||||
Reference in New Issue
Block a user