diff --git a/ElementX/Sources/FlowCoordinators/AppLockFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/AppLockFlowCoordinator.swift index a13eb2dbb..f82f09ae7 100644 --- a/ElementX/Sources/FlowCoordinators/AppLockFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/AppLockFlowCoordinator.swift @@ -221,7 +221,7 @@ class AppLockFlowCoordinator: CoordinatorProtocol { /// Displays the unlock flow with the app's placeholder view to hide obscure the view hierarchy in the app switcher. private func showPlaceholder() { - navigationCoordinator.setRootCoordinator(PlaceholderScreenCoordinator(hideBrandChrome: appSettings.hideBrandChrome), animated: false) + navigationCoordinator.setRootCoordinator(PlaceholderScreenCoordinator(hideBrandChrome: appSettings.hideBrandChrome, hideGradientBackground: false), animated: false) actionsSubject.send(.lockApp) } diff --git a/ElementX/Sources/Screens/Other/PlaceholderScreenCoordinator.swift b/ElementX/Sources/Screens/Other/PlaceholderScreenCoordinator.swift index 094db241b..e99d385bd 100644 --- a/ElementX/Sources/Screens/Other/PlaceholderScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Other/PlaceholderScreenCoordinator.swift @@ -9,25 +9,28 @@ import SwiftUI class PlaceholderScreenCoordinator: CoordinatorProtocol { private let hideBrandChrome: Bool + private let hideGradientBackground: Bool - init(hideBrandChrome: Bool) { + init(hideBrandChrome: Bool, hideGradientBackground: Bool = true) { self.hideBrandChrome = hideBrandChrome + self.hideGradientBackground = hideBrandChrome || hideGradientBackground } func toPresentable() -> AnyView { - AnyView(PlaceholderScreen(hideBrandChrome: hideBrandChrome)) + AnyView(PlaceholderScreen(hideBrandChrome: hideBrandChrome, hideGradientBackground: hideGradientBackground)) } } /// The screen shown in split view when the detail has no content. struct PlaceholderScreen: View { let hideBrandChrome: Bool + let hideGradientBackground: Bool var body: some View { AuthenticationStartLogo(hideBrandChrome: hideBrandChrome) .frame(maxWidth: .infinity, maxHeight: .infinity) .background { - if !hideBrandChrome { + if !hideGradientBackground { AuthenticationStartScreenBackgroundImage() } } @@ -40,10 +43,13 @@ struct PlaceholderScreen: View { struct PlaceholderScreen_Previews: PreviewProvider, TestablePreview { static var previews: some View { - PlaceholderScreen(hideBrandChrome: false) - .previewDisplayName("With chrome") + PlaceholderScreen(hideBrandChrome: false, hideGradientBackground: false) + .previewDisplayName("With chrome and background") - PlaceholderScreen(hideBrandChrome: true) + PlaceholderScreen(hideBrandChrome: false, hideGradientBackground: true) + .previewDisplayName("With chrome and no background") + + PlaceholderScreen(hideBrandChrome: true, hideGradientBackground: true) .previewDisplayName("Without chrome") NavigationSplitView { @@ -53,7 +59,7 @@ struct PlaceholderScreen_Previews: PreviewProvider, TestablePreview { } } } detail: { - PlaceholderScreen(hideBrandChrome: false) + PlaceholderScreen(hideBrandChrome: false, hideGradientBackground: true) } .previewDisplayName("Split View") .previewInterfaceOrientation(.landscapeLeft) diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-iPad-en-GB.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-background-iPad-en-GB.png similarity index 100% rename from PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-iPad-en-GB.png rename to PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-background-iPad-en-GB.png diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-iPad-pseudo.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-background-iPad-pseudo.png similarity index 100% rename from PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-iPad-pseudo.png rename to PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-background-iPad-pseudo.png diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-iPhone-16-en-GB.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-background-iPhone-16-en-GB.png similarity index 100% rename from PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-iPhone-16-en-GB.png rename to PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-background-iPhone-16-en-GB.png diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-iPhone-16-pseudo.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-background-iPhone-16-pseudo.png similarity index 100% rename from PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-iPhone-16-pseudo.png rename to PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-background-iPhone-16-pseudo.png diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPad-en-GB.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPad-en-GB.png new file mode 100644 index 000000000..d7d93829c --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPad-en-GB.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61f6e4e2777ed816cee39e9a833ecd4e8591f04056bf06da055f402db5048bd2 +size 192719 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPad-pseudo.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPad-pseudo.png new file mode 100644 index 000000000..d7d93829c --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPad-pseudo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61f6e4e2777ed816cee39e9a833ecd4e8591f04056bf06da055f402db5048bd2 +size 192719 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPhone-16-en-GB.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPhone-16-en-GB.png new file mode 100644 index 000000000..14a79011f --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPhone-16-en-GB.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6466a4dabc841afdb8e8fa1075d2a522df2001afd3b0ea38920757693d1a257 +size 131689 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPhone-16-pseudo.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPhone-16-pseudo.png new file mode 100644 index 000000000..14a79011f --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/placeholderScreen.With-chrome-and-no-background-iPhone-16-pseudo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6466a4dabc841afdb8e8fa1075d2a522df2001afd3b0ea38920757693d1a257 +size 131689