ソースを参照

changed hidden props to visible (#2704)

yogevbd 7 年 前
コミット
f4e76e544e
No account linked to committer's email address

+ 1
- 1
lib/ios/RNNBottomTabsOptions.h ファイルの表示

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

+ 2
- 2
lib/ios/RNNBottomTabsOptions.m ファイルの表示

13
 		[(RNNTabBarController*)viewController.tabBarController setSelectedIndexByComponentID:self.currentTabId];
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
 	if (self.testID) {
20
 	if (self.testID) {

+ 2
- 2
lib/ios/RNNRootViewController.m ファイルの表示

101
 
101
 
102
 - (BOOL)hidesBottomBarWhenPushed
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
 	return NO;
107
 	return NO;
108
 }
108
 }

+ 1
- 1
lib/ios/RNNTopBarOptions.h ファイルの表示

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

+ 2
- 2
lib/ios/RNNTopBarOptions.m ファイルの表示

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
 	if (self.hideOnScroll) {
69
 	if (self.hideOnScroll) {

+ 4
- 4
lib/ios/ReactNativeNavigationTests/RNNRootViewControllerTest.m ファイルの表示

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

+ 4
- 4
playground/src/screens/OptionsScreen.js ファイルの表示

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

+ 5
- 5
playground/src/screens/TextScreen.js ファイルの表示

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