@capgo/capacitor-inappbrowser 8.7.0-beta.pr596.340.1 → 8.7.0-beta.pr598.346.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.
|
@@ -190,16 +190,11 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
private func dismissNavigationControllerIfPresented(_ navigationController: UINavigationController
|
|
194
|
-
guard let navigationController else {
|
|
195
|
-
completion?()
|
|
196
|
-
return
|
|
197
|
-
}
|
|
198
|
-
guard navigationController.presentingViewController != nil else {
|
|
199
|
-
completion?()
|
|
193
|
+
private func dismissNavigationControllerIfPresented(_ navigationController: UINavigationController?) {
|
|
194
|
+
guard let navigationController, navigationController.presentingViewController != nil else {
|
|
200
195
|
return
|
|
201
196
|
}
|
|
202
|
-
navigationController.dismiss(animated: false
|
|
197
|
+
navigationController.dismiss(animated: false)
|
|
203
198
|
}
|
|
204
199
|
|
|
205
200
|
private func unregisterWebView(id: String) {
|
|
@@ -451,6 +446,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
451
446
|
}
|
|
452
447
|
|
|
453
448
|
dismissActiveKeyboard()
|
|
449
|
+
dismissNavigationControllerIfPresented(navigationController)
|
|
454
450
|
navigationController.view.removeFromSuperview()
|
|
455
451
|
if transparentBackground {
|
|
456
452
|
makeHostWebViewTransparent(for: id)
|
|
@@ -1606,16 +1602,14 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
1606
1602
|
}
|
|
1607
1603
|
|
|
1608
1604
|
let transparentBackground = call.getBool("transparentBackground", true)
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
return
|
|
1615
|
-
}
|
|
1616
|
-
self.setActiveWebView(id: resolvedId, webView: webViewController, navigationController: navigationController)
|
|
1617
|
-
call.resolve()
|
|
1605
|
+
webViewController.isLayeredBehind = true
|
|
1606
|
+
webViewController.transparentHostBackground = transparentBackground
|
|
1607
|
+
guard self.sendNavigationControllerToBack(id: resolvedId, transparentBackground: transparentBackground) else {
|
|
1608
|
+
call.reject("Failed to send webview to back")
|
|
1609
|
+
return
|
|
1618
1610
|
}
|
|
1611
|
+
self.setActiveWebView(id: resolvedId, webView: webViewController, navigationController: navigationController)
|
|
1612
|
+
call.resolve()
|
|
1619
1613
|
}
|
|
1620
1614
|
}
|
|
1621
1615
|
|
|
@@ -756,40 +756,62 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
|
|
|
756
756
|
return windowScene?.statusBarManager?.statusBarFrame.height ?? 0
|
|
757
757
|
}
|
|
758
758
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
759
|
+
private func applyNavigationBarBackground(color: UIColor) {
|
|
760
|
+
guard let navigationBar = navigationController?.navigationBar else {
|
|
761
|
+
return
|
|
762
|
+
}
|
|
763
763
|
|
|
764
|
-
|
|
765
|
-
|
|
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")
|
|
766
770
|
|
|
767
|
-
if
|
|
768
|
-
|
|
769
|
-
|
|
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()
|
|
771
778
|
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
779
|
+
if let titleTextAttributes = navigationBar.titleTextAttributes {
|
|
780
|
+
appearance.titleTextAttributes = titleTextAttributes
|
|
781
|
+
}
|
|
782
|
+
if let largeTitleTextAttributes = navigationBar.largeTitleTextAttributes {
|
|
783
|
+
appearance.largeTitleTextAttributes = largeTitleTextAttributes
|
|
784
|
+
}
|
|
775
785
|
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
])
|
|
786
|
+
navigationBar.standardAppearance = appearance
|
|
787
|
+
navigationBar.compactAppearance = appearance
|
|
788
|
+
navigationBar.scrollEdgeAppearance = appearance
|
|
789
|
+
navigationBar.compactScrollEdgeAppearance = appearance
|
|
790
|
+
}
|
|
791
|
+
}
|
|
783
792
|
|
|
784
|
-
|
|
785
|
-
|
|
793
|
+
// Make status bar background with colored view underneath
|
|
794
|
+
open func setupStatusBarBackground(color: UIColor) {
|
|
795
|
+
statusBarBackgroundView?.removeFromSuperview()
|
|
796
|
+
statusBarBackgroundView = UIView()
|
|
786
797
|
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
navigationController?.navigationBar.isTranslucent = true
|
|
798
|
+
guard let navController = navigationController,
|
|
799
|
+
let navView = navController.view,
|
|
800
|
+
let statusBarBackgroundView else {
|
|
801
|
+
return
|
|
792
802
|
}
|
|
803
|
+
navView.insertSubview(statusBarBackgroundView, at: 0)
|
|
804
|
+
statusBarBackgroundView.translatesAutoresizingMaskIntoConstraints = false
|
|
805
|
+
statusBarBackgroundView.backgroundColor = color
|
|
806
|
+
|
|
807
|
+
NSLayoutConstraint.activate([
|
|
808
|
+
statusBarBackgroundView.topAnchor.constraint(equalTo: navView.topAnchor),
|
|
809
|
+
statusBarBackgroundView.leadingAnchor.constraint(equalTo: navView.leadingAnchor),
|
|
810
|
+
statusBarBackgroundView.trailingAnchor.constraint(equalTo: navView.trailingAnchor),
|
|
811
|
+
statusBarBackgroundView.bottomAnchor.constraint(equalTo: navController.navigationBar.bottomAnchor, constant: 1)
|
|
812
|
+
])
|
|
813
|
+
|
|
814
|
+
applyNavigationBarBackground(color: color)
|
|
793
815
|
}
|
|
794
816
|
|
|
795
817
|
// Override to use our custom status bar style
|
package/package.json
CHANGED