mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:02:10 +00:00
Add missing gradient to lock screen placeholder. (#1991)
This commit is contained in:
@@ -118,7 +118,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(), animated: false)
|
||||
navigationCoordinator.setRootCoordinator(PlaceholderScreenCoordinator(showsBackgroundGradient: true), animated: false)
|
||||
actionsSubject.send(.lockApp)
|
||||
}
|
||||
|
||||
|
||||
@@ -17,16 +17,29 @@
|
||||
import SwiftUI
|
||||
|
||||
class PlaceholderScreenCoordinator: CoordinatorProtocol {
|
||||
private let showsBackgroundGradient: Bool
|
||||
|
||||
init(showsBackgroundGradient: Bool = false) {
|
||||
self.showsBackgroundGradient = showsBackgroundGradient
|
||||
}
|
||||
|
||||
func toPresentable() -> AnyView {
|
||||
AnyView(PlaceholderScreen())
|
||||
AnyView(PlaceholderScreen(showsBackgroundGradient: showsBackgroundGradient))
|
||||
}
|
||||
}
|
||||
|
||||
/// The screen shown in split view when the detail has no content.
|
||||
struct PlaceholderScreen: View {
|
||||
let showsBackgroundGradient: Bool
|
||||
|
||||
var body: some View {
|
||||
OnboardingLogo(isOnGradient: false)
|
||||
OnboardingLogo(isOnGradient: showsBackgroundGradient)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background {
|
||||
if showsBackgroundGradient {
|
||||
OnboardingScreenBackgroundImage()
|
||||
}
|
||||
}
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.ignoresSafeArea(edges: .top)
|
||||
@@ -35,9 +48,12 @@ struct PlaceholderScreen: View {
|
||||
|
||||
struct PlaceholderScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static var previews: some View {
|
||||
PlaceholderScreen()
|
||||
PlaceholderScreen(showsBackgroundGradient: false)
|
||||
.previewDisplayName("Screen")
|
||||
|
||||
PlaceholderScreen(showsBackgroundGradient: true)
|
||||
.previewDisplayName("With background")
|
||||
|
||||
NavigationSplitView {
|
||||
List {
|
||||
ForEach("Nothing to see here".split(separator: " "), id: \.self) { word in
|
||||
@@ -45,7 +61,7 @@ struct PlaceholderScreen_Previews: PreviewProvider, TestablePreview {
|
||||
}
|
||||
}
|
||||
} detail: {
|
||||
PlaceholderScreen()
|
||||
PlaceholderScreen(showsBackgroundGradient: false)
|
||||
}
|
||||
.previewDisplayName("Split View")
|
||||
.previewInterfaceOrientation(.landscapeLeft)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3ef95f8bd9bac10ef7d41dc421fffa2a207de434f2e3bc0fffe01da099445fe6
|
||||
size 1002179
|
||||
Reference in New Issue
Block a user