react-native-navigation 8.7.5-snapshot.2330 → 8.7.5-snapshot.2337

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.
@@ -7,6 +7,11 @@
7
7
  #pragma mark - public
8
8
 
9
9
  - (void)applyBackgroundColor:(UIColor *)backgroundColor translucent:(BOOL)translucent {
10
+ if (@available(iOS 26.0, *)) {
11
+ [self setTabBarTransparentBackground];
12
+ self.tabBar.backgroundColor = UIColor.clearColor;
13
+ return;
14
+ }
10
15
  if (translucent)
11
16
  [self setTabBarTranslucent:YES];
12
17
  else if (backgroundColor.isTransparent)
@@ -19,26 +24,33 @@
19
24
 
20
25
  - (void)applyTabBarBorder:(RNNBottomTabsOptions *)options {
21
26
  if (options.borderColor.hasValue || options.borderWidth.hasValue) {
22
- for (UIViewController *childViewController in self.tabBarController.childViewControllers)
23
- childViewController.tabBarItem.standardAppearance.shadowImage = [UIImage
24
- imageWithSize:CGSizeMake(1.0, [[options.borderWidth withDefault:@(0.1)] floatValue])
25
- color:[options.borderColor withDefault:UIColor.blackColor]];
27
+ UIImage *borderImage = [UIImage
28
+ imageWithSize:CGSizeMake(1.0, [[options.borderWidth withDefault:@(0.1)] floatValue])
29
+ color:[options.borderColor withDefault:UIColor.blackColor]];
30
+
31
+ for (UIViewController *childViewController in self.tabBarController.childViewControllers) {
32
+ childViewController.tabBarItem.standardAppearance.shadowImage = borderImage;
33
+ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
34
+ if (@available(iOS 15.0, *)) {
35
+ childViewController.tabBarItem.scrollEdgeAppearance.shadowImage = borderImage;
36
+ }
37
+ #endif
38
+ }
26
39
  }
27
40
  }
28
41
 
29
42
  - (void)setTabBarBackgroundColor:(UIColor *)backgroundColor {
30
- [self setTabBarOpaqueBackground];
31
- for (UIViewController *childViewController in self.tabBarController.childViewControllers) {
32
- childViewController.tabBarItem.standardAppearance.backgroundColor = backgroundColor;
33
- #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
34
- if (@available(iOS 15.0, *)) {
35
- childViewController.tabBarItem.scrollEdgeAppearance.backgroundColor = backgroundColor;
36
- }
37
- #endif
43
+ UITabBarAppearance *appearance = [self appearanceWithColor:backgroundColor];
44
+ [self applyTabBarAppearance:appearance];
45
+ self.tabBar.barTintColor = backgroundColor;
46
+ self.tabBar.translucent = NO;
47
+ if (@available(iOS 26.0, *)) {
48
+ self.tabBar.backgroundColor = backgroundColor;
38
49
  }
39
50
  }
40
51
 
41
52
  - (void)setTabBarTranslucent:(BOOL)translucent {
53
+ self.tabBar.translucent = translucent;
42
54
  if (translucent)
43
55
  [self setTabBarTranslucentBackground];
44
56
  else
@@ -48,38 +60,63 @@
48
60
  #pragma mark - private
49
61
 
50
62
  - (void)setTabBarDefaultBackground {
51
- [self setTabBarOpaqueBackground];
63
+ if (@available(iOS 26.0, *)) {
64
+ [self setTabBarTransparentBackground];
65
+ self.tabBar.backgroundColor = UIColor.clearColor;
66
+ } else {
67
+ [self setTabBarOpaqueBackground];
68
+ }
52
69
  }
53
70
 
54
71
  - (void)setTabBarTranslucentBackground {
55
- for (UIViewController *childViewController in self.tabBarController.childViewControllers) {
56
- [childViewController.tabBarItem.standardAppearance configureWithDefaultBackground];
57
- #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
58
- if (@available(iOS 15.0, *)) {
59
- [childViewController.tabBarItem.scrollEdgeAppearance configureWithDefaultBackground];
60
- }
61
- #endif
62
- }
72
+ UITabBarAppearance *appearance = [UITabBarAppearance new];
73
+ [appearance configureWithDefaultBackground];
74
+ [self applyTabBarAppearance:appearance];
75
+ self.tabBar.barTintColor = nil;
63
76
  }
64
77
 
65
78
  - (void)setTabBarTransparentBackground {
66
- for (UIViewController *childViewController in self.tabBarController.childViewControllers) {
67
- [childViewController.tabBarItem.standardAppearance configureWithTransparentBackground];
68
- #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
69
- if (@available(iOS 15.0, *)) {
70
- [childViewController.tabBarItem
71
- .scrollEdgeAppearance configureWithTransparentBackground];
72
- }
73
- #endif
74
- }
79
+ UITabBarAppearance *appearance = [UITabBarAppearance new];
80
+ [appearance configureWithTransparentBackground];
81
+ appearance.backgroundEffect = nil;
82
+ appearance.backgroundColor = UIColor.clearColor;
83
+ [self applyTabBarAppearance:appearance];
84
+ self.tabBar.barTintColor = UIColor.clearColor;
75
85
  }
76
86
 
77
87
  - (void)setTabBarOpaqueBackground {
88
+ UITabBarAppearance *appearance = [self appearanceWithColor:nil];
89
+ [self applyTabBarAppearance:appearance];
90
+ self.tabBar.barTintColor = UIColor.systemBackgroundColor;
91
+ self.tabBar.translucent = NO;
92
+ }
93
+
94
+ #pragma mark - helpers
95
+
96
+ - (UITabBarAppearance *)appearanceWithColor:(UIColor *)color {
97
+ UITabBarAppearance *appearance = [UITabBarAppearance new];
98
+ [appearance configureWithOpaqueBackground];
99
+ appearance.backgroundEffect = nil;
100
+ appearance.shadowColor = nil;
101
+ UIColor *resolvedColor = color ?: UIColor.systemBackgroundColor;
102
+ appearance.backgroundColor = resolvedColor;
103
+ appearance.backgroundImage = [UIImage imageWithSize:CGSizeMake(1, 1) color:resolvedColor];
104
+ return appearance;
105
+ }
106
+
107
+ - (void)applyTabBarAppearance:(UITabBarAppearance *)appearance {
108
+ self.tabBar.standardAppearance = appearance;
109
+ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
110
+ if (@available(iOS 15.0, *)) {
111
+ self.tabBar.scrollEdgeAppearance = [appearance copy];
112
+ }
113
+ #endif
114
+
78
115
  for (UIViewController *childViewController in self.tabBarController.childViewControllers) {
79
- [childViewController.tabBarItem.standardAppearance configureWithOpaqueBackground];
116
+ childViewController.tabBarItem.standardAppearance = [appearance copy];
80
117
  #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
81
118
  if (@available(iOS 15.0, *)) {
82
- [childViewController.tabBarItem.scrollEdgeAppearance configureWithOpaqueBackground];
119
+ childViewController.tabBarItem.scrollEdgeAppearance = [appearance copy];
83
120
  }
84
121
  #endif
85
122
  }
@@ -27,11 +27,12 @@
27
27
  [bottomTabs setTabBarVisible:[withDefault.bottomTabs.visible withDefault:YES]];
28
28
 
29
29
  [bottomTabs.view setBackgroundColor:[withDefault.layout.backgroundColor withDefault:nil]];
30
+ [bottomTabs setTabBarHideShadow:[withDefault.bottomTabs.hideShadow withDefault:NO]];
31
+ if (options.bottomTabs.barStyle.hasValue) {
32
+ [bottomTabs setTabBarStyle:[RNNConvert UIBarStyle:options.bottomTabs.barStyle.get]];
33
+ }
30
34
  [self applyBackgroundColor:[withDefault.bottomTabs.backgroundColor withDefault:nil]
31
35
  translucent:[withDefault.bottomTabs.translucent withDefault:NO]];
32
- [bottomTabs setTabBarHideShadow:[withDefault.bottomTabs.hideShadow withDefault:NO]];
33
- [bottomTabs setTabBarStyle:[RNNConvert UIBarStyle:[withDefault.bottomTabs.barStyle
34
- withDefault:@"default"]]];
35
36
  [self applyTabBarBorder:withDefault.bottomTabs];
36
37
  [self applyTabBarShadow:withDefault.bottomTabs.shadow];
37
38
  }
@@ -65,7 +66,7 @@
65
66
  }
66
67
 
67
68
  if (mergeOptions.bottomTabs.translucent.hasValue) {
68
- [bottomTabs setTabBarTranslucent:mergeOptions.bottomTabs.translucent.get];
69
+ [self setTabBarTranslucent:mergeOptions.bottomTabs.translucent.get];
69
70
  }
70
71
 
71
72
  if (mergeOptions.bottomTabs.hideShadow.hasValue) {
@@ -48,14 +48,27 @@
48
48
  eventEmitter:eventEmitter
49
49
  childViewControllers:childViewControllers];
50
50
 
51
- if (@available(iOS 13.0, *)) {
52
- self.tabBar.standardAppearance = [UITabBarAppearance new];
53
- }
51
+ if (@available(iOS 26.0, *)) {
52
+ UITabBarAppearance *appearance = [UITabBarAppearance new];
53
+ [appearance configureWithTransparentBackground];
54
+ appearance.backgroundEffect = nil;
55
+ appearance.backgroundColor = UIColor.clearColor;
56
+ self.tabBar.standardAppearance = appearance;
57
+ self.tabBar.scrollEdgeAppearance = [appearance copy];
58
+ self.tabBar.barTintColor = UIColor.clearColor;
59
+ } else if (@available(iOS 13.0, *)) {
60
+ UITabBarAppearance *appearance = [UITabBarAppearance new];
61
+ [appearance configureWithOpaqueBackground];
62
+ appearance.backgroundEffect = nil;
63
+ appearance.backgroundColor = UIColor.systemBackgroundColor;
64
+ self.tabBar.standardAppearance = appearance;
54
65
  #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
55
- if (@available(iOS 15.0, *)) {
56
- self.tabBar.scrollEdgeAppearance = [UITabBarAppearance new];
57
- }
66
+ if (@available(iOS 15.0, *)) {
67
+ self.tabBar.scrollEdgeAppearance = [appearance copy];
68
+ }
58
69
  #endif
70
+ self.tabBar.translucent = NO;
71
+ }
59
72
 
60
73
  [self createTabBarItems:childViewControllers];
61
74
 
@@ -72,7 +72,11 @@
72
72
  }
73
73
 
74
74
  - (BOOL)shouldDrawBehind {
75
- return [self.drawBehind withDefault:NO] || [self.translucent withDefault:NO] ||
75
+ BOOL defaultDrawBehind = NO;
76
+ if (@available(iOS 26.0, *)) {
77
+ defaultDrawBehind = YES;
78
+ }
79
+ return [self.drawBehind withDefault:defaultDrawBehind] || [self.translucent withDefault:NO] ||
76
80
  ![self.visible withDefault:YES];
77
81
  }
78
82
 
@@ -91,6 +91,7 @@
91
91
  }];
92
92
  self.reactView.backgroundColor = UIColor.clearColor;
93
93
  self.reactView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
94
+ self.reactView.clipsToBounds = YES;
94
95
  [self.reactView setFrame:self.view.frame];
95
96
  [self.view addSubview:self.reactView];
96
97
  [self updateReactViewFrame];
@@ -118,14 +119,15 @@
118
119
  if (self.isViewLoaded && self.reactView) {
119
120
  CGFloat bottomInset = self.shouldDrawBehindBottomTabs ? 0 : self.view.safeAreaInsets.bottom;
120
121
  CGFloat topInset = self.shouldDrawBehindTopBar ? 0 : self.view.safeAreaInsets.top;
122
+
121
123
  [self.reactView setFrame:CGRectMake(0, topInset, self.view.frame.size.width,
122
124
  self.view.frame.size.height - topInset - bottomInset)];
123
125
  }
124
126
  }
125
127
 
126
128
  - (BOOL)shouldDrawBehindBottomTabs {
127
- return (!self.tabBarController.tabBar || self.tabBarController.tabBar.isHidden ||
128
- _drawBehindBottomTabs);
129
+ return !self.tabBarController.tabBar || self.tabBarController.tabBar.isHidden ||
130
+ _drawBehindBottomTabs;
129
131
  }
130
132
 
131
133
  - (BOOL)shouldDrawBehindTopBar {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "8.7.5-snapshot.2330",
3
+ "version": "8.7.5-snapshot.2337",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,