@capgo/capacitor-native-navigation 8.0.9 → 8.0.10
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.
package/README.md
CHANGED
|
@@ -324,7 +324,7 @@ Inline SVG supports the icon-focused subset used by common sets such as Lucide a
|
|
|
324
324
|
|
|
325
325
|
## Platform Notes
|
|
326
326
|
|
|
327
|
-
- iOS uses UIKit `UINavigationBar` and `UITabBar`. iOS 26+
|
|
327
|
+
- iOS uses UIKit `UINavigationBar` and `UITabBar`. iOS 26+ uses Apple's system Liquid Glass with transparent bar appearances and no plugin-supplied background plate; earlier versions use native translucent/material fallback styling.
|
|
328
328
|
- Android uses an AppCompat `Toolbar` and a floating native tab capsule with edge-to-edge placement.
|
|
329
329
|
- Web fallback does not draw native bars; it mirrors inset variables and events for development.
|
|
330
330
|
|
|
Binary file
|
package/docs/demo-options.webp
CHANGED
|
Binary file
|
package/docs/demo-svg-icons.webp
CHANGED
|
Binary file
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import Foundation
|
|
4
4
|
import Capacitor
|
|
5
|
+
import ObjectiveC
|
|
5
6
|
import UIKit
|
|
6
7
|
|
|
7
8
|
private struct NativeNavigationTransitionContext {
|
|
@@ -484,7 +485,16 @@ public class NativeNavigationPlugin: CAPPlugin, CAPBridgedPlugin, UITabBarDelega
|
|
|
484
485
|
container.autoresizingMask = [.flexibleWidth, .flexibleTopMargin]
|
|
485
486
|
container.backgroundColor = .clear
|
|
486
487
|
|
|
487
|
-
if
|
|
488
|
+
if usesSystemLiquidGlass {
|
|
489
|
+
if let effect = liquidGlassEffect() {
|
|
490
|
+
let effectView = UIVisualEffectView(effect: effect)
|
|
491
|
+
effectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
492
|
+
effectView.isUserInteractionEnabled = false
|
|
493
|
+
effectView.backgroundColor = .clear
|
|
494
|
+
container.addSubview(effectView)
|
|
495
|
+
self.tabEffectView = effectView
|
|
496
|
+
}
|
|
497
|
+
} else {
|
|
488
498
|
container.layer.shadowColor = UIColor.black.cgColor
|
|
489
499
|
container.layer.shadowOpacity = 0.14
|
|
490
500
|
container.layer.shadowRadius = 18
|
|
@@ -500,8 +510,10 @@ public class NativeNavigationPlugin: CAPPlugin, CAPBridgedPlugin, UITabBarDelega
|
|
|
500
510
|
|
|
501
511
|
let bar = UITabBar()
|
|
502
512
|
bar.isTranslucent = true
|
|
503
|
-
|
|
504
|
-
|
|
513
|
+
bar.backgroundColor = .clear
|
|
514
|
+
if usesSystemLiquidGlass {
|
|
515
|
+
bar.isOpaque = false
|
|
516
|
+
} else {
|
|
505
517
|
bar.backgroundImage = UIImage()
|
|
506
518
|
bar.shadowImage = UIImage()
|
|
507
519
|
bar.clipsToBounds = true
|
|
@@ -793,8 +805,12 @@ public class NativeNavigationPlugin: CAPPlugin, CAPBridgedPlugin, UITabBarDelega
|
|
|
793
805
|
|
|
794
806
|
private func configureTabBarBackground(_ appearance: UITabBarAppearance, options call: CAPPluginCall) {
|
|
795
807
|
if usesSystemLiquidGlass {
|
|
796
|
-
appearance.
|
|
797
|
-
|
|
808
|
+
appearance.configureWithTransparentBackground()
|
|
809
|
+
appearance.backgroundColor = .clear
|
|
810
|
+
appearance.backgroundEffect = nil
|
|
811
|
+
appearance.shadowColor = .clear
|
|
812
|
+
tabEffectView?.effect = liquidGlassEffect()
|
|
813
|
+
tabEffectView?.isHidden = tabEffectView?.effect == nil
|
|
798
814
|
} else {
|
|
799
815
|
appearance.configureWithDefaultBackground()
|
|
800
816
|
if let effect = blurEffect(from: call.getString("blurEffect"), fallback: nil) {
|
|
@@ -898,7 +914,7 @@ public class NativeNavigationPlugin: CAPPlugin, CAPBridgedPlugin, UITabBarDelega
|
|
|
898
914
|
container.layer.cornerRadius = 0
|
|
899
915
|
container.layer.shadowOpacity = 0
|
|
900
916
|
container.layer.shadowPath = nil
|
|
901
|
-
tabEffectView?.
|
|
917
|
+
tabEffectView?.frame = container.bounds
|
|
902
918
|
tabBar?.frame = container.bounds
|
|
903
919
|
tabBar?.layer.cornerRadius = 0
|
|
904
920
|
} else {
|
|
@@ -957,6 +973,23 @@ public class NativeNavigationPlugin: CAPPlugin, CAPBridgedPlugin, UITabBarDelega
|
|
|
957
973
|
return UIBlurEffect(style: style)
|
|
958
974
|
}
|
|
959
975
|
|
|
976
|
+
private func liquidGlassEffect() -> UIVisualEffect? {
|
|
977
|
+
guard usesSystemLiquidGlass,
|
|
978
|
+
let effectClass = NSClassFromString("UIGlassEffect") else {
|
|
979
|
+
return nil
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
let selector = NSSelectorFromString("effectWithStyle:")
|
|
983
|
+
guard let method = class_getClassMethod(effectClass, selector) else {
|
|
984
|
+
return nil
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
typealias EffectWithStyle = @convention(c) (AnyClass, Selector, Int) -> AnyObject?
|
|
988
|
+
let implementation = method_getImplementation(method)
|
|
989
|
+
let factory = unsafeBitCast(implementation, to: EffectWithStyle.self)
|
|
990
|
+
return factory(effectClass, selector, 0) as? UIVisualEffect
|
|
991
|
+
}
|
|
992
|
+
|
|
960
993
|
private func blurStyle(from value: String?) -> UIBlurEffect.Style? {
|
|
961
994
|
guard let value = value else {
|
|
962
995
|
return nil
|
package/package.json
CHANGED