Browse Source

refactored navigation options (#2474)

* refactored navigation options

* test fix

* better namings
yogevbd 7 years ago
parent
commit
b0da9e2470
42 changed files with 548 additions and 577 deletions
  1. 0
    12
      lib/android/app/src/main/java/com/reactnativenavigation/parse/NavigationOptions.java
  2. 14
    0
      lib/android/app/src/main/java/com/reactnativenavigation/parse/TopBarOptions.java
  3. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/OptionsPresenter.java
  4. 2
    8
      lib/ios/RNNBottomTabOptions.h
  5. 51
    0
      lib/ios/RNNBottomTabOptions.m
  6. 2
    9
      lib/ios/RNNBottomTabsOptions.h
  7. 45
    0
      lib/ios/RNNBottomTabsOptions.m
  8. 0
    1
      lib/ios/RNNCommandsHandler.m
  9. 0
    1
      lib/ios/RNNNavigationButtons.h
  10. 14
    15
      lib/ios/RNNNavigationButtons.m
  11. 1
    1
      lib/ios/RNNNavigationController.m
  12. 11
    20
      lib/ios/RNNNavigationOptions.h
  13. 11
    254
      lib/ios/RNNNavigationOptions.m
  14. 1
    1
      lib/ios/RNNNavigationStackManager.m
  15. 17
    0
      lib/ios/RNNOptions.h
  16. 18
    0
      lib/ios/RNNOptions.m
  17. 1
    2
      lib/ios/RNNRootViewController.h
  18. 4
    11
      lib/ios/RNNRootViewController.m
  19. 2
    1
      lib/ios/RNNRootViewProtocol.h
  20. 1
    1
      lib/ios/RNNSideMenuChildVC.m
  21. 1
    1
      lib/ios/RNNSideMenuController.m
  22. 2
    8
      lib/ios/RNNSideMenuOptions.h
  23. 22
    10
      lib/ios/RNNSideMenuOptions.m
  24. 1
    1
      lib/ios/RNNTabBarController.m
  25. 0
    32
      lib/ios/RNNTabBarOptions.m
  26. 0
    32
      lib/ios/RNNTabItemOptions.m
  27. 4
    8
      lib/ios/RNNTopBarOptions.h
  28. 164
    28
      lib/ios/RNNTopBarOptions.m
  29. 3
    8
      lib/ios/RNNTopTabOptions.h
  30. 5
    10
      lib/ios/RNNTopTabOptions.m
  31. 7
    0
      lib/ios/RNNTopTabsOptions.h
  32. 10
    0
      lib/ios/RNNTopTabsOptions.m
  33. 2
    2
      lib/ios/RNNTopTabsViewController.m
  34. 48
    22
      lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj
  35. 3
    3
      lib/ios/ReactNativeNavigationTests/RNNNavigationOptionsTest.m
  36. 5
    5
      lib/ios/ReactNativeNavigationTests/RNNRootViewControllerTest.m
  37. 0
    5
      lib/src/params/options/NavigationOptions.js
  38. 0
    20
      lib/src/params/options/NavigationOptions.test.js
  39. 6
    0
      lib/src/params/options/TopBar.js
  40. 22
    1
      lib/src/params/options/TopBar.test.js
  41. 46
    42
      playground/src/containers/OptionsScreen.js
  42. 1
    1
      playground/src/containers/WelcomeScreen.js

+ 0
- 12
lib/android/app/src/main/java/com/reactnativenavigation/parse/NavigationOptions.java View File

37
 		result.topTabsOptions = TopTabsOptions.parse(json.optJSONObject("topTabs"));
37
 		result.topTabsOptions = TopTabsOptions.parse(json.optJSONObject("topTabs"));
38
         result.topTabOptions = TopTabOptions.parse(typefaceManager, json.optJSONObject("topTab"));
38
         result.topTabOptions = TopTabOptions.parse(typefaceManager, json.optJSONObject("topTab"));
39
 		result.bottomTabsOptions = BottomTabsOptions.parse(json.optJSONObject("bottomTabs"));
39
 		result.bottomTabsOptions = BottomTabsOptions.parse(json.optJSONObject("bottomTabs"));
40
-		result.rightButtons = Button.parseJsonArray(json.optJSONArray("rightButtons"));
41
-        result.leftButtons = Button.parseJsonArray(json.optJSONArray("leftButtons"));
42
 
40
 
43
 		return result.withDefaultOptions(defaultOptions);
41
 		return result.withDefaultOptions(defaultOptions);
44
 	}
42
 	}
47
     @NonNull public TopTabsOptions topTabsOptions = new TopTabsOptions();
45
     @NonNull public TopTabsOptions topTabsOptions = new TopTabsOptions();
48
     @NonNull public TopTabOptions topTabOptions = new TopTabOptions();
46
     @NonNull public TopTabOptions topTabOptions = new TopTabOptions();
49
     @NonNull public BottomTabsOptions bottomTabsOptions = new BottomTabsOptions();
47
     @NonNull public BottomTabsOptions bottomTabsOptions = new BottomTabsOptions();
50
-    public ArrayList<Button> leftButtons;
51
-    public ArrayList<Button> rightButtons;
52
 
48
 
53
 	public void mergeWith(final NavigationOptions other) {
49
 	public void mergeWith(final NavigationOptions other) {
54
         topBarOptions.mergeWith(other.topBarOptions);
50
         topBarOptions.mergeWith(other.topBarOptions);
55
         topTabsOptions.mergeWith(other.topTabsOptions);
51
         topTabsOptions.mergeWith(other.topTabsOptions);
56
         bottomTabsOptions.mergeWith(other.bottomTabsOptions);
52
         bottomTabsOptions.mergeWith(other.bottomTabsOptions);
57
-
58
-        if(other.leftButtons != null) {
59
-            leftButtons = other.leftButtons;
60
-        }
61
-
62
-        if(other.rightButtons != null) {
63
-            rightButtons = other.rightButtons;
64
-        }
65
     }
53
     }
66
 
54
 
67
     NavigationOptions withDefaultOptions(final NavigationOptions other) {
55
     NavigationOptions withDefaultOptions(final NavigationOptions other) {

+ 14
- 0
lib/android/app/src/main/java/com/reactnativenavigation/parse/TopBarOptions.java View File

9
 
9
 
10
 import org.json.JSONObject;
10
 import org.json.JSONObject;
11
 
11
 
12
+import java.util.ArrayList;
13
+
12
 public class TopBarOptions implements DEFAULT_VALUES {
14
 public class TopBarOptions implements DEFAULT_VALUES {
13
 
15
 
14
 	public static TopBarOptions parse(TypefaceLoader typefaceManager, JSONObject json) {
16
 	public static TopBarOptions parse(TypefaceLoader typefaceManager, JSONObject json) {
22
 		options.textFontFamily = typefaceManager.getTypeFace(json.optString("textFontFamily", NO_VALUE));
24
 		options.textFontFamily = typefaceManager.getTypeFace(json.optString("textFontFamily", NO_VALUE));
23
 		options.hidden = NavigationOptions.BooleanOptions.parse(json.optString("hidden"));
25
 		options.hidden = NavigationOptions.BooleanOptions.parse(json.optString("hidden"));
24
 		options.animateHide = NavigationOptions.BooleanOptions.parse(json.optString("animateHide"));
26
 		options.animateHide = NavigationOptions.BooleanOptions.parse(json.optString("animateHide"));
27
+		options.rightButtons = Button.parseJsonArray(json.optJSONArray("rightButtons"));
28
+		options.leftButtons = Button.parseJsonArray(json.optJSONArray("leftButtons"));
25
 
29
 
26
 		return options;
30
 		return options;
27
 	}
31
 	}
33
 	@Nullable public Typeface textFontFamily;
37
 	@Nullable public Typeface textFontFamily;
34
 	public NavigationOptions.BooleanOptions hidden = NavigationOptions.BooleanOptions.False;
38
 	public NavigationOptions.BooleanOptions hidden = NavigationOptions.BooleanOptions.False;
35
 	public NavigationOptions.BooleanOptions animateHide = NavigationOptions.BooleanOptions.False;
39
 	public NavigationOptions.BooleanOptions animateHide = NavigationOptions.BooleanOptions.False;
40
+	public ArrayList<Button> leftButtons;
41
+	public ArrayList<Button> rightButtons;
36
 
42
 
37
 	void mergeWith(final TopBarOptions other) {
43
 	void mergeWith(final TopBarOptions other) {
38
 		if (!NO_VALUE.equals(other.title)) title = other.title;
44
 		if (!NO_VALUE.equals(other.title)) title = other.title;
48
 			hidden = other.hidden;
54
 			hidden = other.hidden;
49
 		if (other.animateHide != NavigationOptions.BooleanOptions.NoValue)
55
 		if (other.animateHide != NavigationOptions.BooleanOptions.NoValue)
50
 			animateHide = other.animateHide;
56
 			animateHide = other.animateHide;
57
+		if(other.leftButtons != null)
58
+			leftButtons = other.leftButtons;
59
+		if(other.rightButtons != null)
60
+			rightButtons = other.rightButtons;
51
 	}
61
 	}
52
 
62
 
53
     void mergeWithDefault(TopBarOptions defaultOptions) {
63
     void mergeWithDefault(TopBarOptions defaultOptions) {
65
             hidden = defaultOptions.hidden;
75
             hidden = defaultOptions.hidden;
66
         if (animateHide == NavigationOptions.BooleanOptions.NoValue)
76
         if (animateHide == NavigationOptions.BooleanOptions.NoValue)
67
             animateHide = defaultOptions.animateHide;
77
             animateHide = defaultOptions.animateHide;
78
+		if(leftButtons == null)
79
+			leftButtons = defaultOptions.leftButtons;
80
+		if(rightButtons == null)
81
+			rightButtons = defaultOptions.rightButtons;
68
     }
82
     }
69
 }
83
 }

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/presentation/OptionsPresenter.java View File

26
 
26
 
27
     public void applyOptions(NavigationOptions options) {
27
     public void applyOptions(NavigationOptions options) {
28
         applyTopBarOptions(options.topBarOptions);
28
         applyTopBarOptions(options.topBarOptions);
29
-        applyButtons(options.leftButtons, options.rightButtons);
29
+        applyButtons(options.topBarOptions.leftButtons, options.topBarOptions.rightButtons);
30
         applyTopTabsOptions(options.topTabsOptions);
30
         applyTopTabsOptions(options.topTabsOptions);
31
         applyTopTabOptions(options.topTabOptions);
31
         applyTopTabOptions(options.topTabOptions);
32
     }
32
     }

lib/ios/RNNTabItemOptions.h → lib/ios/RNNBottomTabOptions.h View File

1
-#import <Foundation/Foundation.h>
1
+#import "RNNOptions.h"
2
 
2
 
3
-@interface RNNTabItemOptions : NSObject
3
+@interface RNNBottomTabOptions : RNNOptions
4
 
4
 
5
 @property (nonatomic) NSUInteger tag;
5
 @property (nonatomic) NSUInteger tag;
6
 @property (nonatomic, strong) NSString* title;
6
 @property (nonatomic, strong) NSString* title;
9
 @property (nonatomic, strong) NSNumber* visible;
9
 @property (nonatomic, strong) NSNumber* visible;
10
 @property (nonatomic, strong) NSDictionary* icon;
10
 @property (nonatomic, strong) NSDictionary* icon;
11
 
11
 
12
--(instancetype)initWithDict:(NSDictionary*)tabItemDict;
13
-
14
--(void)mergeWith:(NSDictionary *)otherOptions;
15
-
16
--(void)resetOptions;
17
-
18
 @end
12
 @end

+ 51
- 0
lib/ios/RNNBottomTabOptions.m View File

1
+#import "RNNBottomTabOptions.h"
2
+
3
+@implementation RNNBottomTabOptions
4
+
5
+-(instancetype)initWithDict:(NSDictionary *)tabItemDict {
6
+	self = [super init];
7
+	
8
+	[self mergeWith:tabItemDict];
9
+	self.tag = [tabItemDict[@"tag"] integerValue];
10
+	
11
+	return self;
12
+}
13
+
14
+- (void)applyOn:(UIViewController *)viewController {
15
+	if (self.title || self.icon) {
16
+		UITabBarItem* tabItem = [[UITabBarItem alloc] initWithTitle:self.title image:[RCTConvert UIImage:self.icon] tag:self.tag];
17
+		tabItem.accessibilityIdentifier = self.testID;
18
+		[viewController.navigationController setTabBarItem:tabItem];
19
+	}
20
+	
21
+	if (self.badge) {
22
+		NSString *badge = [RCTConvert NSString:self.badge];
23
+		if (viewController.navigationController) {
24
+			viewController.navigationController.tabBarItem.badgeValue = badge;
25
+		} else {
26
+			viewController.tabBarItem.badgeValue = badge;
27
+		}
28
+	}
29
+	
30
+	if (self.visible) {
31
+		[viewController.tabBarController setSelectedIndex:[viewController.tabBarController.viewControllers indexOfObject:viewController]];
32
+	}
33
+	
34
+	[self resetOptions];
35
+}
36
+
37
+-(void)mergeWith:(NSDictionary *)otherOptions {
38
+	for (id key in otherOptions) {
39
+		[self setValue:[otherOptions objectForKey:key] forKey:key];
40
+	}
41
+}
42
+
43
+-(void)resetOptions {
44
+	self.title = nil;
45
+	self.badge = nil;
46
+	self.visible = nil;
47
+	self.icon = nil;
48
+	self.testID = nil;
49
+}
50
+
51
+@end

lib/ios/RNNTabBarOptions.h → lib/ios/RNNBottomTabsOptions.h View File

1
-#import <Foundation/Foundation.h>
1
+#import "RNNOptions.h"
2
 
2
 
3
-extern const NSInteger BLUR_TOPBAR_TAG;
4
-
5
-@interface RNNTabBarOptions : NSObject
3
+@interface RNNBottomTabsOptions : RNNOptions
6
 
4
 
7
 @property (nonatomic, strong) NSNumber* hidden;
5
 @property (nonatomic, strong) NSNumber* hidden;
8
 @property (nonatomic, strong) NSNumber* animateHide;
6
 @property (nonatomic, strong) NSNumber* animateHide;
11
 @property (nonatomic, strong) NSNumber* drawUnder;
9
 @property (nonatomic, strong) NSNumber* drawUnder;
12
 @property (nonatomic, strong) NSString* currentTabId;
10
 @property (nonatomic, strong) NSString* currentTabId;
13
 
11
 
14
--(instancetype)init;
15
--(instancetype)initWithDict:(NSDictionary *)topBarOptions;
16
--(void)mergeWith:(NSDictionary*)otherOptions;
17
-- (void)resetOptions;
18
-
19
 @end
12
 @end

+ 45
- 0
lib/ios/RNNBottomTabsOptions.m View File

1
+#import "RNNBottomTabsOptions.h"
2
+#import "RNNTabBarController.h"
3
+extern const NSInteger BLUR_TOPBAR_TAG;
4
+
5
+@implementation RNNBottomTabsOptions
6
+
7
+- (void)applyOn:(UIViewController *)viewController {
8
+	if (self.currentTabIndex) {
9
+		[viewController.tabBarController setSelectedIndex:[self.currentTabIndex unsignedIntegerValue]];
10
+	}
11
+	
12
+	if (self.currentTabId) {
13
+		[(RNNTabBarController*)viewController.tabBarController setSelectedIndexByContainerID:self.currentTabId];
14
+	}
15
+	
16
+	if (self.hidden) {
17
+		[((RNNTabBarController *)viewController.tabBarController) setTabBarHidden:[self.hidden boolValue] animated:[self.animateHide boolValue]];
18
+	}
19
+	
20
+	if (self.testID) {
21
+		viewController.tabBarController.tabBar.accessibilityIdentifier = self.testID;
22
+	}
23
+	
24
+	if (self.drawUnder) {
25
+		if ([self.drawUnder boolValue]) {
26
+			viewController.edgesForExtendedLayout |= UIRectEdgeBottom;
27
+		} else {
28
+			viewController.edgesForExtendedLayout &= ~UIRectEdgeBottom;
29
+		}
30
+	}
31
+	
32
+	[self resetOptions];
33
+}
34
+
35
+- (void)resetOptions {
36
+	self.currentTabId = nil;
37
+	self.currentTabIndex = nil;
38
+}
39
+
40
+-(void)mergeWith:(NSDictionary *)otherOptions {
41
+	for (id key in otherOptions) {
42
+		[self setValue:[otherOptions objectForKey:key] forKey:key];
43
+	}
44
+}
45
+@end

+ 0
- 1
lib/ios/RNNCommandsHandler.m View File

46
 		[CATransaction setCompletionBlock:completion];
46
 		[CATransaction setCompletionBlock:completion];
47
 		
47
 		
48
 		[rootVc.navigationOptions applyOn:vc];
48
 		[rootVc.navigationOptions applyOn:vc];
49
-		[rootVc applyNavigationButtons];
50
 		
49
 		
51
 		[CATransaction commit];
50
 		[CATransaction commit];
52
 	}
51
 	}

+ 0
- 1
lib/ios/RNNNavigationButtons.h View File

4
 
4
 
5
 @interface RNNNavigationButtons : NSObject
5
 @interface RNNNavigationButtons : NSObject
6
 
6
 
7
--(instancetype)init;
8
 -(instancetype)initWithViewController:(RNNRootViewController*)viewController;
7
 -(instancetype)initWithViewController:(RNNRootViewController*)viewController;
9
 
8
 
10
 -(void)applyLeftButtons:(NSArray*)leftButtons rightButtons:(NSArray*)rightButtons;
9
 -(void)applyLeftButtons:(NSArray*)leftButtons rightButtons:(NSArray*)rightButtons;

+ 14
- 15
lib/ios/RNNNavigationButtons.m View File

4
 #import "RCTHelpers.h"
4
 #import "RCTHelpers.h"
5
 
5
 
6
 @interface RNNNavigationButtons()
6
 @interface RNNNavigationButtons()
7
+
7
 @property (weak, nonatomic) RNNRootViewController* viewController;
8
 @property (weak, nonatomic) RNNRootViewController* viewController;
9
+@property (strong, nonatomic) NSArray* rightButtons;
10
+@property (strong, nonatomic) NSArray* leftButtons;
8
 
11
 
9
 @end
12
 @end
10
 
13
 
11
 @implementation RNNNavigationButtons
14
 @implementation RNNNavigationButtons
12
 
15
 
13
--(instancetype)init {
14
-	return [super init];
15
-}
16
-
17
 -(instancetype)initWithViewController:(RNNRootViewController*)viewController {
16
 -(instancetype)initWithViewController:(RNNRootViewController*)viewController {
18
 	self = [super init];
17
 	self = [super init];
19
 	
18
 	
23
 }
22
 }
24
 
23
 
25
 -(void)applyLeftButtons:(NSArray*)leftButtons rightButtons:(NSArray*)rightButtons {
24
 -(void)applyLeftButtons:(NSArray*)leftButtons rightButtons:(NSArray*)rightButtons {
26
-	if(leftButtons) {
25
+	if (leftButtons) {
27
 		[self setButtons:leftButtons side:@"left" animated:NO];
26
 		[self setButtons:leftButtons side:@"left" animated:NO];
28
 	}
27
 	}
29
 	
28
 	
30
-	if(rightButtons) {
29
+	if (rightButtons) {
31
 		[self setButtons:rightButtons side:@"right" animated:NO];
30
 		[self setButtons:rightButtons side:@"right" animated:NO];
32
 	}
31
 	}
33
 }
32
 }
41
 		}
40
 		}
42
 	}
41
 	}
43
 	
42
 	
44
-	if ([side isEqualToString:@"left"])
45
-	{
46
-		[self.viewController.navigationItem setLeftBarButtonItems:barButtonItems animated:animated];
43
+	if ([side isEqualToString:@"left"]) {
44
+		self.leftButtons = barButtonItems;
45
+		[self.viewController.navigationItem setLeftBarButtonItems:self.leftButtons animated:animated];
47
 	}
46
 	}
48
 	
47
 	
49
-	if ([side isEqualToString:@"right"])
50
-	{
51
-		[self.viewController.navigationItem setRightBarButtonItems:barButtonItems animated:animated];
48
+	if ([side isEqualToString:@"right"]) {
49
+		self.rightButtons = barButtonItems;
50
+		[self.viewController.navigationItem setRightBarButtonItems:self.rightButtons animated:animated];
52
 	}
51
 	}
53
 }
52
 }
54
 
53
 
56
 	NSString* buttonId = dictionary[@"id"];
55
 	NSString* buttonId = dictionary[@"id"];
57
 	NSString* title = dictionary[@"title"];
56
 	NSString* title = dictionary[@"title"];
58
 	
57
 	
59
-	if(!buttonId){
58
+	if (!buttonId) {
60
 		@throw [NSException exceptionWithName:@"NSInvalidArgumentException" reason:[@"button id is not specified " stringByAppendingString:title] userInfo:nil];
59
 		@throw [NSException exceptionWithName:@"NSInvalidArgumentException" reason:[@"button id is not specified " stringByAppendingString:title] userInfo:nil];
61
 	}
60
 	}
62
 	
61
 	
104
 	return barButtonItem;
103
 	return barButtonItem;
105
 }
104
 }
106
 
105
 
107
--(void)onButtonPress:(RNNUIBarButtonItem*)barButtonItem
108
-{
106
+-(void)onButtonPress:(RNNUIBarButtonItem*)barButtonItem {
109
 	[self.viewController.eventEmitter sendOnNavigationButtonPressed:self.viewController.containerId buttonId:barButtonItem.buttonId];
107
 	[self.viewController.eventEmitter sendOnNavigationButtonPressed:self.viewController.containerId buttonId:barButtonItem.buttonId];
110
 }
108
 }
109
+
111
 @end
110
 @end

+ 1
- 1
lib/ios/RNNNavigationController.m View File

7
 	return self.viewControllers.lastObject.supportedInterfaceOrientations;
7
 	return self.viewControllers.lastObject.supportedInterfaceOrientations;
8
 }
8
 }
9
 
9
 
10
-- (BOOL)isAnimated {
10
+- (BOOL)isCustomTransitioned {
11
 	return NO;
11
 	return NO;
12
 }
12
 }
13
 
13
 

+ 11
- 20
lib/ios/RNNNavigationOptions.h View File

1
 #import <Foundation/Foundation.h>
1
 #import <Foundation/Foundation.h>
2
-#import <UIKit/UIKit.h>
3
 #import "RNNTopBarOptions.h"
2
 #import "RNNTopBarOptions.h"
4
-#import "RNNTabBarOptions.h"
3
+#import "RNNBottomTabsOptions.h"
4
+#import "RNNBottomTabOptions.h"
5
 #import "RNNSideMenuOptions.h"
5
 #import "RNNSideMenuOptions.h"
6
-#import "RNNTabItemOptions.h"
7
 #import "RNNTopTabOptions.h"
6
 #import "RNNTopTabOptions.h"
7
+#import "RNNTopTabsOptions.h"
8
 
8
 
9
 extern const NSInteger BLUR_STATUS_TAG;
9
 extern const NSInteger BLUR_STATUS_TAG;
10
 extern const NSInteger BLUR_TOPBAR_TAG;
10
 extern const NSInteger BLUR_TOPBAR_TAG;
11
 extern const NSInteger TOP_BAR_TRANSPARENT_TAG;
11
 extern const NSInteger TOP_BAR_TRANSPARENT_TAG;
12
 
12
 
13
-@interface RNNNavigationOptions : NSObject
13
+@interface RNNNavigationOptions : RNNOptions
14
+
15
+@property (nonatomic, strong) RNNTopBarOptions* topBar;
16
+@property (nonatomic, strong) RNNBottomTabsOptions* bottomTabs;
17
+@property (nonatomic, strong) RNNBottomTabOptions* bottomTab;
18
+@property (nonatomic, strong) RNNTopTabsOptions* topTabs;
19
+@property (nonatomic, strong) RNNTopTabOptions* topTab;
20
+@property (nonatomic, strong) RNNSideMenuOptions* sideMenu;
14
 
21
 
15
 @property (nonatomic, strong) NSNumber* statusBarHidden;
22
 @property (nonatomic, strong) NSNumber* statusBarHidden;
16
 @property (nonatomic, strong) NSNumber* screenBackgroundColor;
23
 @property (nonatomic, strong) NSNumber* screenBackgroundColor;
17
 @property (nonatomic, strong) NSMutableDictionary* originalTopBarImages;
24
 @property (nonatomic, strong) NSMutableDictionary* originalTopBarImages;
18
 @property (nonatomic, strong) NSString* backButtonTransition;
25
 @property (nonatomic, strong) NSString* backButtonTransition;
19
 @property (nonatomic, strong) id orientation;
26
 @property (nonatomic, strong) id orientation;
20
-@property (nonatomic, strong) NSArray* leftButtons;
21
-@property (nonatomic, strong) NSArray* rightButtons;
22
 @property (nonatomic, strong) NSNumber* statusBarBlur;
27
 @property (nonatomic, strong) NSNumber* statusBarBlur;
23
 @property (nonatomic, strong) NSNumber* statusBarHideWithTopBar;
28
 @property (nonatomic, strong) NSNumber* statusBarHideWithTopBar;
24
 @property (nonatomic, strong) NSNumber* popGesture;
29
 @property (nonatomic, strong) NSNumber* popGesture;
25
-@property (nonatomic, strong) RNNTopBarOptions* topBar;
26
-@property (nonatomic, strong) RNNTabBarOptions* bottomTabs;
27
-@property (nonatomic, strong) RNNTopTabOptions* topTab;
28
-@property (nonatomic, strong) RNNSideMenuOptions* sideMenu;
29
 @property (nonatomic, strong) UIImage* backgroundImage;
30
 @property (nonatomic, strong) UIImage* backgroundImage;
30
 @property (nonatomic, strong) UIImage* rootBackgroundImage;
31
 @property (nonatomic, strong) UIImage* rootBackgroundImage;
31
-@property (nonatomic, strong) RNNTabItemOptions* tabItem;
32
 
32
 
33
 
33
 
34
 - (UIInterfaceOrientationMask)supportedOrientations;
34
 - (UIInterfaceOrientationMask)supportedOrientations;
35
 
35
 
36
--(instancetype)init;
37
--(instancetype)initWithDict:(NSDictionary *)navigationOptions;
38
-
39
--(void)applyOn:(UIViewController*)viewController;
40
--(void)mergeWith:(NSDictionary*)otherOptions;
41
--(void)storeOriginalTopBarImages:(UIViewController*)viewController;
42
-
43
-- (void)applyTabBarItemOptions:(UIViewController*)viewController;
44
-- (void)applyTopTab:(UIViewController*)viewController;
45
 
36
 
46
 @end
37
 @end

+ 11
- 254
lib/ios/RNNNavigationOptions.m View File

5
 #import "RNNTopBarOptions.h"
5
 #import "RNNTopBarOptions.h"
6
 #import "RNNSideMenuController.h"
6
 #import "RNNSideMenuController.h"
7
 #import "RNNRootViewController.h"
7
 #import "RNNRootViewController.h"
8
+#import "RNNNavigationButtons.h"
8
 
9
 
9
 const NSInteger BLUR_STATUS_TAG = 78264801;
10
 const NSInteger BLUR_STATUS_TAG = 78264801;
10
 const NSInteger BLUR_TOPBAR_TAG = 78264802;
11
 const NSInteger BLUR_TOPBAR_TAG = 78264802;
12
 
13
 
13
 @implementation RNNNavigationOptions
14
 @implementation RNNNavigationOptions
14
 
15
 
15
-
16
-
17
 -(instancetype)init {
16
 -(instancetype)init {
18
 	return [self initWithDict:@{}];
17
 	return [self initWithDict:@{}];
19
 }
18
 }
24
 	self.screenBackgroundColor = [navigationOptions objectForKey:@"screenBackgroundColor"];
23
 	self.screenBackgroundColor = [navigationOptions objectForKey:@"screenBackgroundColor"];
25
 	self.backButtonTransition = [navigationOptions objectForKey:@"backButtonTransition"];
24
 	self.backButtonTransition = [navigationOptions objectForKey:@"backButtonTransition"];
26
 	self.orientation = [navigationOptions objectForKey:@"orientation"];
25
 	self.orientation = [navigationOptions objectForKey:@"orientation"];
27
-	self.leftButtons = [navigationOptions objectForKey:@"leftButtons"];
28
-	self.rightButtons = [navigationOptions objectForKey:@"rightButtons"];
29
 	self.topBar = [[RNNTopBarOptions alloc] initWithDict:[navigationOptions objectForKey:@"topBar"]];
26
 	self.topBar = [[RNNTopBarOptions alloc] initWithDict:[navigationOptions objectForKey:@"topBar"]];
30
 	self.topTab = [[RNNTopTabOptions alloc] initWithDict:[navigationOptions objectForKey:@"topTab"]];
27
 	self.topTab = [[RNNTopTabOptions alloc] initWithDict:[navigationOptions objectForKey:@"topTab"]];
31
-	self.bottomTabs = [[RNNTabBarOptions alloc] initWithDict:[navigationOptions objectForKey:@"bottomTabs"]];
28
+	self.bottomTabs = [[RNNBottomTabsOptions alloc] initWithDict:[navigationOptions objectForKey:@"bottomTabs"]];
32
 	self.sideMenu = [[RNNSideMenuOptions alloc] initWithDict:[navigationOptions objectForKey:@"sideMenu"]];
29
 	self.sideMenu = [[RNNSideMenuOptions alloc] initWithDict:[navigationOptions objectForKey:@"sideMenu"]];
33
 	self.backgroundImage = [RCTConvert UIImage:[navigationOptions objectForKey:@"backgroundImage"]];
30
 	self.backgroundImage = [RCTConvert UIImage:[navigationOptions objectForKey:@"backgroundImage"]];
34
 	self.rootBackgroundImage = [RCTConvert UIImage:[navigationOptions objectForKey:@"rootBackgroundImage"]];
31
 	self.rootBackgroundImage = [RCTConvert UIImage:[navigationOptions objectForKey:@"rootBackgroundImage"]];
35
-	self.tabItem = [[RNNTabItemOptions alloc] initWithDict:[navigationOptions objectForKey:@"bottomTab"]];
32
+	self.bottomTab = [[RNNBottomTabOptions alloc] initWithDict:[navigationOptions objectForKey:@"bottomTab"]];
36
     
33
     
37
 	return self;
34
 	return self;
38
 }
35
 }
39
 
36
 
40
 -(void)mergeWith:(NSDictionary *)otherOptions {
37
 -(void)mergeWith:(NSDictionary *)otherOptions {
41
 	for (id key in otherOptions) {
38
 	for (id key in otherOptions) {
42
-		if ([key isEqualToString:@"topBar"]) {
43
-			[self.topBar mergeWith:[otherOptions objectForKey:key]];
44
-		} else if ([key isEqualToString:@"bottomTabs"]) {
45
-			[self.bottomTabs mergeWith:[otherOptions objectForKey:key]];
46
-		} else if ([key isEqualToString:@"topTab"]) {
47
-			[self.topTab mergeWith:[otherOptions objectForKey:key]];
48
-		} else if ([key isEqualToString:@"sideMenu"]) {
49
-			[self.sideMenu mergeWith:[otherOptions objectForKey:@"sideMenu"]];
50
-		} else if ([key isEqualToString:@"bottomTab"]) {
51
-			[self.tabItem mergeWith:[otherOptions objectForKey:key]];
39
+		if ([[self valueForKey:key] isKindOfClass:[RNNOptions class]]) {
40
+			RNNOptions* options = [self valueForKey:key];
41
+			[options mergeWith:[otherOptions objectForKey:key]];
52
 		} else {
42
 		} else {
53
 			[self setValue:[otherOptions objectForKey:key] forKey:key];
43
 			[self setValue:[otherOptions objectForKey:key] forKey:key];
54
 		}
44
 		}
56
 }
46
 }
57
 
47
 
58
 -(void)applyOn:(UIViewController*)viewController {
48
 -(void)applyOn:(UIViewController*)viewController {
59
-	if (self.topBar) {
60
-		if (self.topBar.backgroundColor) {
61
-			UIColor* backgroundColor = [RCTConvert UIColor:self.topBar.backgroundColor];
62
-			viewController.navigationController.navigationBar.barTintColor = backgroundColor;
63
-		} else {
64
-			viewController.navigationController.navigationBar.barTintColor = nil;
65
-		}
66
-		
67
-		if (self.topBar.title) {
68
-			viewController.navigationItem.title = self.topBar.title;
69
-		}
70
-		
71
-		if (@available(iOS 11.0, *)) {
72
-			if (self.topBar.largeTitle){
73
-				if ([self.topBar.largeTitle boolValue]) {
74
-					viewController.navigationController.navigationBar.prefersLargeTitles = YES;
75
-					viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
76
-				} else {
77
-					viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
78
-				}
79
-			} else {
80
-				viewController.navigationController.navigationBar.prefersLargeTitles = NO;
81
-				viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
82
-			}
83
-		}
84
-		
85
-		
86
-		if (self.topBar.textFontFamily || self.topBar.textFontSize || self.topBar.textColor) {
87
-			NSMutableDictionary* navigationBarTitleTextAttributes = [NSMutableDictionary new];
88
-			if (self.topBar.textColor) {
89
-				navigationBarTitleTextAttributes[NSForegroundColorAttributeName] = [RCTConvert UIColor:[self.topBar valueForKey:@"textColor"]];
90
-			}
91
-			if (self.topBar.textFontFamily){
92
-				if(self.topBar.textFontSize) {
93
-					navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont fontWithName:self.topBar.textFontFamily size:[self.topBar.textFontSize floatValue]];
94
-				} else {
95
-					navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont fontWithName:self.topBar.textFontFamily size:20];
96
-				}
97
-			} else if (self.topBar.textFontSize) {
98
-				navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont systemFontOfSize:[self.topBar.textFontSize floatValue]];
99
-			}
100
-			viewController.navigationController.navigationBar.titleTextAttributes = navigationBarTitleTextAttributes;
101
-			if (@available(iOS 11.0, *)){
102
-				viewController.navigationController.navigationBar.largeTitleTextAttributes = navigationBarTitleTextAttributes;
103
-			}
104
-			
105
-		}
106
-		
107
-		
108
-		if (self.topBar.hidden){
109
-			[viewController.navigationController setNavigationBarHidden:[self.topBar.hidden boolValue] animated:[self.topBar.animateHide boolValue]];
110
-		}
111
-		
112
-		if (self.topBar.hideOnScroll) {
113
-			viewController.navigationController.hidesBarsOnSwipe = [self.topBar.hideOnScroll boolValue];
114
-		}
115
-		
116
-		if (self.topBar.buttonColor) {
117
-			UIColor* buttonColor = [RCTConvert UIColor:self.topBar.buttonColor];
118
-			viewController.navigationController.navigationBar.tintColor = buttonColor;
119
-		} else {
120
-			viewController.navigationController.navigationBar.tintColor = nil;
121
-		}
122
-		
123
-		if ([self.topBar.blur boolValue]) {
124
-			if (![viewController.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]) {
125
-				
126
-				[viewController.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
127
-				viewController.navigationController.navigationBar.shadowImage = [UIImage new];
128
-				UIVisualEffectView *blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
129
-				CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
130
-				blur.frame = CGRectMake(0, -1 * statusBarFrame.size.height, viewController.navigationController.navigationBar.frame.size.width, viewController.navigationController.navigationBar.frame.size.height + statusBarFrame.size.height);
131
-				blur.userInteractionEnabled = NO;
132
-				blur.tag = BLUR_TOPBAR_TAG;
133
-				[viewController.navigationController.navigationBar insertSubview:blur atIndex:0];
134
-				[viewController.navigationController.navigationBar sendSubviewToBack:blur];
135
-			}
136
-		} else {
137
-			UIView *blur = [viewController.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG];
138
-			if (blur) {
139
-				[viewController.navigationController.navigationBar setBackgroundImage: nil forBarMetrics:UIBarMetricsDefault];
140
-				viewController.navigationController.navigationBar.shadowImage = nil;
141
-				[blur removeFromSuperview];
142
-			}
143
-		}
144
-		
145
-		void (^disableTopBarTransparent)() = ^void(){
146
-			UIView *transparentView = [viewController.navigationController.navigationBar viewWithTag:TOP_BAR_TRANSPARENT_TAG];
147
-			if (transparentView){
148
-				[transparentView removeFromSuperview];
149
-				[viewController.navigationController.navigationBar setBackgroundImage:self.originalTopBarImages[@"backgroundImage"] forBarMetrics:UIBarMetricsDefault];
150
-				viewController.navigationController.navigationBar.shadowImage = self.originalTopBarImages[@"shadowImage"];
151
-				self.originalTopBarImages = nil;
152
-			}
153
-		};
154
-	
155
-		if (self.topBar.transparent) {
156
-			if ([self.topBar.transparent boolValue]) {
157
-				if (![viewController.navigationController.navigationBar viewWithTag:TOP_BAR_TRANSPARENT_TAG]){
158
-					[self storeOriginalTopBarImages:viewController];
159
-					[viewController.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
160
-					viewController.navigationController.navigationBar.shadowImage = [UIImage new];
161
-					UIView *transparentView = [[UIView alloc] initWithFrame:CGRectZero];
162
-					transparentView.tag = TOP_BAR_TRANSPARENT_TAG;
163
-					[viewController.navigationController.navigationBar insertSubview:transparentView atIndex:0];
164
-				}
165
-			} else {
166
-				disableTopBarTransparent();
167
-			}
168
-		} else {
169
-			disableTopBarTransparent();
170
-		}
171
-
172
-		if (self.topBar.translucent) {
173
-			viewController.navigationController.navigationBar.translucent = [self.topBar.translucent boolValue];
174
-		}
175
-
176
-		if (self.topBar.drawUnder) {
177
-			if ([self.topBar.drawUnder boolValue]) {
178
-				viewController.edgesForExtendedLayout |= UIRectEdgeTop;
179
-			} else {
180
-				viewController.edgesForExtendedLayout &= ~UIRectEdgeTop;
181
-			}
182
-		}
183
-		
184
-		if (self.topBar.noBorder) {
185
-			if ([self.topBar.noBorder boolValue]) {
186
-				viewController.navigationController.navigationBar
187
-				.shadowImage = [[UIImage alloc] init];
188
-			} else {
189
-				viewController.navigationController.navigationBar
190
-				.shadowImage = nil;
191
-			}
192
-		}
193
-		
194
-		if (self.topBar.testID) {
195
-			viewController.navigationController.navigationBar.accessibilityIdentifier = self.topBar.testID;
196
-		}
197
-	}
49
+	[self.topBar applyOn:viewController];
50
+	[self.bottomTabs applyOn:viewController];
51
+	[self.topTab applyOn:viewController];
52
+	[self.bottomTab applyOn:viewController];
53
+	[self.sideMenu applyOn:viewController];
198
 	
54
 	
199
 	if (self.popGesture) {
55
 	if (self.popGesture) {
200
 		viewController.navigationController.interactivePopGestureRecognizer.enabled = [self.popGesture boolValue];
56
 		viewController.navigationController.interactivePopGestureRecognizer.enabled = [self.popGesture boolValue];
205
 		viewController.view.backgroundColor = screenColor;
61
 		viewController.view.backgroundColor = screenColor;
206
 	}
62
 	}
207
 	
63
 	
208
-	if (self.bottomTabs) {
209
-		if (self.bottomTabs.currentTabIndex) {
210
-			[viewController.tabBarController setSelectedIndex:[self.bottomTabs.currentTabIndex unsignedIntegerValue]];
211
-		}
212
-		
213
-		if (self.bottomTabs.currentTabId) {
214
-			[(RNNTabBarController*)viewController.tabBarController setSelectedIndexByContainerID:self.bottomTabs.currentTabId];
215
-		}
216
-		
217
-		if (self.bottomTabs.hidden) {
218
-			[((RNNTabBarController *)viewController.tabBarController) setTabBarHidden:[self.bottomTabs.hidden boolValue] animated:[self.bottomTabs.animateHide boolValue]];
219
-		}
220
-		
221
-		if (self.bottomTabs.testID) {
222
-			viewController.tabBarController.tabBar.accessibilityIdentifier = self.bottomTabs.testID;
223
-		}
224
-		
225
-		if (self.bottomTabs.drawUnder) {
226
-			if ([self.bottomTabs.drawUnder boolValue]) {
227
-				viewController.edgesForExtendedLayout |= UIRectEdgeBottom;
228
-			} else {
229
-				viewController.edgesForExtendedLayout &= ~UIRectEdgeBottom;
230
-			}
231
-		}
232
-		
233
-		[self.bottomTabs resetOptions];
234
-	}
235
-	
236
 	if (self.statusBarBlur) {
64
 	if (self.statusBarBlur) {
237
 		UIView* curBlurView = [viewController.view viewWithTag:BLUR_STATUS_TAG];
65
 		UIView* curBlurView = [viewController.view viewWithTag:BLUR_STATUS_TAG];
238
 		if ([self.statusBarBlur boolValue]) {
66
 		if ([self.statusBarBlur boolValue]) {
249
 		}
77
 		}
250
 	}
78
 	}
251
 	
79
 	
252
-	RNNSideMenuController* sideMenuController = (RNNSideMenuController*)UIApplication.sharedApplication.delegate.window.rootViewController;
253
-	if ([sideMenuController isKindOfClass:[RNNSideMenuController class]]) {
254
-		if (self.sideMenu.leftSideVisible) {
255
-			if (self.sideMenu.leftSideVisible.boolValue) {
256
-				[sideMenuController showSideMenu:MMDrawerSideLeft animated:YES];
257
-			} else {
258
-				[sideMenuController hideSideMenu:MMDrawerSideLeft animated:YES];
259
-			}
260
-		}
261
-		
262
-		if (self.sideMenu.rightSideVisible) {
263
-			if (self.sideMenu.rightSideVisible.boolValue) {
264
-				[sideMenuController showSideMenu:MMDrawerSideRight animated:YES];
265
-			} else {
266
-				[sideMenuController hideSideMenu:MMDrawerSideRight animated:YES];
267
-			}
268
-		}
269
-		
270
-		[self.sideMenu resetOptions];
271
-	}
272
-	
273
 	if (self.backgroundImage) {
80
 	if (self.backgroundImage) {
274
 		UIImageView* backgroundImageView = (viewController.view.subviews.count > 0) ? viewController.view.subviews[0] : nil;
81
 		UIImageView* backgroundImageView = (viewController.view.subviews.count > 0) ? viewController.view.subviews[0] : nil;
275
 		if (![backgroundImageView isKindOfClass:[UIImageView class]]) {
82
 		if (![backgroundImageView isKindOfClass:[UIImageView class]]) {
293
 		backgroundImageView.image = self.rootBackgroundImage;
100
 		backgroundImageView.image = self.rootBackgroundImage;
294
 		[backgroundImageView setContentMode:UIViewContentModeScaleAspectFill];
101
 		[backgroundImageView setContentMode:UIViewContentModeScaleAspectFill];
295
 	}
102
 	}
296
-	
297
-	[self applyTabBarItemOptions:viewController];
298
-	[self applyTopTab:viewController];
299
-}
300
-
301
-- (void)applyTopTab:(RNNRootViewController*)viewController {
302
-	if (self.topTab) {
303
-		if (self.topTab.title) {
304
-			[viewController.topTabsViewController viewController:viewController changedTitle:self.topTab.title];
305
-		}
306
-	}
307
-}
308
-
309
-- (void)applyTabBarItemOptions:(UIViewController*)viewController {
310
-	if (self.tabItem) {
311
-		if (self.tabItem.title || self.tabItem.icon) {
312
-			UITabBarItem* tabItem = [[UITabBarItem alloc] initWithTitle:self.tabItem.title image:[RCTConvert UIImage:self.tabItem.icon] tag:self.tabItem.tag];
313
-			tabItem.accessibilityIdentifier = self.tabItem.testID;
314
-			[viewController.navigationController setTabBarItem:tabItem];
315
-		}
316
-		
317
-		if (self.tabItem.badge) {
318
-			NSString *badge = [RCTConvert NSString:self.tabItem.badge];
319
-			if (viewController.navigationController) {
320
-				viewController.navigationController.tabBarItem.badgeValue = badge;
321
-			} else {
322
-				viewController.tabBarItem.badgeValue = badge;
323
-			}
324
-		}
325
-		
326
-		if (self.tabItem.visible) {
327
-			[viewController.tabBarController setSelectedIndex:[viewController.tabBarController.viewControllers indexOfObject:viewController]];
328
-		}
329
-		
330
-		[self.tabItem resetOptions];
331
-	}
332
 }
103
 }
333
 
104
 
334
 - (UIInterfaceOrientationMask)supportedOrientations {
105
 - (UIInterfaceOrientationMask)supportedOrientations {
357
 	return supportedOrientationsMask;
128
 	return supportedOrientationsMask;
358
 }
129
 }
359
 
130
 
360
--(void)storeOriginalTopBarImages:(UIViewController*)viewController {
361
-	NSMutableDictionary *originalTopBarImages = [@{} mutableCopy];
362
-	UIImage *bgImage = [viewController.navigationController.navigationBar backgroundImageForBarMetrics:UIBarMetricsDefault];
363
-	if (bgImage != nil) {
364
-		originalTopBarImages[@"backgroundImage"] = bgImage;
365
-	}
366
-	UIImage *shadowImage = viewController.navigationController.navigationBar.shadowImage;
367
-	if (shadowImage != nil) {
368
-		originalTopBarImages[@"shadowImage"] = shadowImage;
369
-	}
370
-	self.originalTopBarImages = originalTopBarImages;
371
-}
372
-
373
-
374
 @end
131
 @end

+ 1
- 1
lib/ios/RNNNavigationStackManager.m View File

25
 	self.toVC = newTop;
25
 	self.toVC = newTop;
26
 	self.fromVC = vc;
26
 	self.fromVC = vc;
27
 	
27
 	
28
-	if (self.toVC.isAnimated) {
28
+	if (self.toVC.isCustomTransitioned) {
29
 		vc.navigationController.delegate = newTop;
29
 		vc.navigationController.delegate = newTop;
30
 	} else {
30
 	} else {
31
 		vc.navigationController.delegate = nil;
31
 		vc.navigationController.delegate = nil;

+ 17
- 0
lib/ios/RNNOptions.h View File

1
+#import <Foundation/Foundation.h>
2
+#import <UIKit/UIKit.h>
3
+#import <React/RCTConvert.h>
4
+@protocol RNNOptionsProtocol <NSObject>
5
+
6
+@optional
7
+-(void)resetOptions;
8
+-(void)applyOn:(UIViewController*)viewController;
9
+
10
+@end
11
+
12
+@interface RNNOptions : NSObject <RNNOptionsProtocol>
13
+
14
+-(instancetype)initWithDict:(NSDictionary*)dict;
15
+-(void)mergeWith:(NSDictionary*)otherOptions;
16
+
17
+@end

+ 18
- 0
lib/ios/RNNOptions.m View File

1
+
2
+#import "RNNOptions.h"
3
+
4
+@implementation RNNOptions
5
+
6
+-(instancetype)initWithDict:(NSDictionary *)dict {
7
+	self = [super init];
8
+	[self mergeWith:dict];
9
+	return self;
10
+}
11
+
12
+-(void)mergeWith:(NSDictionary *)otherOptions {
13
+	for (id key in otherOptions) {
14
+		[self setValue:[otherOptions objectForKey:key] forKey:key];
15
+	}
16
+}
17
+
18
+@end

+ 1
- 2
lib/ios/RNNRootViewController.h View File

25
 		   animator:(RNNAnimator*)animator;
25
 		   animator:(RNNAnimator*)animator;
26
 
26
 
27
 
27
 
28
--(void)applyNavigationButtons;
29
 -(void)applyTabBarItem;
28
 -(void)applyTabBarItem;
30
 -(void)applyTopTabsOptions;
29
 -(void)applyTopTabsOptions;
31
 
30
 
32
--(BOOL)isAnimated;
31
+-(BOOL)isCustomTransitioned;
33
 
32
 
34
 @end
33
 @end

+ 4
- 11
lib/ios/RNNRootViewController.m View File

2
 #import "RNNRootViewController.h"
2
 #import "RNNRootViewController.h"
3
 #import <React/RCTConvert.h>
3
 #import <React/RCTConvert.h>
4
 #import "RNNAnimator.h"
4
 #import "RNNAnimator.h"
5
-#import "RNNNavigationButtons.h"
6
 
5
 
7
 @interface RNNRootViewController()
6
 @interface RNNRootViewController()
8
 @property (nonatomic, strong) NSString* containerName;
7
 @property (nonatomic, strong) NSString* containerName;
9
 @property (nonatomic) BOOL _statusBarHidden;
8
 @property (nonatomic) BOOL _statusBarHidden;
10
-@property (nonatomic, strong) RNNNavigationButtons* navigationButtons;
11
 
9
 
12
 @end
10
 @end
13
 
11
 
33
 											   object:nil];
31
 											   object:nil];
34
 	self.navigationController.modalPresentationStyle = UIModalPresentationCustom;
32
 	self.navigationController.modalPresentationStyle = UIModalPresentationCustom;
35
 	self.navigationController.delegate = self;
33
 	self.navigationController.delegate = self;
36
-	self.navigationButtons = [[RNNNavigationButtons alloc] initWithViewController:self];
34
+
37
 	return self;
35
 	return self;
38
 }
36
 }
39
 	
37
 	
40
 -(void)viewWillAppear:(BOOL)animated{
38
 -(void)viewWillAppear:(BOOL)animated{
41
 	[super viewWillAppear:animated];
39
 	[super viewWillAppear:animated];
42
 	[self.navigationOptions applyOn:self];
40
 	[self.navigationOptions applyOn:self];
43
-	[self applyNavigationButtons];
44
 }
41
 }
45
 
42
 
46
 - (void)viewDidLoad {
43
 - (void)viewDidLoad {
47
 	[super viewDidLoad];
44
 	[super viewDidLoad];
48
 }
45
 }
49
 
46
 
50
--(BOOL)isAnimated {
47
+-(BOOL)isCustomTransitioned {
51
 	return self.animator;
48
 	return self.animator;
52
 }
49
 }
53
 
50
 
106
 
103
 
107
 }
104
 }
108
 
105
 
109
--(void)applyNavigationButtons{
110
-	[self.navigationButtons applyLeftButtons:self.navigationOptions.leftButtons rightButtons:self.navigationOptions.rightButtons];
111
-}
112
-
113
 -(void)applyTabBarItem {
106
 -(void)applyTabBarItem {
114
-	[self.navigationOptions applyTabBarItemOptions:self];
107
+	[self.navigationOptions.bottomTab applyOn:self];
115
 }
108
 }
116
 
109
 
117
 -(void)applyTopTabsOptions {
110
 -(void)applyTopTabsOptions {
118
-	[self.navigationOptions applyTopTab:self];
111
+	[self.navigationOptions.topTab applyOn:self];
119
 }
112
 }
120
 
113
 
121
 /**
114
 /**

+ 2
- 1
lib/ios/RNNRootViewProtocol.h View File

1
+#import "RNNNavigationOptions.h"
1
 
2
 
2
 @protocol RNNRootViewProtocol <NSObject, UINavigationControllerDelegate>
3
 @protocol RNNRootViewProtocol <NSObject, UINavigationControllerDelegate>
3
 
4
 
4
 @required
5
 @required
5
 
6
 
6
-- (BOOL)isAnimated;
7
+- (BOOL)isCustomTransitioned;
7
 
8
 
8
 @end
9
 @end
9
 
10
 

+ 1
- 1
lib/ios/RNNSideMenuChildVC.m View File

33
 	return self;
33
 	return self;
34
 }
34
 }
35
 
35
 
36
-- (BOOL)isAnimated {
36
+- (BOOL)isCustomTransitioned {
37
 	return NO;
37
 	return NO;
38
 }
38
 }
39
 
39
 

+ 1
- 1
lib/ios/RNNSideMenuController.m View File

72
 	}
72
 	}
73
 }
73
 }
74
 
74
 
75
-- (BOOL)isAnimated {
75
+- (BOOL)isCustomTransitioned {
76
 	return NO;
76
 	return NO;
77
 }
77
 }
78
 
78
 

+ 2
- 8
lib/ios/RNNSideMenuOptions.h View File

1
-#import <Foundation/Foundation.h>
1
+#import "RNNOptions.h"
2
 
2
 
3
-@interface RNNSideMenuOptions : NSObject
3
+@interface RNNSideMenuOptions : RNNOptions
4
 
4
 
5
 @property (nonatomic, strong) NSNumber* leftSideVisible;
5
 @property (nonatomic, strong) NSNumber* leftSideVisible;
6
 @property (nonatomic, strong) NSNumber* rightSideVisible;
6
 @property (nonatomic, strong) NSNumber* rightSideVisible;
7
 
7
 
8
--(instancetype)init;
9
--(instancetype)initWithDict:(NSDictionary *)sideMenuOptions;
10
--(void)mergeWith:(NSDictionary*)otherOptions;
11
-
12
--(void)resetOptions;
13
-
14
 @end
8
 @end

+ 22
- 10
lib/ios/RNNSideMenuOptions.m View File

1
 #import "RNNSideMenuOptions.h"
1
 #import "RNNSideMenuOptions.h"
2
+#import "RNNSideMenuController.h"
2
 
3
 
3
 @implementation RNNSideMenuOptions
4
 @implementation RNNSideMenuOptions
4
 
5
 
5
--(instancetype)init {
6
-	return [self initWithDict:@{}];
7
-}
8
-
9
--(instancetype)initWithDict:(NSDictionary *)sideMenuOptions {
10
-	self = [super init];
11
-	
12
-	[self mergeWith:sideMenuOptions];
13
-	
14
-	return self;
6
+- (void)applyOn:(UIViewController *)viewController {
7
+	RNNSideMenuController* sideMenuController = (RNNSideMenuController*)UIApplication.sharedApplication.delegate.window.rootViewController;
8
+	if ([sideMenuController isKindOfClass:[RNNSideMenuController class]]) {
9
+		if (self.leftSideVisible) {
10
+			if (self.leftSideVisible.boolValue) {
11
+				[sideMenuController showSideMenu:MMDrawerSideLeft animated:YES];
12
+			} else {
13
+				[sideMenuController hideSideMenu:MMDrawerSideLeft animated:YES];
14
+			}
15
+		}
16
+		
17
+		if (self.rightSideVisible) {
18
+			if (self.rightSideVisible.boolValue) {
19
+				[sideMenuController showSideMenu:MMDrawerSideRight animated:YES];
20
+			} else {
21
+				[sideMenuController hideSideMenu:MMDrawerSideRight animated:YES];
22
+			}
23
+		}
24
+		
25
+		[self resetOptions];
26
+	}
15
 }
27
 }
16
 
28
 
17
 -(void)mergeWith:(NSDictionary *)otherOptions {
29
 -(void)mergeWith:(NSDictionary *)otherOptions {

+ 1
- 1
lib/ios/RNNTabBarController.m View File

33
 	}
33
 	}
34
 }
34
 }
35
 
35
 
36
-- (BOOL)isAnimated {
36
+- (BOOL)isCustomTransitioned {
37
 	return NO;
37
 	return NO;
38
 }
38
 }
39
 
39
 

+ 0
- 32
lib/ios/RNNTabBarOptions.m View File

1
-#import "RNNTabBarOptions.h"
2
-
3
-@implementation RNNTabBarOptions
4
-
5
--(instancetype)init {
6
-	return [self initWithDict:@{}];
7
-}
8
-
9
--(instancetype)initWithDict:(NSDictionary *)tabBarOptions {
10
-	self = [super init];
11
-	
12
-	self.hidden = [tabBarOptions valueForKey:@"hidden"];
13
-	self.animateHide = [tabBarOptions valueForKey:@"animateHide"];
14
-	self.currentTabIndex = [tabBarOptions valueForKey:@"currentTabIndex"];
15
-	self.testID = [tabBarOptions valueForKey:@"testID"];
16
-	self.currentTabId = [tabBarOptions valueForKey:@"currentTabId"];
17
-	self.drawUnder = [tabBarOptions valueForKey:@"drawUnder"];
18
-	
19
-	return self;
20
-}
21
-
22
-- (void)resetOptions {
23
-	self.currentTabId = nil;
24
-	self.currentTabIndex = nil;
25
-}
26
-
27
--(void)mergeWith:(NSDictionary *)otherOptions {
28
-	for (id key in otherOptions) {
29
-		[self setValue:[otherOptions objectForKey:key] forKey:key];
30
-	}
31
-}
32
-@end

+ 0
- 32
lib/ios/RNNTabItemOptions.m View File

1
-#import "RNNTabItemOptions.h"
2
-
3
-@implementation RNNTabItemOptions
4
-
5
--(instancetype)initWithDict:(NSDictionary *)tabItemDict {
6
-	self = [super init];
7
-	
8
-	self.title = tabItemDict[@"title"];
9
-	self.tag = [tabItemDict[@"tag"] integerValue];
10
-	self.badge = tabItemDict[@"badge"];
11
-	self.testID = tabItemDict[@"testID"];
12
-	self.visible = tabItemDict[@"visible"];
13
-	self.icon = tabItemDict[@"icon"];
14
-	
15
-	return self;
16
-}
17
-
18
--(void)mergeWith:(NSDictionary *)otherOptions {
19
-	for (id key in otherOptions) {
20
-		[self setValue:[otherOptions objectForKey:key] forKey:key];
21
-	}
22
-}
23
-
24
--(void)resetOptions {
25
-	self.title = nil;
26
-	self.badge = nil;
27
-	self.visible = nil;
28
-	self.icon = nil;
29
-	self.testID = nil;
30
-}
31
-
32
-@end

+ 4
- 8
lib/ios/RNNTopBarOptions.h View File

1
-#import <Foundation/Foundation.h>
1
+#import "RNNOptions.h"
2
 
2
 
3
-extern const NSInteger BLUR_TOPBAR_TAG;
4
-
5
-@interface RNNTopBarOptions : NSObject
3
+@interface RNNTopBarOptions : RNNOptions
6
 
4
 
5
+@property (nonatomic, strong) NSArray* leftButtons;
6
+@property (nonatomic, strong) NSArray* rightButtons;
7
 @property (nonatomic, strong) NSNumber* backgroundColor;
7
 @property (nonatomic, strong) NSNumber* backgroundColor;
8
 @property (nonatomic, strong) NSNumber* textColor;
8
 @property (nonatomic, strong) NSNumber* textColor;
9
 @property (nonatomic, strong) NSString* title;
9
 @property (nonatomic, strong) NSString* title;
21
 @property (nonatomic, strong) NSNumber* largeTitle;
21
 @property (nonatomic, strong) NSNumber* largeTitle;
22
 @property (nonatomic, strong) NSString* testID;
22
 @property (nonatomic, strong) NSString* testID;
23
 
23
 
24
--(instancetype)init;
25
--(instancetype)initWithDict:(NSDictionary *)topBarOptions;
26
--(void)mergeWith:(NSDictionary*)otherOptions;
27
-
28
 @end
24
 @end

+ 164
- 28
lib/ios/RNNTopBarOptions.m View File

1
 #import "RNNTopBarOptions.h"
1
 #import "RNNTopBarOptions.h"
2
+#import "RNNNavigationButtons.h"
2
 
3
 
3
-@implementation RNNTopBarOptions
4
+extern const NSInteger BLUR_TOPBAR_TAG;
4
 
5
 
5
--(instancetype)init {
6
-	return [self initWithDict:@{}];
7
-}
6
+@interface RNNTopBarOptions ()
7
+
8
+@property (nonatomic, strong) NSMutableDictionary* originalTopBarImages;
9
+@property (nonatomic, strong) RNNNavigationButtons* navigationButtons;
10
+
11
+@end
8
 
12
 
9
--(instancetype)initWithDict:(NSDictionary *)topBarOptions {
10
-	self = [super init];
11
-	
12
-	self.title = [topBarOptions valueForKey:@"title"];
13
-	self.backgroundColor = [topBarOptions valueForKey:@"backgroundColor"];
14
-	self.textColor = [topBarOptions valueForKey:@"textColor"];
15
-	self.textFontFamily = [topBarOptions valueForKey:@"textFontFamily"];
16
-	self.textFontSize = [topBarOptions valueForKey:@"textFontSize"];
17
-	self.hidden = [topBarOptions valueForKey:@"hidden"];
18
-	self.hideOnScroll = [topBarOptions valueForKey:@"hideOnScroll"];
19
-	self.buttonColor = [topBarOptions valueForKey:@"buttonColor"];
20
-	self.blur = [topBarOptions valueForKey:@"blur"];
21
-	self.translucent = [topBarOptions valueForKey:@"translucent"];
22
-	self.transparent = [topBarOptions valueForKey:@"transparent"];
23
-	self.noBorder = [topBarOptions valueForKey:@"noBorder"];
24
-	self.animateHide = [topBarOptions valueForKey:@"animateHide"];
25
-	self.largeTitle = [topBarOptions valueForKey:@"largeTitle"];
26
-	self.testID = [topBarOptions valueForKey:@"testID"];
27
-	self.drawUnder = [topBarOptions valueForKey:@"drawUnder"];
28
-	
29
-	return self;
13
+@implementation RNNTopBarOptions
14
+
15
+- (void)applyOn:(UIViewController*)viewController {
16
+	if (self.backgroundColor) {
17
+		UIColor* backgroundColor = [RCTConvert UIColor:self.backgroundColor];
18
+		viewController.navigationController.navigationBar.barTintColor = backgroundColor;
19
+	} else {
20
+		viewController.navigationController.navigationBar.barTintColor = nil;
21
+	}
22
+	
23
+	if (self.title) {
24
+		viewController.navigationItem.title = self.title;
25
+	}
26
+	
27
+	if (@available(iOS 11.0, *)) {
28
+		if (self.largeTitle){
29
+			if ([self.largeTitle boolValue]) {
30
+				viewController.navigationController.navigationBar.prefersLargeTitles = YES;
31
+				viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
32
+			} else {
33
+				viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
34
+			}
35
+		} else {
36
+			viewController.navigationController.navigationBar.prefersLargeTitles = NO;
37
+			viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
38
+		}
39
+	}
40
+	
41
+	
42
+	if (self.textFontFamily || self.textFontSize || self.textColor) {
43
+		NSMutableDictionary* navigationBarTitleTextAttributes = [NSMutableDictionary new];
44
+		if (self.textColor) {
45
+			navigationBarTitleTextAttributes[NSForegroundColorAttributeName] = [RCTConvert UIColor:[self valueForKey:@"textColor"]];
46
+		}
47
+		if (self.textFontFamily){
48
+			if(self.textFontSize) {
49
+				navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont fontWithName:self.textFontFamily size:[self.textFontSize floatValue]];
50
+			} else {
51
+				navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont fontWithName:self.textFontFamily size:20];
52
+			}
53
+		} else if (self.textFontSize) {
54
+			navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont systemFontOfSize:[self.textFontSize floatValue]];
55
+		}
56
+		viewController.navigationController.navigationBar.titleTextAttributes = navigationBarTitleTextAttributes;
57
+		if (@available(iOS 11.0, *)){
58
+			viewController.navigationController.navigationBar.largeTitleTextAttributes = navigationBarTitleTextAttributes;
59
+		}
60
+		
61
+	}
62
+	
63
+	
64
+	if (self.hidden){
65
+		[viewController.navigationController setNavigationBarHidden:[self.hidden boolValue] animated:[self.animateHide boolValue]];
66
+	}
67
+	
68
+	if (self.hideOnScroll) {
69
+		viewController.navigationController.hidesBarsOnSwipe = [self.hideOnScroll boolValue];
70
+	}
71
+	
72
+	if (self.buttonColor) {
73
+		UIColor* buttonColor = [RCTConvert UIColor:self.buttonColor];
74
+		viewController.navigationController.navigationBar.tintColor = buttonColor;
75
+	} else {
76
+		viewController.navigationController.navigationBar.tintColor = nil;
77
+	}
78
+	
79
+	if ([self.blur boolValue]) {
80
+		if (![viewController.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]) {
81
+			
82
+			[viewController.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
83
+			viewController.navigationController.navigationBar.shadowImage = [UIImage new];
84
+			UIVisualEffectView *blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
85
+			CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
86
+			blur.frame = CGRectMake(0, -1 * statusBarFrame.size.height, viewController.navigationController.navigationBar.frame.size.width, viewController.navigationController.navigationBar.frame.size.height + statusBarFrame.size.height);
87
+			blur.userInteractionEnabled = NO;
88
+			blur.tag = BLUR_TOPBAR_TAG;
89
+			[viewController.navigationController.navigationBar insertSubview:blur atIndex:0];
90
+			[viewController.navigationController.navigationBar sendSubviewToBack:blur];
91
+		}
92
+	} else {
93
+		UIView *blur = [viewController.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG];
94
+		if (blur) {
95
+			[viewController.navigationController.navigationBar setBackgroundImage: nil forBarMetrics:UIBarMetricsDefault];
96
+			viewController.navigationController.navigationBar.shadowImage = nil;
97
+			[blur removeFromSuperview];
98
+		}
99
+	}
100
+	
101
+	void (^disableTopBarTransparent)() = ^void(){
102
+		UIView *transparentView = [viewController.navigationController.navigationBar viewWithTag:TOP_BAR_TRANSPARENT_TAG];
103
+		if (transparentView){
104
+			[transparentView removeFromSuperview];
105
+			[viewController.navigationController.navigationBar setBackgroundImage:self.originalTopBarImages[@"backgroundImage"] forBarMetrics:UIBarMetricsDefault];
106
+			viewController.navigationController.navigationBar.shadowImage = self.originalTopBarImages[@"shadowImage"];
107
+			self.originalTopBarImages = nil;
108
+		}
109
+	};
110
+	
111
+	if (self.transparent) {
112
+		if ([self.transparent boolValue]) {
113
+			if (![viewController.navigationController.navigationBar viewWithTag:TOP_BAR_TRANSPARENT_TAG]){
114
+				[self storeOriginalTopBarImages:viewController];
115
+				[viewController.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
116
+				viewController.navigationController.navigationBar.shadowImage = [UIImage new];
117
+				UIView *transparentView = [[UIView alloc] initWithFrame:CGRectZero];
118
+				transparentView.tag = TOP_BAR_TRANSPARENT_TAG;
119
+				[viewController.navigationController.navigationBar insertSubview:transparentView atIndex:0];
120
+			}
121
+		} else {
122
+			disableTopBarTransparent();
123
+		}
124
+	} else {
125
+		disableTopBarTransparent();
126
+	}
127
+	
128
+	if (self.translucent) {
129
+		viewController.navigationController.navigationBar.translucent = [self.translucent boolValue];
130
+	}
131
+	
132
+	if (self.drawUnder) {
133
+		if ([self.drawUnder boolValue]) {
134
+			viewController.edgesForExtendedLayout |= UIRectEdgeTop;
135
+		} else {
136
+			viewController.edgesForExtendedLayout &= ~UIRectEdgeTop;
137
+		}
138
+	}
139
+	
140
+	if (self.noBorder) {
141
+		if ([self.noBorder boolValue]) {
142
+			viewController.navigationController.navigationBar
143
+			.shadowImage = [[UIImage alloc] init];
144
+		} else {
145
+			viewController.navigationController.navigationBar
146
+			.shadowImage = nil;
147
+		}
148
+	}
149
+	
150
+	if (self.testID) {
151
+		viewController.navigationController.navigationBar.accessibilityIdentifier = self.testID;
152
+	}
153
+	
154
+	if (self.rightButtons || self.leftButtons) {
155
+		_navigationButtons = [[RNNNavigationButtons alloc] initWithViewController:(RNNRootViewController*)viewController];
156
+		[_navigationButtons applyLeftButtons:self.leftButtons rightButtons:self.rightButtons];
157
+	}
30
 }
158
 }
31
 
159
 
32
--(void)mergeWith:(NSDictionary *)otherOptions {
33
-	for (id key in otherOptions) {
34
-		[self setValue:[otherOptions objectForKey:key] forKey:key];
160
+-(void)storeOriginalTopBarImages:(UIViewController*)viewController {
161
+	NSMutableDictionary *originalTopBarImages = [@{} mutableCopy];
162
+	UIImage *bgImage = [viewController.navigationController.navigationBar backgroundImageForBarMetrics:UIBarMetricsDefault];
163
+	if (bgImage != nil) {
164
+		originalTopBarImages[@"backgroundImage"] = bgImage;
35
 	}
165
 	}
166
+	UIImage *shadowImage = viewController.navigationController.navigationBar.shadowImage;
167
+	if (shadowImage != nil) {
168
+		originalTopBarImages[@"shadowImage"] = shadowImage;
169
+	}
170
+	self.originalTopBarImages = originalTopBarImages;
36
 }
171
 }
172
+
37
 @end
173
 @end
38
 
174
 
39
 
175
 

+ 3
- 8
lib/ios/RNNTopTabOptions.h View File

1
-#import <Foundation/Foundation.h>
1
+#import "RNNOptions.h"
2
 
2
 
3
-extern const NSInteger BLUR_TOPBAR_TAG;
4
-
5
-@interface RNNTopTabOptions : NSObject
3
+@interface RNNTopTabOptions : RNNOptions
6
 
4
 
7
 @property (nonatomic, strong) NSString* title;
5
 @property (nonatomic, strong) NSString* title;
8
-
9
--(instancetype)init;
10
--(instancetype)initWithDict:(NSDictionary *)topBarOptions;
11
--(void)mergeWith:(NSDictionary*)otherOptions;
6
+@property (nonatomic, strong) NSString* titleFontFamily;
12
 
7
 
13
 @end
8
 @end
14
 
9
 

+ 5
- 10
lib/ios/RNNTopTabOptions.m View File

1
 #import "RNNTopTabOptions.h"
1
 #import "RNNTopTabOptions.h"
2
+#import "RNNRootViewController.h"
2
 
3
 
3
 @implementation RNNTopTabOptions
4
 @implementation RNNTopTabOptions
4
 
5
 
5
--(instancetype)init {
6
-	return [self initWithDict:@{}];
7
-}
8
-
9
--(instancetype)initWithDict:(NSDictionary *)tabBarOptions {
10
-	self = [super init];
11
-	
12
-	self.title = [tabBarOptions valueForKey:@"title"];
13
-	
14
-	return self;
6
+- (void)applyOn:(RNNRootViewController*)viewController {
7
+	if (self.title) {
8
+		[viewController.topTabsViewController viewController:viewController changedTitle:self.title];
9
+	}
15
 }
10
 }
16
 
11
 
17
 -(void)mergeWith:(NSDictionary *)otherOptions {
12
 -(void)mergeWith:(NSDictionary *)otherOptions {

+ 7
- 0
lib/ios/RNNTopTabsOptions.h View File

1
+#import "RNNOptions.h"
2
+
3
+@interface RNNTopTabsOptions : RNNOptions
4
+
5
+@property (nonatomic, strong) NSNumber* backgroundColor;
6
+
7
+@end

+ 10
- 0
lib/ios/RNNTopTabsOptions.m View File

1
+#import "RNNTopTabsOptions.h"
2
+#import "RNNTopTabsViewController.h"
3
+
4
+@implementation RNNTopTabsOptions
5
+
6
+- (void)applyOn:(RNNTopTabsViewController *)viewController {
7
+
8
+}
9
+
10
+@end

+ 2
- 2
lib/ios/RNNTopTabsViewController.m View File

15
 
15
 
16
 - (instancetype)init {
16
 - (instancetype)init {
17
 	self = [super init];
17
 	self = [super init];
18
-		
18
+	
19
 	[self.view setBackgroundColor:[UIColor whiteColor]];
19
 	[self.view setBackgroundColor:[UIColor whiteColor]];
20
 	self.edgesForExtendedLayout = UIRectEdgeNone;
20
 	self.edgesForExtendedLayout = UIRectEdgeNone;
21
 	
21
 	
72
     [super viewDidLoad];
72
     [super viewDidLoad];
73
 }
73
 }
74
 
74
 
75
-- (BOOL)isAnimated {
75
+- (BOOL)isCustomTransitioned {
76
 	return NO;
76
 	return NO;
77
 }
77
 }
78
 
78
 

+ 48
- 22
lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj View File

57
 		268692831E5054F800E2C612 /* RNNStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 268692811E5054F800E2C612 /* RNNStore.m */; };
57
 		268692831E5054F800E2C612 /* RNNStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 268692811E5054F800E2C612 /* RNNStore.m */; };
58
 		26916C981E4B9E7700D13680 /* RNNReactRootViewCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = 26916C961E4B9E7700D13680 /* RNNReactRootViewCreator.h */; };
58
 		26916C981E4B9E7700D13680 /* RNNReactRootViewCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = 26916C961E4B9E7700D13680 /* RNNReactRootViewCreator.h */; };
59
 		26916C991E4B9E7700D13680 /* RNNReactRootViewCreator.m in Sources */ = {isa = PBXBuildFile; fileRef = 26916C971E4B9E7700D13680 /* RNNReactRootViewCreator.m */; };
59
 		26916C991E4B9E7700D13680 /* RNNReactRootViewCreator.m in Sources */ = {isa = PBXBuildFile; fileRef = 26916C971E4B9E7700D13680 /* RNNReactRootViewCreator.m */; };
60
+		504AFE641FFE53070076E904 /* RNNOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 504AFE621FFE53070076E904 /* RNNOptions.h */; };
61
+		504AFE651FFE53070076E904 /* RNNOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 504AFE631FFE53070076E904 /* RNNOptions.m */; };
62
+		504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 504AFE721FFFF0540076E904 /* RNNTopTabsOptions.h */; };
63
+		504AFE751FFFF0540076E904 /* RNNTopTabsOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */; };
64
+		504AFE761FFFF1E00076E904 /* RNNNavigationOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E83BAD691F27362500A9F3DD /* RNNNavigationOptions.h */; };
65
+		504AFE771FFFF1E20076E904 /* RNNTopBarOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = A7626BFE1FC2FB6700492FB8 /* RNNTopBarOptions.h */; };
60
 		507F43C51FF4F17C00D9425B /* RNNTopTabsViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */; };
66
 		507F43C51FF4F17C00D9425B /* RNNTopTabsViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */; };
61
 		507F43C61FF4F17C00D9425B /* RNNTopTabsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 507F43C41FF4F17C00D9425B /* RNNTopTabsViewController.m */; };
67
 		507F43C61FF4F17C00D9425B /* RNNTopTabsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 507F43C41FF4F17C00D9425B /* RNNTopTabsViewController.m */; };
62
 		507F43C91FF4F9CC00D9425B /* RNNTopTabOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F43C71FF4F9CC00D9425B /* RNNTopTabOptions.h */; };
68
 		507F43C91FF4F9CC00D9425B /* RNNTopTabOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F43C71FF4F9CC00D9425B /* RNNTopTabOptions.h */; };
68
 		507F44201FFA8A8800D9425B /* RNNRootViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F441F1FFA8A8800D9425B /* RNNRootViewProtocol.h */; };
74
 		507F44201FFA8A8800D9425B /* RNNRootViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F441F1FFA8A8800D9425B /* RNNRootViewProtocol.h */; };
69
 		50CB3B691FDE911400AA153B /* RNNSideMenuOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50CB3B671FDE911400AA153B /* RNNSideMenuOptions.h */; };
75
 		50CB3B691FDE911400AA153B /* RNNSideMenuOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50CB3B671FDE911400AA153B /* RNNSideMenuOptions.h */; };
70
 		50CB3B6A1FDE911400AA153B /* RNNSideMenuOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */; };
76
 		50CB3B6A1FDE911400AA153B /* RNNSideMenuOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */; };
71
-		50EB93411FE14A3E00BD8EEE /* RNNTabItemOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50EB933F1FE14A3E00BD8EEE /* RNNTabItemOptions.h */; };
72
-		50EB93421FE14A3E00BD8EEE /* RNNTabItemOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50EB93401FE14A3E00BD8EEE /* RNNTabItemOptions.m */; };
77
+		50EB93421FE14A3E00BD8EEE /* RNNBottomTabOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50EB93401FE14A3E00BD8EEE /* RNNBottomTabOptions.m */; };
73
 		50F5DFC11F407A8C001A00BC /* RNNTabBarController.h in Headers */ = {isa = PBXBuildFile; fileRef = 50F5DFBF1F407A8C001A00BC /* RNNTabBarController.h */; };
78
 		50F5DFC11F407A8C001A00BC /* RNNTabBarController.h in Headers */ = {isa = PBXBuildFile; fileRef = 50F5DFBF1F407A8C001A00BC /* RNNTabBarController.h */; };
74
 		50F5DFC21F407A8C001A00BC /* RNNTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50F5DFC01F407A8C001A00BC /* RNNTabBarController.m */; };
79
 		50F5DFC21F407A8C001A00BC /* RNNTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50F5DFC01F407A8C001A00BC /* RNNTabBarController.m */; };
75
 		50F5DFC51F407AA0001A00BC /* RNNNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 50F5DFC31F407AA0001A00BC /* RNNNavigationController.h */; };
80
 		50F5DFC51F407AA0001A00BC /* RNNNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 50F5DFC31F407AA0001A00BC /* RNNNavigationController.h */; };
111
 		7BEF0D1C1E43771B003E96B0 /* RNNLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BEF0D1A1E43771B003E96B0 /* RNNLayoutNode.h */; };
116
 		7BEF0D1C1E43771B003E96B0 /* RNNLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BEF0D1A1E43771B003E96B0 /* RNNLayoutNode.h */; };
112
 		7BEF0D1D1E43771B003E96B0 /* RNNLayoutNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BEF0D1B1E43771B003E96B0 /* RNNLayoutNode.m */; };
117
 		7BEF0D1D1E43771B003E96B0 /* RNNLayoutNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BEF0D1B1E43771B003E96B0 /* RNNLayoutNode.m */; };
113
 		A7626BFD1FC2FB2C00492FB8 /* RNNTopBarOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = A7626BFC1FC2FB2C00492FB8 /* RNNTopBarOptions.m */; };
118
 		A7626BFD1FC2FB2C00492FB8 /* RNNTopBarOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = A7626BFC1FC2FB2C00492FB8 /* RNNTopBarOptions.m */; };
114
-		A7626C011FC5796200492FB8 /* RNNTabBarOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = A7626C001FC5796200492FB8 /* RNNTabBarOptions.m */; };
119
+		A7626C011FC5796200492FB8 /* RNNBottomTabsOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = A7626C001FC5796200492FB8 /* RNNBottomTabsOptions.m */; };
115
 		E8367B801F7A8A4700675C05 /* VICMAImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = E8367B7E1F7A8A4700675C05 /* VICMAImageView.h */; };
120
 		E8367B801F7A8A4700675C05 /* VICMAImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = E8367B7E1F7A8A4700675C05 /* VICMAImageView.h */; };
116
 		E8367B811F7A8A4700675C05 /* VICMAImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8367B7F1F7A8A4700675C05 /* VICMAImageView.m */; };
121
 		E8367B811F7A8A4700675C05 /* VICMAImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8367B7F1F7A8A4700675C05 /* VICMAImageView.m */; };
117
 		E83BAD681F2734B500A9F3DD /* RNNNavigationOptionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E83BAD671F2734B500A9F3DD /* RNNNavigationOptionsTest.m */; };
122
 		E83BAD681F2734B500A9F3DD /* RNNNavigationOptionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E83BAD671F2734B500A9F3DD /* RNNNavigationOptionsTest.m */; };
216
 		26916C941E4B9CCC00D13680 /* RNNRootViewCreator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNRootViewCreator.h; sourceTree = "<group>"; };
221
 		26916C941E4B9CCC00D13680 /* RNNRootViewCreator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNRootViewCreator.h; sourceTree = "<group>"; };
217
 		26916C961E4B9E7700D13680 /* RNNReactRootViewCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNReactRootViewCreator.h; sourceTree = "<group>"; };
222
 		26916C961E4B9E7700D13680 /* RNNReactRootViewCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNReactRootViewCreator.h; sourceTree = "<group>"; };
218
 		26916C971E4B9E7700D13680 /* RNNReactRootViewCreator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNReactRootViewCreator.m; sourceTree = "<group>"; };
223
 		26916C971E4B9E7700D13680 /* RNNReactRootViewCreator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNReactRootViewCreator.m; sourceTree = "<group>"; };
224
+		504AFE621FFE53070076E904 /* RNNOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNOptions.h; sourceTree = "<group>"; };
225
+		504AFE631FFE53070076E904 /* RNNOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNOptions.m; sourceTree = "<group>"; };
226
+		504AFE721FFFF0540076E904 /* RNNTopTabsOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabsOptions.h; sourceTree = "<group>"; };
227
+		504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTopTabsOptions.m; sourceTree = "<group>"; };
219
 		507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabsViewController.h; sourceTree = "<group>"; };
228
 		507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabsViewController.h; sourceTree = "<group>"; };
220
 		507F43C41FF4F17C00D9425B /* RNNTopTabsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTopTabsViewController.m; sourceTree = "<group>"; };
229
 		507F43C41FF4F17C00D9425B /* RNNTopTabsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTopTabsViewController.m; sourceTree = "<group>"; };
221
 		507F43C71FF4F9CC00D9425B /* RNNTopTabOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabOptions.h; sourceTree = "<group>"; };
230
 		507F43C71FF4F9CC00D9425B /* RNNTopTabOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabOptions.h; sourceTree = "<group>"; };
227
 		507F441F1FFA8A8800D9425B /* RNNRootViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNRootViewProtocol.h; sourceTree = "<group>"; };
236
 		507F441F1FFA8A8800D9425B /* RNNRootViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNRootViewProtocol.h; sourceTree = "<group>"; };
228
 		50CB3B671FDE911400AA153B /* RNNSideMenuOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNSideMenuOptions.h; sourceTree = "<group>"; };
237
 		50CB3B671FDE911400AA153B /* RNNSideMenuOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNSideMenuOptions.h; sourceTree = "<group>"; };
229
 		50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuOptions.m; sourceTree = "<group>"; };
238
 		50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuOptions.m; sourceTree = "<group>"; };
230
-		50EB933F1FE14A3E00BD8EEE /* RNNTabItemOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTabItemOptions.h; sourceTree = "<group>"; };
231
-		50EB93401FE14A3E00BD8EEE /* RNNTabItemOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTabItemOptions.m; sourceTree = "<group>"; };
239
+		50EB933F1FE14A3E00BD8EEE /* RNNBottomTabOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNBottomTabOptions.h; sourceTree = "<group>"; };
240
+		50EB93401FE14A3E00BD8EEE /* RNNBottomTabOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNBottomTabOptions.m; sourceTree = "<group>"; };
232
 		50F5DFBF1F407A8C001A00BC /* RNNTabBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTabBarController.h; sourceTree = "<group>"; };
241
 		50F5DFBF1F407A8C001A00BC /* RNNTabBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTabBarController.h; sourceTree = "<group>"; };
233
 		50F5DFC01F407A8C001A00BC /* RNNTabBarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTabBarController.m; sourceTree = "<group>"; };
242
 		50F5DFC01F407A8C001A00BC /* RNNTabBarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTabBarController.m; sourceTree = "<group>"; };
234
 		50F5DFC31F407AA0001A00BC /* RNNNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNNavigationController.h; sourceTree = "<group>"; };
243
 		50F5DFC31F407AA0001A00BC /* RNNNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNNavigationController.h; sourceTree = "<group>"; };
272
 		7BEF0D1B1E43771B003E96B0 /* RNNLayoutNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNLayoutNode.m; sourceTree = "<group>"; };
281
 		7BEF0D1B1E43771B003E96B0 /* RNNLayoutNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNLayoutNode.m; sourceTree = "<group>"; };
273
 		A7626BFC1FC2FB2C00492FB8 /* RNNTopBarOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTopBarOptions.m; sourceTree = "<group>"; };
282
 		A7626BFC1FC2FB2C00492FB8 /* RNNTopBarOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTopBarOptions.m; sourceTree = "<group>"; };
274
 		A7626BFE1FC2FB6700492FB8 /* RNNTopBarOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopBarOptions.h; sourceTree = "<group>"; };
283
 		A7626BFE1FC2FB6700492FB8 /* RNNTopBarOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopBarOptions.h; sourceTree = "<group>"; };
275
-		A7626BFF1FC578AB00492FB8 /* RNNTabBarOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTabBarOptions.h; sourceTree = "<group>"; };
276
-		A7626C001FC5796200492FB8 /* RNNTabBarOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTabBarOptions.m; sourceTree = "<group>"; };
284
+		A7626BFF1FC578AB00492FB8 /* RNNBottomTabsOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNBottomTabsOptions.h; sourceTree = "<group>"; };
285
+		A7626C001FC5796200492FB8 /* RNNBottomTabsOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNBottomTabsOptions.m; sourceTree = "<group>"; };
277
 		D8AFADBD1BEE6F3F00A4592D /* libReactNativeNavigation.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactNativeNavigation.a; sourceTree = BUILT_PRODUCTS_DIR; };
286
 		D8AFADBD1BEE6F3F00A4592D /* libReactNativeNavigation.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactNativeNavigation.a; sourceTree = BUILT_PRODUCTS_DIR; };
278
 		E8367B7E1F7A8A4700675C05 /* VICMAImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VICMAImageView.h; sourceTree = "<group>"; };
287
 		E8367B7E1F7A8A4700675C05 /* VICMAImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VICMAImageView.h; sourceTree = "<group>"; };
279
 		E8367B7F1F7A8A4700675C05 /* VICMAImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VICMAImageView.m; sourceTree = "<group>"; };
288
 		E8367B7F1F7A8A4700675C05 /* VICMAImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VICMAImageView.m; sourceTree = "<group>"; };
414
 			path = Animations;
423
 			path = Animations;
415
 			sourceTree = "<group>";
424
 			sourceTree = "<group>";
416
 		};
425
 		};
426
+		504AFE611FFE52EF0076E904 /* Options */ = {
427
+			isa = PBXGroup;
428
+			children = (
429
+				504AFE621FFE53070076E904 /* RNNOptions.h */,
430
+				504AFE631FFE53070076E904 /* RNNOptions.m */,
431
+				E83BAD691F27362500A9F3DD /* RNNNavigationOptions.h */,
432
+				E83BAD6A1F27363A00A9F3DD /* RNNNavigationOptions.m */,
433
+				A7626BFE1FC2FB6700492FB8 /* RNNTopBarOptions.h */,
434
+				A7626BFC1FC2FB2C00492FB8 /* RNNTopBarOptions.m */,
435
+				A7626BFF1FC578AB00492FB8 /* RNNBottomTabsOptions.h */,
436
+				A7626C001FC5796200492FB8 /* RNNBottomTabsOptions.m */,
437
+				50EB933F1FE14A3E00BD8EEE /* RNNBottomTabOptions.h */,
438
+				50EB93401FE14A3E00BD8EEE /* RNNBottomTabOptions.m */,
439
+				507F43C71FF4F9CC00D9425B /* RNNTopTabOptions.h */,
440
+				507F43C81FF4F9CC00D9425B /* RNNTopTabOptions.m */,
441
+				504AFE721FFFF0540076E904 /* RNNTopTabsOptions.h */,
442
+				504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */,
443
+				50CB3B671FDE911400AA153B /* RNNSideMenuOptions.h */,
444
+				50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */,
445
+			);
446
+			name = Options;
447
+			sourceTree = "<group>";
448
+		};
417
 		507F43F11FF4FCD800D9425B /* HMSegmentControl */ = {
449
 		507F43F11FF4FCD800D9425B /* HMSegmentControl */ = {
418
 			isa = PBXGroup;
450
 			isa = PBXGroup;
419
 			children = (
451
 			children = (
428
 			children = (
460
 			children = (
429
 				E8AEDB471F584175000F5A6A /* Components */,
461
 				E8AEDB471F584175000F5A6A /* Components */,
430
 				E8AEDB461F58414D000F5A6A /* Animations */,
462
 				E8AEDB461F58414D000F5A6A /* Animations */,
463
+				504AFE611FFE52EF0076E904 /* Options */,
431
 				261F0E621E6EC94900989DE2 /* RNNModalManager.h */,
464
 				261F0E621E6EC94900989DE2 /* RNNModalManager.h */,
432
 				261F0E631E6EC94900989DE2 /* RNNModalManager.m */,
465
 				261F0E631E6EC94900989DE2 /* RNNModalManager.m */,
433
 				261F0E681E6F028A00989DE2 /* RNNNavigationStackManager.h */,
466
 				261F0E681E6F028A00989DE2 /* RNNNavigationStackManager.h */,
451
 				7BC9346D1E26886E00EFA125 /* RNNControllerFactory.m */,
484
 				7BC9346D1E26886E00EFA125 /* RNNControllerFactory.m */,
452
 				263905E41E4CAC950023D7D3 /* RNNSideMenuChildVC.h */,
485
 				263905E41E4CAC950023D7D3 /* RNNSideMenuChildVC.h */,
453
 				263905E51E4CAC950023D7D3 /* RNNSideMenuChildVC.m */,
486
 				263905E51E4CAC950023D7D3 /* RNNSideMenuChildVC.m */,
454
-				E83BAD691F27362500A9F3DD /* RNNNavigationOptions.h */,
455
-				E83BAD6A1F27363A00A9F3DD /* RNNNavigationOptions.m */,
456
 				21B85E5E1F44482A00B314B5 /* RNNNavigationButtons.h */,
487
 				21B85E5E1F44482A00B314B5 /* RNNNavigationButtons.h */,
457
 				21B85E5C1F44480200B314B5 /* RNNNavigationButtons.m */,
488
 				21B85E5C1F44480200B314B5 /* RNNNavigationButtons.m */,
458
 				214545261F4DC164006E8DA1 /* RNNUIBarButtonItem.h */,
489
 				214545261F4DC164006E8DA1 /* RNNUIBarButtonItem.h */,
459
 				214545241F4DC125006E8DA1 /* RNNUIBarButtonItem.m */,
490
 				214545241F4DC125006E8DA1 /* RNNUIBarButtonItem.m */,
460
-				50EB933F1FE14A3E00BD8EEE /* RNNTabItemOptions.h */,
461
-				50EB93401FE14A3E00BD8EEE /* RNNTabItemOptions.m */,
462
-				A7626BFE1FC2FB6700492FB8 /* RNNTopBarOptions.h */,
463
-				A7626BFC1FC2FB2C00492FB8 /* RNNTopBarOptions.m */,
464
-				A7626BFF1FC578AB00492FB8 /* RNNTabBarOptions.h */,
465
-				A7626C001FC5796200492FB8 /* RNNTabBarOptions.m */,
466
-				507F43C71FF4F9CC00D9425B /* RNNTopTabOptions.h */,
467
-				507F43C81FF4F9CC00D9425B /* RNNTopTabOptions.m */,
468
-				50CB3B671FDE911400AA153B /* RNNSideMenuOptions.h */,
469
-				50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */,
470
 				507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */,
491
 				507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */,
471
 				507F43C41FF4F17C00D9425B /* RNNTopTabsViewController.m */,
492
 				507F43C41FF4F17C00D9425B /* RNNTopTabsViewController.m */,
472
 				507F43F61FF525B500D9425B /* RNNSegmentedControl.h */,
493
 				507F43F61FF525B500D9425B /* RNNSegmentedControl.h */,
607
 			buildActionMask = 2147483647;
628
 			buildActionMask = 2147483647;
608
 			files = (
629
 			files = (
609
 				261F0E6A1E6F028A00989DE2 /* RNNNavigationStackManager.h in Headers */,
630
 				261F0E6A1E6F028A00989DE2 /* RNNNavigationStackManager.h in Headers */,
631
+				504AFE761FFFF1E00076E904 /* RNNNavigationOptions.h in Headers */,
632
+				504AFE771FFFF1E20076E904 /* RNNTopBarOptions.h in Headers */,
610
 				26916C981E4B9E7700D13680 /* RNNReactRootViewCreator.h in Headers */,
633
 				26916C981E4B9E7700D13680 /* RNNReactRootViewCreator.h in Headers */,
611
 				263905B01E4C6F440023D7D3 /* MMDrawerController+Subclass.h in Headers */,
634
 				263905B01E4C6F440023D7D3 /* MMDrawerController+Subclass.h in Headers */,
612
 				E8AEDB4A1F5C0BAF000F5A6A /* RNNInteractivePopAnimator.h in Headers */,
635
 				E8AEDB4A1F5C0BAF000F5A6A /* RNNInteractivePopAnimator.h in Headers */,
647
 				507F44201FFA8A8800D9425B /* RNNRootViewProtocol.h in Headers */,
670
 				507F44201FFA8A8800D9425B /* RNNRootViewProtocol.h in Headers */,
648
 				263905CA1E4C6F440023D7D3 /* SidebarLuvocracyAnimation.h in Headers */,
671
 				263905CA1E4C6F440023D7D3 /* SidebarLuvocracyAnimation.h in Headers */,
649
 				263905B11E4C6F440023D7D3 /* MMDrawerController.h in Headers */,
672
 				263905B11E4C6F440023D7D3 /* MMDrawerController.h in Headers */,
650
-				50EB93411FE14A3E00BD8EEE /* RNNTabItemOptions.h in Headers */,
673
+				504AFE641FFE53070076E904 /* RNNOptions.h in Headers */,
651
 				263905B91E4C6F440023D7D3 /* RCCDrawerController.h in Headers */,
674
 				263905B91E4C6F440023D7D3 /* RCCDrawerController.h in Headers */,
652
 				263905B31E4C6F440023D7D3 /* MMDrawerVisualState.h in Headers */,
675
 				263905B31E4C6F440023D7D3 /* MMDrawerVisualState.h in Headers */,
653
 				E8A5CD621F49114F00E89D0D /* RNNElement.h in Headers */,
676
 				E8A5CD621F49114F00E89D0D /* RNNElement.h in Headers */,
677
+				504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */,
654
 				E8E5182E1F83A48B000467AC /* RNNTransitionStateHolder.h in Headers */,
678
 				E8E5182E1F83A48B000467AC /* RNNTransitionStateHolder.h in Headers */,
655
 				7B1126A91E2D2B6C00F9B03B /* RNNControllerFactory.h in Headers */,
679
 				7B1126A91E2D2B6C00F9B03B /* RNNControllerFactory.h in Headers */,
656
 				263905D61E4C94970023D7D3 /* RNNSideMenuController.h in Headers */,
680
 				263905D61E4C94970023D7D3 /* RNNSideMenuController.h in Headers */,
790
 				7BBFE5441E25330E002A6182 /* RNNBridgeModule.m in Sources */,
814
 				7BBFE5441E25330E002A6182 /* RNNBridgeModule.m in Sources */,
791
 				261F0E651E6EC94900989DE2 /* RNNModalManager.m in Sources */,
815
 				261F0E651E6EC94900989DE2 /* RNNModalManager.m in Sources */,
792
 				E8A5CD631F49114F00E89D0D /* RNNElement.m in Sources */,
816
 				E8A5CD631F49114F00E89D0D /* RNNElement.m in Sources */,
817
+				504AFE751FFFF0540076E904 /* RNNTopTabsOptions.m in Sources */,
793
 				7BEF0D1D1E43771B003E96B0 /* RNNLayoutNode.m in Sources */,
818
 				7BEF0D1D1E43771B003E96B0 /* RNNLayoutNode.m in Sources */,
794
 				7BA500781E254908001B9E1B /* RNNSplashScreen.m in Sources */,
819
 				7BA500781E254908001B9E1B /* RNNSplashScreen.m in Sources */,
820
+				504AFE651FFE53070076E904 /* RNNOptions.m in Sources */,
795
 				263905BA1E4C6F440023D7D3 /* RCCDrawerController.m in Sources */,
821
 				263905BA1E4C6F440023D7D3 /* RCCDrawerController.m in Sources */,
796
 				50F5DFC21F407A8C001A00BC /* RNNTabBarController.m in Sources */,
822
 				50F5DFC21F407A8C001A00BC /* RNNTabBarController.m in Sources */,
797
 				263905BC1E4C6F440023D7D3 /* RCCDrawerHelper.m in Sources */,
823
 				263905BC1E4C6F440023D7D3 /* RCCDrawerHelper.m in Sources */,
807
 				E8A430121F9CB87B00B61A20 /* RNNAnimatedView.m in Sources */,
833
 				E8A430121F9CB87B00B61A20 /* RNNAnimatedView.m in Sources */,
808
 				507F43F51FF4FCFE00D9425B /* HMSegmentedControl.m in Sources */,
834
 				507F43F51FF4FCFE00D9425B /* HMSegmentedControl.m in Sources */,
809
 				507F43C61FF4F17C00D9425B /* RNNTopTabsViewController.m in Sources */,
835
 				507F43C61FF4F17C00D9425B /* RNNTopTabsViewController.m in Sources */,
810
-				50EB93421FE14A3E00BD8EEE /* RNNTabItemOptions.m in Sources */,
836
+				50EB93421FE14A3E00BD8EEE /* RNNBottomTabOptions.m in Sources */,
811
 				E8367B811F7A8A4700675C05 /* VICMAImageView.m in Sources */,
837
 				E8367B811F7A8A4700675C05 /* VICMAImageView.m in Sources */,
812
-				A7626C011FC5796200492FB8 /* RNNTabBarOptions.m in Sources */,
838
+				A7626C011FC5796200492FB8 /* RNNBottomTabsOptions.m in Sources */,
813
 				263905AF1E4C6F440023D7D3 /* MMDrawerBarButtonItem.m in Sources */,
839
 				263905AF1E4C6F440023D7D3 /* MMDrawerBarButtonItem.m in Sources */,
814
 				E8AEDB4B1F5C0BAF000F5A6A /* RNNInteractivePopAnimator.m in Sources */,
840
 				E8AEDB4B1F5C0BAF000F5A6A /* RNNInteractivePopAnimator.m in Sources */,
815
 				7B4928091E70415400555040 /* RNNCommandsHandler.m in Sources */,
841
 				7B4928091E70415400555040 /* RNNCommandsHandler.m in Sources */,

+ 3
- 3
lib/ios/ReactNativeNavigationTests/RNNNavigationOptionsTest.m View File

19
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBar": @{@"backgroundColor" : @(0xff0000ff)}}];
19
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBar": @{@"backgroundColor" : @(0xff0000ff)}}];
20
 	XCTAssertTrue(options.topBar.backgroundColor);
20
 	XCTAssertTrue(options.topBar.backgroundColor);
21
 }
21
 }
22
--(void)testReturnsNilWhenStyleDoesNotExist{
23
-	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBar": @{@"someColor" : @(0xff0000ff)}}];
24
-	XCTAssertNil(options.topBar.backgroundColor);
22
+-(void)testThrowsWhenStyleDoesNotExist{
23
+	XCTAssertThrows([[RNNNavigationOptions alloc] initWithDict:@{@"topBar": @{@"someColor" : @(0xff0000ff)}}]);
25
 }
24
 }
26
 
25
 
27
 -(void)testChangeRNNNavigationOptionsDynamically{
26
 -(void)testChangeRNNNavigationOptionsDynamically{
36
 	NSDictionary* dynamicOptions = @{@"topBar": @{@"titleeeee" : @"hello"}};
35
 	NSDictionary* dynamicOptions = @{@"topBar": @{@"titleeeee" : @"hello"}};
37
 	XCTAssertThrows([options mergeWith:dynamicOptions]);
36
 	XCTAssertThrows([options mergeWith:dynamicOptions]);
38
 }
37
 }
38
+
39
 @end
39
 @end

+ 5
- 5
lib/ios/ReactNativeNavigationTests/RNNRootViewControllerTest.m View File

174
 
174
 
175
 -(void)testTabBadge {
175
 -(void)testTabBadge {
176
 	NSString* tabBadgeInput = @"5";
176
 	NSString* tabBadgeInput = @"5";
177
-	self.options.tabItem.badge = tabBadgeInput;
177
+	self.options.bottomTab.badge = tabBadgeInput;
178
 	__unused RNNTabBarController* vc = [[RNNTabBarController alloc] init];
178
 	__unused RNNTabBarController* vc = [[RNNTabBarController alloc] init];
179
 	NSMutableArray* controllers = [NSMutableArray new];
179
 	NSMutableArray* controllers = [NSMutableArray new];
180
 	UITabBarItem* item = [[UITabBarItem alloc] initWithTitle:@"A Tab" image:nil tag:1];
180
 	UITabBarItem* item = [[UITabBarItem alloc] initWithTitle:@"A Tab" image:nil tag:1];
355
 }
355
 }
356
 
356
 
357
 -(void)testRightButtonsWithTitle_withoutStyle {
357
 -(void)testRightButtonsWithTitle_withoutStyle {
358
-	self.options.rightButtons = @[@{@"id": @"testId", @"title": @"test"}];
358
+	self.options.topBar.rightButtons = @[@{@"id": @"testId", @"title": @"test"}];
359
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
359
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
360
 	[self.uut viewWillAppear:false];
360
 	[self.uut viewWillAppear:false];
361
 	
361
 	
370
 -(void)testRightButtonsWithTitle_withStyle {
370
 -(void)testRightButtonsWithTitle_withStyle {
371
 	NSNumber* inputColor = @(0xFFFF0000);
371
 	NSNumber* inputColor = @(0xFFFF0000);
372
 	
372
 	
373
-	self.options.rightButtons = @[@{@"id": @"testId", @"title": @"test", @"disabled": @true, @"buttonColor": inputColor, @"buttonFontSize": @22, @"buttonFontWeight": @"800"}];
373
+	self.options.topBar.rightButtons = @[@{@"id": @"testId", @"title": @"test", @"disabled": @true, @"buttonColor": inputColor, @"buttonFontSize": @22, @"buttonFontWeight": @"800"}];
374
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
374
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
375
 	[self.uut viewWillAppear:false];
375
 	[self.uut viewWillAppear:false];
376
 	
376
 	
386
 
386
 
387
 
387
 
388
 -(void)testLeftButtonsWithTitle_withoutStyle {
388
 -(void)testLeftButtonsWithTitle_withoutStyle {
389
-	self.options.leftButtons = @[@{@"id": @"testId", @"title": @"test"}];
389
+	self.options.topBar.leftButtons = @[@{@"id": @"testId", @"title": @"test"}];
390
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
390
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
391
 	[self.uut viewWillAppear:false];
391
 	[self.uut viewWillAppear:false];
392
 	
392
 	
401
 -(void)testLeftButtonsWithTitle_withStyle {
401
 -(void)testLeftButtonsWithTitle_withStyle {
402
 	NSNumber* inputColor = @(0xFFFF0000);
402
 	NSNumber* inputColor = @(0xFFFF0000);
403
 	
403
 	
404
-	self.options.leftButtons = @[@{@"id": @"testId", @"title": @"test", @"disabled": @true, @"buttonColor": inputColor, @"buttonFontSize": @22, @"buttonFontWeight": @"800"}];
404
+	self.options.topBar.leftButtons = @[@{@"id": @"testId", @"title": @"test", @"disabled": @true, @"buttonColor": inputColor, @"buttonFontSize": @22, @"buttonFontWeight": @"800"}];
405
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
405
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
406
 	[self.uut viewWillAppear:false];
406
 	[self.uut viewWillAppear:false];
407
 	
407
 	

+ 0
- 5
lib/src/params/options/NavigationOptions.js View File

1
 const TopBar = require('./TopBar');
1
 const TopBar = require('./TopBar');
2
 const BottomTabs = require('./BottomTabs');
2
 const BottomTabs = require('./BottomTabs');
3
-const Button = require('./Button');
4
 const BottomTab = require('./BottomTab');
3
 const BottomTab = require('./BottomTab');
5
 const TopTabs = require('./TopTabs');
4
 const TopTabs = require('./TopTabs');
6
 
5
 
11
    * @property {options:BottomTab} [bottomTab]
10
    * @property {options:BottomTab} [bottomTab]
12
    * @property {string} [orientation]
11
    * @property {string} [orientation]
13
    * @property {options:TopTabs} [topTabs]
12
    * @property {options:TopTabs} [topTabs]
14
-   * @property {options:Button[]} [rightButtons]
15
-   * @property {options:Button[]} [leftButtons]
16
    */
13
    */
17
   constructor(options) {
14
   constructor(options) {
18
     this.topBar = options.topBar && new TopBar(options.topBar);
15
     this.topBar = options.topBar && new TopBar(options.topBar);
19
     this.bottomTabs = options.bottomTabs && new BottomTabs(options.bottomTabs);
16
     this.bottomTabs = options.bottomTabs && new BottomTabs(options.bottomTabs);
20
     this.bottomTab = options.bottomTab && new BottomTab(options.bottomTab);
17
     this.bottomTab = options.bottomTab && new BottomTab(options.bottomTab);
21
     this.orientation = options.orientation;
18
     this.orientation = options.orientation;
22
-    this.rightButtons = options.rightButtons && options.rightButtons.map((button) => new Button(button));
23
-    this.leftButtons = options.leftButtons && options.leftButtons.map((button) => new Button(button));
24
     this.sideMenu = options.sideMenu;
19
     this.sideMenu = options.sideMenu;
25
     this.backgroundImage = options.backgroundImage;
20
     this.backgroundImage = options.backgroundImage;
26
     this.rootBackgroundImage = options.rootBackgroundImage;
21
     this.rootBackgroundImage = options.rootBackgroundImage;

+ 0
- 20
lib/src/params/options/NavigationOptions.test.js View File

7
 const TAB_BAR = {};
7
 const TAB_BAR = {};
8
 const TOP_BAR = {};
8
 const TOP_BAR = {};
9
 const TAB_ITEM = {};
9
 const TAB_ITEM = {};
10
-const RIGHT_BUTTONS = [
11
-  {
12
-    id: 'myBtn',
13
-    testID: 'BTN',
14
-    title: 'My Button',
15
-    buttonColor: 'red'
16
-  }
17
-];
18
-const LEFT_BUTTONS = [
19
-  {
20
-    id: 'myBtn',
21
-    testID: 'BTN',
22
-    title: 'My Button',
23
-    buttonColor: 'red'
24
-  }
25
-];
26
 const TOP_TABS = {
10
 const TOP_TABS = {
27
   selectedTabColor: 'blue',
11
   selectedTabColor: 'blue',
28
   unselectedTabColor: 'red'
12
   unselectedTabColor: 'red'
32
   bottomTabs: TAB_BAR,
16
   bottomTabs: TAB_BAR,
33
   bottomTab: TAB_ITEM,
17
   bottomTab: TAB_ITEM,
34
   orientation: 'portrait',
18
   orientation: 'portrait',
35
-  rightButtons: RIGHT_BUTTONS,
36
-  leftButtons: LEFT_BUTTONS,
37
   topTabs: TOP_TABS
19
   topTabs: TOP_TABS
38
 };
20
 };
39
 
21
 
44
     expect(uut.topBar).toBeInstanceOf(TopBar);
26
     expect(uut.topBar).toBeInstanceOf(TopBar);
45
     expect(uut.bottomTab).toBeInstanceOf(BottomTab);
27
     expect(uut.bottomTab).toBeInstanceOf(BottomTab);
46
     expect(uut.orientation).toEqual('portrait');
28
     expect(uut.orientation).toEqual('portrait');
47
-    expect(uut.rightButtons).toEqual(RIGHT_BUTTONS);
48
-    expect(uut.leftButtons).toEqual(LEFT_BUTTONS);
49
     expect(uut.topTabs).toBeInstanceOf(TopTabs);
29
     expect(uut.topTabs).toBeInstanceOf(TopTabs);
50
   });
30
   });
51
 });
31
 });

+ 6
- 0
lib/src/params/options/TopBar.js View File

1
+const Button = require('./Button');
2
+
1
 class TopBar {
3
 class TopBar {
2
   /**
4
   /**
3
    * @property {string} [title]
5
    * @property {string} [title]
16
    * @property {boolean} [noBorder]
18
    * @property {boolean} [noBorder]
17
    * @property {boolean} [largeTitle]
19
    * @property {boolean} [largeTitle]
18
    * @property {boolean} [drawUnder]
20
    * @property {boolean} [drawUnder]
21
+   * @property {options:Button[]} [rightButtons]
22
+   * @property {options:Button[]} [leftButtons]
19
    */
23
    */
20
   constructor(options) {
24
   constructor(options) {
21
     this.title = options.title;
25
     this.title = options.title;
34
     this.largeTitle = options.largeTitle;
38
     this.largeTitle = options.largeTitle;
35
     this.testID = options.testID;
39
     this.testID = options.testID;
36
     this.drawUnder = options.drawUnder;
40
     this.drawUnder = options.drawUnder;
41
+    this.rightButtons = options.rightButtons && options.rightButtons.map((button) => new Button(button));
42
+    this.leftButtons = options.leftButtons && options.leftButtons.map((button) => new Button(button));
37
   }
43
   }
38
 }
44
 }
39
 
45
 

+ 22
- 1
lib/src/params/options/TopBar.test.js View File

1
 const TopBar = require('./TopBar');
1
 const TopBar = require('./TopBar');
2
+const Button = require('./Button');
3
+
4
+const RIGHT_BUTTONS = [
5
+  {
6
+    id: 'myBtn',
7
+    testID: 'BTN',
8
+    title: 'My Button',
9
+    buttonColor: 'red'
10
+  }
11
+];
12
+const LEFT_BUTTONS = [
13
+  {
14
+    id: 'myBtn',
15
+    testID: 'BTN',
16
+    title: 'My Button',
17
+    buttonColor: 'red'
18
+  }
19
+];
2
 
20
 
3
 const TOP_BAR = {
21
 const TOP_BAR = {
4
   title: 'something',
22
   title: 'something',
9
   hidden: true,
27
   hidden: true,
10
   animateHide: true,
28
   animateHide: true,
11
   hideOnScroll: true,
29
   hideOnScroll: true,
12
-  transparent: true
30
+  transparent: true,
31
+  rightButtons: RIGHT_BUTTONS,
32
+  leftButtons: LEFT_BUTTONS
13
 };
33
 };
14
 
34
 
15
 describe('TopBar', () => {
35
 describe('TopBar', () => {
24
     expect(uut.animateHide).toEqual(true);
44
     expect(uut.animateHide).toEqual(true);
25
     expect(uut.hideOnScroll).toEqual(true);
45
     expect(uut.hideOnScroll).toEqual(true);
26
     expect(uut.transparent).toEqual(true);
46
     expect(uut.transparent).toEqual(true);
47
+    expect(uut.leftButtons[0]).toBeInstanceOf(Button);
27
   });
48
   });
28
 });
49
 });

+ 46
- 42
playground/src/containers/OptionsScreen.js View File

20
         hidden: false,
20
         hidden: false,
21
         textFontSize: 16,
21
         textFontSize: 16,
22
         textFontFamily: 'HelveticaNeue-Italic',
22
         textFontFamily: 'HelveticaNeue-Italic',
23
-        testID: testIDs.TOP_BAR_ELEMENT
24
-      },
25
-      rightButtons: [{
26
-        id: BUTTON_ONE,
27
-        testID: BUTTON_ONE,
28
-        title: 'One',
29
-        buttonFontSize: 28,
30
-        buttonColor: 'red'
31
-      }],
32
-      leftButtons: [{
33
-        id: BUTTON_LEFT,
34
-        testID: BUTTON_LEFT,
35
-        icon: require('../../img/navicon_add.png'),
36
-        title: 'Left',
37
-        buttonColor: 'purple'
38
-      }]
23
+        testID: testIDs.TOP_BAR_ELEMENT,
24
+        rightButtons: [{
25
+          id: BUTTON_ONE,
26
+          testID: BUTTON_ONE,
27
+          title: 'One',
28
+          buttonFontSize: 28,
29
+          buttonColor: 'red'
30
+        }],
31
+        leftButtons: [{
32
+          id: BUTTON_LEFT,
33
+          testID: BUTTON_LEFT,
34
+          icon: require('../../img/navicon_add.png'),
35
+          title: 'Left',
36
+          buttonColor: 'purple'
37
+        }]
38
+      }
39
     };
39
     };
40
   }
40
   }
41
 
41
 
71
   onNavigationButtonPressed(id) {
71
   onNavigationButtonPressed(id) {
72
     if (id === BUTTON_ONE) {
72
     if (id === BUTTON_ONE) {
73
       Navigation.setOptions(this.props.containerId, {
73
       Navigation.setOptions(this.props.containerId, {
74
-        rightButtons: [{
75
-          id: BUTTON_TWO,
76
-          testID: BUTTON_TWO,
77
-          title: 'Two',
78
-          icon: require('../../img/navicon_add.png'),
79
-          disableIconTint: true,
80
-          // disabled: true,
81
-          showAsAction: 'ifRoom',
82
-          buttonColor: 'green',
83
-          buttonFontSize: 28,
84
-          buttonFontWeight: '800'
85
-        }],
86
-        leftButtons: []
74
+        topBar: {
75
+          rightButtons: [{
76
+            id: BUTTON_TWO,
77
+            testID: BUTTON_TWO,
78
+            title: 'Two',
79
+            icon: require('../../img/navicon_add.png'),
80
+            disableIconTint: true,
81
+            // disabled: true,
82
+            showAsAction: 'ifRoom',
83
+            buttonColor: 'green',
84
+            buttonFontSize: 28,
85
+            buttonFontWeight: '800'
86
+          }],
87
+          leftButtons: []
88
+        }
87
       });
89
       });
88
     } else if (id === BUTTON_TWO) {
90
     } else if (id === BUTTON_TWO) {
89
       Navigation.setOptions(this.props.containerId, {
91
       Navigation.setOptions(this.props.containerId, {
90
-        rightButtons: [{
91
-          id: BUTTON_ONE,
92
-          testID: BUTTON_ONE,
93
-          title: 'One',
94
-          buttonColor: 'red'
95
-        }],
96
-        leftButtons: [{
97
-          id: BUTTON_LEFT,
98
-          testID: BUTTON_LEFT,
99
-          icon: require('../../img/navicon_add.png'),
100
-          title: 'Left',
101
-          buttonColor: 'purple'
102
-        }]
92
+        topBar: {
93
+          rightButtons: [{
94
+            id: BUTTON_ONE,
95
+            testID: BUTTON_ONE,
96
+            title: 'One',
97
+            buttonColor: 'red'
98
+          }],
99
+          leftButtons: [{
100
+            id: BUTTON_LEFT,
101
+            testID: BUTTON_LEFT,
102
+            icon: require('../../img/navicon_add.png'),
103
+            title: 'Left',
104
+            buttonColor: 'purple'
105
+          }]
106
+        }
103
       });
107
       });
104
     } else if (id === BUTTON_LEFT) {
108
     } else if (id === BUTTON_LEFT) {
105
       Navigation.pop(this.props.containerId);
109
       Navigation.pop(this.props.containerId);

+ 1
- 1
playground/src/containers/WelcomeScreen.js View File

183
           navigationOptions: {
183
           navigationOptions: {
184
             topTab: {
184
             topTab: {
185
               title: 'Tab 2',
185
               title: 'Tab 2',
186
-              titleFontFamily: 'Dosis-Regular'
186
+              titleFontFamily: 'HelveticaNeue-Italic'
187
             }
187
             }
188
           }
188
           }
189
         },
189
         },