From 4d6c54da121f672354433a4717a431c4e9a27450 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Mon, 21 Mar 2022 08:44:47 -0700 Subject: [PATCH] show overlay while web view loads --- .../Sources/App/Views/WebReader/WebReader.swift | 16 ++++++++++++++++ .../OmnivoreKit/Sources/Utils/FeatureFlags.swift | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift index ccc9fbe91..37d8cf416 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift @@ -44,6 +44,7 @@ struct WebReaderContainerView: View { @State var safariWebLink: SafariWebLink? @State private var navBarVisibilityRatio = 1.0 @State private var showDeleteConfirmation = false + @State private var showOverlay = true @State var increaseFontActionID: UUID? @State var decreaseFontActionID: UUID? @@ -172,6 +173,21 @@ struct WebReaderContainerView: View { decreaseFontActionID: $decreaseFontActionID, annotationSaveTransactionID: nil ) + .overlay( + Group { + if showOverlay { + Color.systemBackground + .transition(.opacity) + .onAppear { + DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(250)) { + withAnimation(.linear(duration: 0.2)) { + showOverlay = false + } + } + } + } + } + ) } else { Color.clear .contentShape(Rectangle()) diff --git a/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift b/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift index 3c1597265..a06f1d9e8 100644 --- a/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift +++ b/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift @@ -15,5 +15,5 @@ public enum FeatureFlag { public static let enableShareButton = false public static let enableSnooze = false public static let showFeedItemTags = false - public static let useLocalWebView = false + public static let useLocalWebView = true }