@capgo/capacitor-inappbrowser 8.7.0-beta.pr598.351.1 → 8.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -98,7 +98,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
98
98
|
case aware = "AWARE"
|
|
99
99
|
case fakeVisible = "FAKE_VISIBLE"
|
|
100
100
|
}
|
|
101
|
-
private let pluginVersion: String = "8.7.
|
|
101
|
+
private let pluginVersion: String = "8.7.1"
|
|
102
102
|
public let identifier = "CapgoInAppBrowserPlugin"
|
|
103
103
|
public let jsName = "CapgoInAppBrowser"
|
|
104
104
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -756,62 +756,40 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
|
|
|
756
756
|
return windowScene?.statusBarManager?.statusBarFrame.height ?? 0
|
|
757
757
|
}
|
|
758
758
|
|
|
759
|
-
private func applyNavigationBarBackground(color: UIColor) {
|
|
760
|
-
guard let navigationBar = navigationController?.navigationBar else {
|
|
761
|
-
return
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
navigationBar.backgroundColor = color
|
|
765
|
-
navigationBar.barTintColor = color
|
|
766
|
-
navigationBar.isTranslucent = false
|
|
767
|
-
navigationBar.setBackgroundImage(UIImage(), for: .default)
|
|
768
|
-
navigationBar.shadowImage = UIImage()
|
|
769
|
-
navigationBar.setValue(true, forKey: "hidesShadow")
|
|
770
|
-
|
|
771
|
-
if #available(iOS 13.0, *) {
|
|
772
|
-
let appearance = UINavigationBarAppearance()
|
|
773
|
-
appearance.configureWithOpaqueBackground()
|
|
774
|
-
appearance.backgroundColor = color
|
|
775
|
-
appearance.backgroundEffect = nil
|
|
776
|
-
appearance.shadowColor = .clear
|
|
777
|
-
appearance.shadowImage = UIImage()
|
|
778
|
-
|
|
779
|
-
if let titleTextAttributes = navigationBar.titleTextAttributes {
|
|
780
|
-
appearance.titleTextAttributes = titleTextAttributes
|
|
781
|
-
}
|
|
782
|
-
if let largeTitleTextAttributes = navigationBar.largeTitleTextAttributes {
|
|
783
|
-
appearance.largeTitleTextAttributes = largeTitleTextAttributes
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
navigationBar.standardAppearance = appearance
|
|
787
|
-
navigationBar.compactAppearance = appearance
|
|
788
|
-
navigationBar.scrollEdgeAppearance = appearance
|
|
789
|
-
navigationBar.compactScrollEdgeAppearance = appearance
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
|
|
793
759
|
// Make status bar background with colored view underneath
|
|
794
760
|
open func setupStatusBarBackground(color: UIColor) {
|
|
761
|
+
// Remove any existing status bar view
|
|
795
762
|
statusBarBackgroundView?.removeFromSuperview()
|
|
763
|
+
|
|
764
|
+
// Create a new view to cover both status bar and navigation bar
|
|
796
765
|
statusBarBackgroundView = UIView()
|
|
797
766
|
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}
|
|
803
|
-
navView.insertSubview(statusBarBackgroundView, at: 0)
|
|
804
|
-
statusBarBackgroundView.translatesAutoresizingMaskIntoConstraints = false
|
|
805
|
-
statusBarBackgroundView.backgroundColor = color
|
|
767
|
+
if let navView = navigationController?.view {
|
|
768
|
+
// Add to back of view hierarchy
|
|
769
|
+
navView.insertSubview(statusBarBackgroundView!, at: 0)
|
|
770
|
+
statusBarBackgroundView?.translatesAutoresizingMaskIntoConstraints = false
|
|
806
771
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
772
|
+
// Calculate total height - status bar + navigation bar
|
|
773
|
+
let navBarHeight = navigationController?.navigationBar.frame.height ?? 44
|
|
774
|
+
let totalHeight = (navigationController?.view.safeAreaInsets.top ?? CGFloat(0)) + navBarHeight
|
|
775
|
+
|
|
776
|
+
// Position from top of screen to bottom of navigation bar
|
|
777
|
+
NSLayoutConstraint.activate([
|
|
778
|
+
statusBarBackgroundView!.topAnchor.constraint(equalTo: navView.topAnchor),
|
|
779
|
+
statusBarBackgroundView!.leadingAnchor.constraint(equalTo: navView.leadingAnchor),
|
|
780
|
+
statusBarBackgroundView!.trailingAnchor.constraint(equalTo: navView.trailingAnchor),
|
|
781
|
+
statusBarBackgroundView!.heightAnchor.constraint(equalToConstant: totalHeight)
|
|
782
|
+
])
|
|
813
783
|
|
|
814
|
-
|
|
784
|
+
// Set background color
|
|
785
|
+
statusBarBackgroundView?.backgroundColor = color
|
|
786
|
+
|
|
787
|
+
// Make navigation bar transparent to show our view underneath
|
|
788
|
+
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
|
789
|
+
navigationController?.navigationBar.shadowImage = UIImage()
|
|
790
|
+
navigationController?.navigationBar.isTranslucent = true
|
|
791
|
+
navigationController?.navigationBar.isTranslucent = true
|
|
792
|
+
}
|
|
815
793
|
}
|
|
816
794
|
|
|
817
795
|
// Override to use our custom status bar style
|