hybrid-navigation 2.12.2-rc.3 → 2.12.4

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.
@@ -38,6 +38,7 @@ public class HBDEventEmitter extends ReactContextBaseJavaModule {
38
38
  super(reactContext);
39
39
  }
40
40
 
41
+ @NonNull
41
42
  @Override
42
43
  public String getName() {
43
44
  return "HBDEventEmitter";
@@ -150,20 +150,20 @@ public class ScreenNavigator implements Navigator {
150
150
 
151
151
  private void handleHideModal(@NonNull AwesomeFragment target, @NonNull Promise promise) {
152
152
  AwesomeFragment presenting = target.getPresentingFragment();
153
- if (presenting == null) {
154
- target.dismissFragment(() -> promise.resolve(true), TransitionAnimation.Fade);
153
+ if (presenting != null) {
154
+ presenting.dismissFragment(() -> promise.resolve(true), TransitionAnimation.Fade);
155
155
  return;
156
156
  }
157
- presenting.dismissFragment(() -> promise.resolve(true), TransitionAnimation.Fade);
157
+ target.dismissFragment(() -> promise.resolve(true), TransitionAnimation.Fade);
158
158
  }
159
159
 
160
160
  private void handleDismiss(@NonNull AwesomeFragment target, @NonNull Promise promise) {
161
161
  AwesomeFragment presenting = target.getPresentingFragment();
162
- if (presenting == null) {
163
- target.dismissFragment(() -> promise.resolve(true));
162
+ if (presenting != null) {
163
+ presenting.dismissFragment(() -> promise.resolve(true));
164
164
  return;
165
165
  }
166
- presenting.dismissFragment(() -> promise.resolve(true));
166
+ target.dismissFragment(() -> promise.resolve(true));
167
167
  }
168
168
 
169
169
  private void handlePresent(@NonNull AwesomeFragment target, @NonNull ReadableMap extras, @NonNull Promise promise) {
@@ -38,7 +38,11 @@
38
38
 
39
39
  @end
40
40
 
41
- @implementation GlobalStyle
41
+ @implementation GlobalStyle {
42
+ UIColor *_barTintColor;
43
+ UIColor *_tintColor;
44
+ UIColor *_titleTextColor;
45
+ }
42
46
 
43
47
  static GlobalStyle *globalStyle;
44
48
 
@@ -279,8 +283,6 @@ static GlobalStyle *globalStyle;
279
283
  }
280
284
  }
281
285
 
282
- @synthesize barTintColor = _barTintColor;
283
-
284
286
  - (void)setBarTintColor:(UIColor *)barTintColor {
285
287
  _barTintColor = barTintColor;
286
288
  _barTintColorDarkContent = barTintColor;
@@ -311,8 +313,6 @@ static GlobalStyle *globalStyle;
311
313
  return UIColor.blackColor;
312
314
  }
313
315
 
314
- @synthesize tintColor = _tintColor;
315
-
316
316
  - (void)setTintColor:(UIColor *)tintColor {
317
317
  _tintColor = tintColor;
318
318
  _tintColorDarkContent = tintColor;
@@ -343,8 +343,6 @@ static GlobalStyle *globalStyle;
343
343
  return UIColor.whiteColor;
344
344
  }
345
345
 
346
- @synthesize titleTextColor = _titleTextColor;
347
-
348
346
  - (void)setTitleTextColor:(UIColor *)titleTextColor {
349
347
  _titleTextColor = titleTextColor;
350
348
  _titleTextColorDarkContent = titleTextColor;
@@ -29,13 +29,13 @@ UIKIT_STATIC_INLINE BOOL imageHasAlphaChannel(UIImage *image) {
29
29
  alpha == kCGImageAlphaPremultipliedLast);
30
30
  }
31
31
 
32
- UIKIT_STATIC_INLINE void hbd_exchangeImplementations(Class class, SEL originalSelector, SEL swizzledSelector) {
33
- Method originalMethod = class_getInstanceMethod(class, originalSelector);
34
- Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
32
+ UIKIT_STATIC_INLINE void hbd_exchangeImplementations(Class klass, SEL originalSelector, SEL swizzledSelector) {
33
+ Method originalMethod = class_getInstanceMethod(klass, originalSelector);
34
+ Method swizzledMethod = class_getInstanceMethod(klass, swizzledSelector);
35
35
 
36
- BOOL success = class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod));
36
+ BOOL success = class_addMethod(klass, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod));
37
37
  if (success) {
38
- class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
38
+ class_replaceMethod(klass, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
39
39
  } else {
40
40
  method_exchangeImplementations(originalMethod, swizzledMethod);
41
41
  }
@@ -9,6 +9,8 @@
9
9
  #import "HBDNavigationBar.h"
10
10
  #import "HBDUtils.h"
11
11
 
12
+ #define hairlineWidth (1.f/[UIScreen mainScreen].scale)
13
+
12
14
  @interface HBDNavigationBar ()
13
15
 
14
16
  @property(nonatomic, strong, readwrite) UIImageView *fakeShadowView;
@@ -60,13 +62,13 @@
60
62
  - (void)layoutSubviews {
61
63
  [super layoutSubviews];
62
64
  self.fakeBackgroundView.frame = self.fakeBackgroundView.superview.bounds;
63
- self.fakeShadowView.frame = CGRectMake(0, CGRectGetHeight(self.fakeShadowView.superview.bounds), CGRectGetWidth(self.fakeShadowView.superview.bounds), 0.5);
65
+ self.fakeShadowView.frame = CGRectMake(0, CGRectGetHeight(self.fakeShadowView.superview.bounds) - hairlineWidth, CGRectGetWidth(self.fakeShadowView.superview.bounds), hairlineWidth);
64
66
  }
65
67
 
66
68
  - (void)setBarTintColor:(UIColor *)barTintColor {
67
69
  [super setBarTintColor:barTintColor];
68
70
  self.fakeBackgroundView.backgroundColor = barTintColor;
69
- [self makesureFakeBackgroundView];
71
+ [self makesureFakeView];
70
72
  }
71
73
 
72
74
  - (UIView *)fakeBackgroundView {
@@ -75,7 +77,6 @@
75
77
  _fakeBackgroundView = [[UIView alloc] init];
76
78
  _fakeBackgroundView.userInteractionEnabled = NO;
77
79
  _fakeBackgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
78
- [[self.subviews firstObject] insertSubview:_fakeBackgroundView atIndex:0];
79
80
  }
80
81
  return _fakeBackgroundView;
81
82
  }
@@ -96,6 +97,7 @@
96
97
  } else {
97
98
  self.fakeShadowView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:77.0 / 255];
98
99
  }
100
+
99
101
  }
100
102
 
101
103
  - (UIImageView *)fakeShadowView {
@@ -104,21 +106,21 @@
104
106
  _fakeShadowView = [[UIImageView alloc] init];
105
107
  _fakeShadowView.userInteractionEnabled = NO;
106
108
  _fakeShadowView.contentScaleFactor = 1;
107
- [[self.subviews firstObject] insertSubview:_fakeShadowView aboveSubview:self.fakeBackgroundView];
109
+ _fakeShadowView.layer.allowsEdgeAntialiasing = YES;
108
110
  }
109
111
  return _fakeShadowView;
110
112
  }
111
113
 
112
- - (void)makesureFakeBackgroundView {
114
+ - (void)makesureFakeView {
113
115
  [UIView setAnimationsEnabled:NO];
114
116
  if (!self.fakeBackgroundView.superview) {
115
- [[self.subviews firstObject] insertSubview:_fakeBackgroundView atIndex:0];
117
+ [[self.subviews firstObject] insertSubview:self.fakeBackgroundView atIndex:0];
116
118
  self.fakeBackgroundView.frame = self.fakeBackgroundView.superview.bounds;
117
119
  }
118
120
 
119
121
  if (!self.fakeShadowView.superview) {
120
- [[self.subviews firstObject] insertSubview:_fakeShadowView aboveSubview:self.fakeBackgroundView];
121
- self.fakeShadowView.frame = CGRectMake(0, CGRectGetHeight(self.fakeShadowView.superview.bounds), CGRectGetWidth(self.fakeShadowView.superview.bounds), 0.5);
122
+ [[self.subviews firstObject] insertSubview:self.fakeShadowView aboveSubview:self.fakeBackgroundView];
123
+ self.fakeShadowView.frame = CGRectMake(0, CGRectGetHeight(self.fakeShadowView.superview.bounds) - hairlineWidth, CGRectGetWidth(self.fakeShadowView.superview.bounds), hairlineWidth);
122
124
  }
123
125
  [UIView setAnimationsEnabled:YES];
124
126
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hybrid-navigation",
3
3
  "description": "React Native Navigation that supports seamless navigation between Native and React.",
4
- "version": "2.12.2-rc.3",
4
+ "version": "2.12.4",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
7
7
  "react-native": "src/index",