yogevbd 6 years ago
parent
commit
9586eea60b

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

@@ -57,14 +57,14 @@ describe('screen style', () => {
57 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 61
     await elementById(testIDs.TAB_BASED_APP_BUTTON).tap();
62 62
     await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeVisible();
63 63
     await elementById(testIDs.HIDE_BOTTOM_TABS_BUTTON).tap();
64 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 68
     await elementById(testIDs.TAB_BASED_APP_BUTTON).tap();
69 69
     await elementById(testIDs.HIDE_BOTTOM_TABS_BUTTON).tap();
70 70
     await expect(elementById(testIDs.BOTTOM_TABS_ELEMENT)).toBeNotVisible();
@@ -72,6 +72,14 @@ describe('screen style', () => {
72 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 83
   test('side menu visibility - left', async () => {
76 84
     await elementById(testIDs.TAB_BASED_APP_SIDE_BUTTON).tap();
77 85
     await elementById(testIDs.SHOW_LEFT_SIDE_MENU_BUTTON).tap();

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

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

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

@@ -13,12 +13,6 @@ extern const NSInteger BLUR_TOPBAR_TAG;
13 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 16
 	if (self.testID) {
23 17
 		viewController.tabBarController.tabBar.accessibilityIdentifier = self.testID;
24 18
 	}

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

@@ -24,6 +24,9 @@ class PushedScreen extends Component {
24 24
       },
25 25
       layout: {
26 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,6 +30,7 @@ class TextScreen extends Component {
30 30
         <Button title={'Switch To Tab 1 by componentID'} testID={testIDs.SWITCH_FIRST_TAB_BUTTON} onPress={() => this.onClickSwitchToTabByComponentID()} />
31 31
         <Button title='Hide Tab Bar' testID={testIDs.HIDE_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(false)} />
32 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 34
         <Button title='Show Left Side Menu' testID={testIDs.SHOW_LEFT_SIDE_MENU_BUTTON} onPress={() => this.showSideMenu('left')} />
34 35
         <Button title='Show Right Side Menu' testID={testIDs.SHOW_RIGHT_SIDE_MENU_BUTTON} onPress={() => this.showSideMenu('right')} />
35 36
         <Button title='Push' testID={testIDs.PUSH_BUTTON} onPress={this.onClickPush} />
@@ -96,6 +97,14 @@ class TextScreen extends Component {
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 108
   showSideMenu(side) {
100 109
     Navigation.mergeOptions(this.props.componentId, {
101 110
       sideMenu: {

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

@@ -69,7 +69,8 @@ module.exports = {
69 69
   SHOW_PREVIEW_BUTTON: `SHOW_PREVIEW_BUTTON`,
70 70
   SHOW_TOPBAR_SEARCHBAR: `SHOW_TOPBAR_SEARCHBAR`,
71 71
   SEARCH_RESULT_ITEM: `SEARCH_RESULT_ITEM`,
72
-
72
+  HIDE_BOTTOM_TABS_ON_PUSH_BUTTON: `HIDE_BOTTOM_TABS_ON_PUSH_BUTTON`,
73
+  
73 74
   // Elements
74 75
   SCROLLVIEW_ELEMENT: `SCROLLVIEW_ELEMENT`,
75 76
   BOTTOM_TABS_ELEMENT: `BOTTOM_TABS_ELEMENT`,