yogevbd 6 years ago
parent
commit
9586eea60b

+ 10
- 2
e2e/ScreenStyle.test.js View File

57
     await expect(element(by.text('TeSt'))).toBeVisible();
57
     await expect(element(by.text('TeSt'))).toBeVisible();
58
   });
58
   });
59
 
59
 
60
-  test('hide Tab Bar', async () => {
60
+  test(':android: hide Tab Bar', async () => {
61
     await elementById(testIDs.TAB_BASED_APP_BUTTON).tap();
61
     await elementById(testIDs.TAB_BASED_APP_BUTTON).tap();
62
     await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeVisible();
62
     await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeVisible();
63
     await elementById(testIDs.HIDE_BOTTOM_TABS_BUTTON).tap();
63
     await elementById(testIDs.HIDE_BOTTOM_TABS_BUTTON).tap();
64
     await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeNotVisible();
64
     await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeNotVisible();
65
   });
65
   });
66
 
66
 
67
-  test('show Tab Bar', async () => {
67
+  test(':android: show Tab Bar', async () => {
68
     await elementById(testIDs.TAB_BASED_APP_BUTTON).tap();
68
     await elementById(testIDs.TAB_BASED_APP_BUTTON).tap();
69
     await elementById(testIDs.HIDE_BOTTOM_TABS_BUTTON).tap();
69
     await elementById(testIDs.HIDE_BOTTOM_TABS_BUTTON).tap();
70
     await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeNotVisible();
70
     await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeNotVisible();
72
     await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeVisible();
72
     await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeVisible();
73
   });
73
   });
74
 
74
 
75
+  test('hide Tab Bar on push', async () => {
76
+    await elementById(testIDs.TAB_BASED_APP_BUTTON).tap();
77
+    await elementById(testIDs.HIDE_BOTTOM_TABS_ON_PUSH_BUTTON).tap();
78
+    await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeNotVisible();
79
+    await elementById(testIDs.POP_BUTTON).tap();
80
+    await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeVisible();
81
+  });
82
+
75
   test('side menu visibility - left', async () => {
83
   test('side menu visibility - left', async () => {
76
     await elementById(testIDs.TAB_BASED_APP_SIDE_BUTTON).tap();
84
     await elementById(testIDs.TAB_BASED_APP_SIDE_BUTTON).tap();
77
     await elementById(testIDs.SHOW_LEFT_SIDE_MENU_BUTTON).tap();
85
     await elementById(testIDs.SHOW_LEFT_SIDE_MENU_BUTTON).tap();

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

3
 @interface RNNBottomTabsOptions : RNNOptions
3
 @interface RNNBottomTabsOptions : RNNOptions
4
 
4
 
5
 @property (nonatomic, strong) NSNumber* visible;
5
 @property (nonatomic, strong) NSNumber* visible;
6
-@property (nonatomic, strong) NSNumber* animate;
7
 @property (nonatomic, strong) NSNumber* currentTabIndex;
6
 @property (nonatomic, strong) NSNumber* currentTabIndex;
8
 @property (nonatomic, strong) NSString* testID;
7
 @property (nonatomic, strong) NSString* testID;
9
 @property (nonatomic, strong) NSNumber* drawBehind;
8
 @property (nonatomic, strong) NSNumber* drawBehind;

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

13
 		[(RNNTabBarController*)viewController.tabBarController setSelectedIndexByComponentID:self.currentTabId];
13
 		[(RNNTabBarController*)viewController.tabBarController setSelectedIndexByComponentID:self.currentTabId];
14
 	}
14
 	}
15
 	
15
 	
16
-	if (self.visible) {
17
-		[((RNNTabBarController *)viewController.tabBarController) setTabBarHidden:![self.visible boolValue] animated:[self.animate boolValue]];
18
-	} else {
19
-		[((RNNTabBarController *)viewController.tabBarController) setTabBarHidden:NO animated:NO];
20
-	}
21
-	
22
 	if (self.testID) {
16
 	if (self.testID) {
23
 		viewController.tabBarController.tabBar.accessibilityIdentifier = self.testID;
17
 		viewController.tabBarController.tabBar.accessibilityIdentifier = self.testID;
24
 	}
18
 	}

+ 3
- 0
playground/src/screens/PushedScreen.js View File

24
       },
24
       },
25
       layout: {
25
       layout: {
26
         backgroundColor: '#f5fcff'
26
         backgroundColor: '#f5fcff'
27
+      },
28
+      bottomTabs: {
29
+        visible: false
27
       }
30
       }
28
     };
31
     };
29
   }
32
   }

+ 9
- 0
playground/src/screens/TextScreen.js View File

30
         <Button title={'Switch To Tab 1 by componentID'} testID={testIDs.SWITCH_FIRST_TAB_BUTTON} onPress={() => this.onClickSwitchToTabByComponentID()} />
30
         <Button title={'Switch To Tab 1 by componentID'} testID={testIDs.SWITCH_FIRST_TAB_BUTTON} onPress={() => this.onClickSwitchToTabByComponentID()} />
31
         <Button title='Hide Tab Bar' testID={testIDs.HIDE_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(false)} />
31
         <Button title='Hide Tab Bar' testID={testIDs.HIDE_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(false)} />
32
         <Button title='Show Tab Bar' testID={testIDs.SHOW_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(true)} />
32
         <Button title='Show Tab Bar' testID={testIDs.SHOW_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(true)} />
33
+        <Button title='Hide Tab Bar on Push' testID={testIDs.HIDE_BOTTOM_TABS_ON_PUSH_BUTTON} onPress={() => this.hideTabBarOnPush()} />
33
         <Button title='Show Left Side Menu' testID={testIDs.SHOW_LEFT_SIDE_MENU_BUTTON} onPress={() => this.showSideMenu('left')} />
34
         <Button title='Show Left Side Menu' testID={testIDs.SHOW_LEFT_SIDE_MENU_BUTTON} onPress={() => this.showSideMenu('left')} />
34
         <Button title='Show Right Side Menu' testID={testIDs.SHOW_RIGHT_SIDE_MENU_BUTTON} onPress={() => this.showSideMenu('right')} />
35
         <Button title='Show Right Side Menu' testID={testIDs.SHOW_RIGHT_SIDE_MENU_BUTTON} onPress={() => this.showSideMenu('right')} />
35
         <Button title='Push' testID={testIDs.PUSH_BUTTON} onPress={this.onClickPush} />
36
         <Button title='Push' testID={testIDs.PUSH_BUTTON} onPress={this.onClickPush} />
96
     });
97
     });
97
   }
98
   }
98
 
99
 
100
+  hideTabBarOnPush() {
101
+    Navigation.push(this.props.componentId, {
102
+      component: {
103
+        name: 'navigation.playground.PushedScreen'
104
+      }
105
+    });
106
+  }
107
+
99
   showSideMenu(side) {
108
   showSideMenu(side) {
100
     Navigation.mergeOptions(this.props.componentId, {
109
     Navigation.mergeOptions(this.props.componentId, {
101
       sideMenu: {
110
       sideMenu: {

+ 2
- 1
playground/src/testIDs.js View File

69
   SHOW_PREVIEW_BUTTON: `SHOW_PREVIEW_BUTTON`,
69
   SHOW_PREVIEW_BUTTON: `SHOW_PREVIEW_BUTTON`,
70
   SHOW_TOPBAR_SEARCHBAR: `SHOW_TOPBAR_SEARCHBAR`,
70
   SHOW_TOPBAR_SEARCHBAR: `SHOW_TOPBAR_SEARCHBAR`,
71
   SEARCH_RESULT_ITEM: `SEARCH_RESULT_ITEM`,
71
   SEARCH_RESULT_ITEM: `SEARCH_RESULT_ITEM`,
72
-
72
+  HIDE_BOTTOM_TABS_ON_PUSH_BUTTON: `HIDE_BOTTOM_TABS_ON_PUSH_BUTTON`,
73
+  
73
   // Elements
74
   // Elements
74
   SCROLLVIEW_ELEMENT: `SCROLLVIEW_ELEMENT`,
75
   SCROLLVIEW_ELEMENT: `SCROLLVIEW_ELEMENT`,
75
   BOTTOM_TABS_ELEMENT: `BOTTOM_TABS_ELEMENT`,
76
   BOTTOM_TABS_ELEMENT: `BOTTOM_TABS_ELEMENT`,