Browse Source

changed hidden props to visible (#2704)

yogevbd 7 years ago
parent
commit
f4e76e544e
No account linked to committer's email address

+ 1
- 1
lib/ios/RNNBottomTabsOptions.h View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 @interface RNNBottomTabsOptions : RNNOptions
4 4
 
5
-@property (nonatomic, strong) NSNumber* hidden;
5
+@property (nonatomic, strong) NSNumber* visible;
6 6
 @property (nonatomic, strong) NSNumber* animateHide;
7 7
 @property (nonatomic, strong) NSNumber* currentTabIndex;
8 8
 @property (nonatomic, strong) NSString* testID;

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

@@ -13,8 +13,8 @@ extern const NSInteger BLUR_TOPBAR_TAG;
13 13
 		[(RNNTabBarController*)viewController.tabBarController setSelectedIndexByComponentID:self.currentTabId];
14 14
 	}
15 15
 	
16
-	if (self.hidden) {
17
-		[((RNNTabBarController *)viewController.tabBarController) setTabBarHidden:[self.hidden boolValue] animated:[self.animateHide boolValue]];
16
+	if (self.visible) {
17
+		[((RNNTabBarController *)viewController.tabBarController) setTabBarHidden:![self.visible boolValue] animated:[self.animateHide boolValue]];
18 18
 	}
19 19
 	
20 20
 	if (self.testID) {

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

@@ -101,8 +101,8 @@
101 101
 
102 102
 - (BOOL)hidesBottomBarWhenPushed
103 103
 {
104
-	if (self.options.bottomTabs && self.options.bottomTabs.hidden) {
105
-		return [self.options.bottomTabs.hidden boolValue];
104
+	if (self.options.bottomTabs && self.options.bottomTabs.visible) {
105
+		return ![self.options.bottomTabs.visible boolValue];
106 106
 	}
107 107
 	return NO;
108 108
 }

+ 1
- 1
lib/ios/RNNTopBarOptions.h View File

@@ -8,7 +8,7 @@
8 8
 @property (nonatomic, strong) NSNumber* textColor;
9 9
 @property (nonatomic, strong) NSString* title;
10 10
 @property (nonatomic, strong) NSString* textFontFamily;
11
-@property (nonatomic, strong) NSNumber* hidden;
11
+@property (nonatomic, strong) NSNumber* visible;
12 12
 @property (nonatomic, strong) NSNumber* hideOnScroll;
13 13
 @property (nonatomic, strong) NSNumber* buttonColor;
14 14
 @property (nonatomic, strong) NSNumber* translucent;

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

@@ -62,8 +62,8 @@ extern const NSInteger BLUR_TOPBAR_TAG;
62 62
 	}
63 63
 	
64 64
 	
65
-	if (self.hidden){
66
-		[viewController.navigationController setNavigationBarHidden:[self.hidden boolValue] animated:[self.animateHide boolValue]];
65
+	if (self.visible) {
66
+		[viewController.navigationController setNavigationBarHidden:![self.visible boolValue] animated:[self.animateHide boolValue]];
67 67
 	}
68 68
 	
69 69
 	if (self.hideOnScroll) {

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

@@ -79,7 +79,7 @@
79 79
 
80 80
 - (void)testStatusBarHideWithTopBar_false {
81 81
 	self.options.statusBarHideWithTopBar = @(0);
82
-	self.options.topBar.hidden = @(1);
82
+	self.options.topBar.visible = @(0);
83 83
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
84 84
 	[self.uut viewWillAppear:false];
85 85
 	
@@ -88,7 +88,7 @@
88 88
 
89 89
 - (void)testStatusBarHideWithTopBar_true {
90 90
 	self.options.statusBarHideWithTopBar = @(1);
91
-	self.options.topBar.hidden = @(1);
91
+	self.options.topBar.visible = @(0);
92 92
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
93 93
 	[self.uut viewWillAppear:false];
94 94
 
@@ -471,7 +471,7 @@
471 471
 
472 472
 
473 473
 - (void)testTabBarHidden_true {
474
-	self.options.bottomTabs.hidden = @(1);
474
+	self.options.bottomTabs.visible = @(0);
475 475
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
476 476
 	[self.uut viewWillAppear:false];
477 477
 
@@ -479,7 +479,7 @@
479 479
 }
480 480
 
481 481
 - (void)testTabBarHidden_false {
482
-	self.options.bottomTabs.hidden = @(0);
482
+	self.options.bottomTabs.visible = @(1);
483 483
 	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
484 484
 	[self.uut viewWillAppear:false];
485 485
 

+ 4
- 4
playground/src/screens/OptionsScreen.js View File

@@ -18,7 +18,7 @@ class OptionsScreen extends Component {
18 18
         textColor: 'black',
19 19
         drawUnder: false,
20 20
         largeTitle: false,
21
-        hidden: false,
21
+        visible: true,
22 22
         textFontSize: 16,
23 23
         textFontFamily: 'HelveticaNeue-Italic',
24 24
         testID: testIDs.TOP_BAR_ELEMENT,
@@ -162,7 +162,7 @@ class OptionsScreen extends Component {
162 162
   onClickShowTopBar() {
163 163
     Navigation.setOptions(this.props.componentId, {
164 164
       topBar: {
165
-        hidden: false,
165
+        visible: true,
166 166
         animateHide: true
167 167
       }
168 168
     });
@@ -171,7 +171,7 @@ class OptionsScreen extends Component {
171 171
   onClickHideTopBar() {
172 172
     Navigation.setOptions(this.props.componentId, {
173 173
       topBar: {
174
-        hidden: true,
174
+        visible: false,
175 175
         animateHide: true
176 176
       }
177 177
     });
@@ -210,7 +210,7 @@ class OptionsScreen extends Component {
210 210
   onClickPushDefaultOptionsScreen() {
211 211
     Navigation.setDefaultOptions({
212 212
       topBar: {
213
-        hidden: true
213
+        visible: false
214 214
       }
215 215
     });
216 216
 

+ 5
- 5
playground/src/screens/TextScreen.js View File

@@ -32,8 +32,8 @@ class TextScreen extends Component {
32 32
         <Button title={'Set Tab Badge'} testID={testIDs.SET_TAB_BADGE_BUTTON} onPress={() => this.onButtonPress()} />
33 33
         <Button title={'Switch To Tab 2'} testID={testIDs.SWITCH_SECOND_TAB_BUTTON} onPress={() => this.onClickSwitchToTab()} />
34 34
         <Button title={'Switch To Tab 1 by componentID'} testID={testIDs.SWITCH_FIRST_TAB_BUTTON} onPress={() => this.onClickSwitchToTabByComponentID()} />
35
-        <Button title='Hide Tab Bar' testID={testIDs.HIDE_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(true)} />
36
-        <Button title='Show Tab Bar' testID={testIDs.SHOW_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(false)} />
35
+        <Button title='Hide Tab Bar' testID={testIDs.HIDE_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(false)} />
36
+        <Button title='Show Tab Bar' testID={testIDs.SHOW_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(true)} />
37 37
         <Button title='Show Left Side Menu' testID={testIDs.SHOW_LEFT_SIDE_MENU_BUTTON} onPress={() => this.showSideMenu('left')} />
38 38
         <Button title='Show Right Side Menu' testID={testIDs.SHOW_RIGHT_SIDE_MENU_BUTTON} onPress={() => this.showSideMenu('right')} />
39 39
         <Button title='Pop' testID={testIDs.POP_BUTTON} onPress={this.onClickPop} />
@@ -66,7 +66,7 @@ class TextScreen extends Component {
66 66
     Navigation.setOptions(this.props.componentId, {
67 67
       bottomTabs: {
68 68
         currentTabIndex: 1,
69
-        hidden: true,
69
+        visible: false,
70 70
         animateHide: true
71 71
       }
72 72
     });
@@ -80,10 +80,10 @@ class TextScreen extends Component {
80 80
     });
81 81
   }
82 82
 
83
-  hideTabBar(hidden) {
83
+  hideTabBar(visible) {
84 84
     Navigation.setOptions(this.props.componentId, {
85 85
       bottomTabs: {
86
-        hidden
86
+        visible
87 87
       }
88 88
     });
89 89
   }