react-native-navigation 7.33.3-snapshot.991 → 7.33.3-snapshot.992

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.
@@ -18,7 +18,7 @@
18
18
 
19
19
  - (UIImage *)createEnabledIcon:(RNNButtonOptions *)buttonOptions {
20
20
  UIColor *backgroundColor = [buttonOptions.iconBackground.color withDefault:UIColor.clearColor];
21
- UIColor *tintColor = [buttonOptions.color withDefault:nil];
21
+ UIColor *tintColor = buttonOptions.resolveColor;
22
22
 
23
23
  return [self createIcon:buttonOptions tintColor:tintColor backgroundColor:backgroundColor];
24
24
  }
@@ -22,10 +22,11 @@
22
22
  @property(nonatomic, strong) Bool *selectTabOnPress;
23
23
  @property(nonatomic, strong) RNNComponentOptions *component;
24
24
  @property(nonatomic, strong) RNNIconBackgroundOptions *iconBackground;
25
+ @property(nonatomic, strong) Bool *disableIconTint;
25
26
 
26
27
  - (RNNButtonOptions *)withDefault:(RNNButtonOptions *)defaultOptions;
27
28
 
28
- - (Color *)resolveColor;
29
+ - (UIColor *)resolveColor;
29
30
 
30
31
  - (RNNButtonOptions *)withDefaultColor:(Color *)color disabledColor:(Color *)disabledColor;
31
32
 
@@ -1,4 +1,5 @@
1
1
  #import "RNNButtonOptions.h"
2
+ #import "NullColor.h"
2
3
 
3
4
  @implementation RNNButtonOptions
4
5
 
@@ -23,6 +24,7 @@
23
24
  self.iconBackground = [[RNNIconBackgroundOptions alloc] initWithDict:dict[@"iconBackground"]
24
25
  enabled:self.enabled];
25
26
  self.systemItem = [TextParser parse:dict key:@"systemItem"];
27
+ self.disableIconTint = [BoolParser parse:dict key:@"disableIconTint"];
26
28
 
27
29
  return self;
28
30
  }
@@ -46,6 +48,7 @@
46
48
  newOptions.selectTabOnPress = self.selectTabOnPress.copy;
47
49
  newOptions.iconBackground = self.iconBackground.copy;
48
50
  newOptions.systemItem = self.systemItem.copy;
51
+ newOptions.disableIconTint = self.disableIconTint.copy;
49
52
  return newOptions;
50
53
  }
51
54
 
@@ -83,6 +86,8 @@
83
86
  self.selectTabOnPress = options.selectTabOnPress;
84
87
  if (options.systemItem.hasValue)
85
88
  self.systemItem = options.systemItem;
89
+ if (options.disableIconTint.hasValue)
90
+ self.disableIconTint = options.disableIconTint;
86
91
  }
87
92
 
88
93
  - (BOOL)shouldCreateCustomView {
@@ -93,11 +98,13 @@
93
98
  return [self.enabled withDefault:YES];
94
99
  }
95
100
 
96
- - (Color *)resolveColor {
101
+ - (UIColor *)resolveColor {
102
+ if ([_disableIconTint withDefault:NO])
103
+ return NullColor.new.get;
97
104
  if (![_enabled withDefault:YES] && _disabledColor.hasValue)
98
- return _disabledColor;
105
+ return _disabledColor.get;
99
106
  else
100
- return _color;
107
+ return [_color withDefault:nil];
101
108
  }
102
109
 
103
110
  - (RNNButtonOptions *)withDefault:(RNNButtonOptions *)defaultOptions {
@@ -139,17 +139,16 @@
139
139
  [self applyDisabledTitleTextAttributes:buttonOptions];
140
140
  }
141
141
 
142
- - (void)applyColor:(Color *)color {
143
- if (color.hasValue) {
142
+ - (void)applyColor:(UIColor *)color {
143
+ if (color) {
144
144
  NSMutableDictionary *titleTextAttributes = [NSMutableDictionary
145
145
  dictionaryWithDictionary:[self titleTextAttributesForState:UIControlStateNormal]];
146
- [titleTextAttributes setValue:color.get forKey:NSForegroundColorAttributeName];
146
+ [titleTextAttributes setValue:color forKey:NSForegroundColorAttributeName];
147
147
  [self setTitleTextAttributes:titleTextAttributes forState:UIControlStateNormal];
148
148
  [self setTitleTextAttributes:titleTextAttributes forState:UIControlStateHighlighted];
149
+ self.tintColor = color;
149
150
  } else
150
151
  self.image = [self.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
151
-
152
- self.tintColor = color.get;
153
152
  }
154
153
 
155
154
  - (void)mergeBackgroundColor:(Color *)color {
@@ -159,7 +158,7 @@
159
158
 
160
159
  - (void)mergeColor:(Color *)color {
161
160
  _buttonOptions.color = color;
162
- [self applyColor:color];
161
+ [self applyColor:color.get];
163
162
  [self redrawIcon];
164
163
  }
165
164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "7.33.3-snapshot.991",
3
+ "version": "7.33.3-snapshot.992",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,