Browse Source

Set BottomTabs visibility before initial screen is created

closes #2143
Guy Carmeli 7 years ago
parent
commit
c439f7550c

+ 6
- 1
android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java View File

@@ -142,10 +142,15 @@ public class BottomTabsLayout extends BaseLayout implements AHBottomNavigation.O
142 142
     }
143 143
 
144 144
     private void showInitialScreenStack() {
145
-        showStackAndUpdateStyle(screenStacks[0], NavigationType.InitialScreen);
145
+        bottomTabs.setVisibilityByInitialScreen(getInitialScreenStack().peek().getStyleParams());
146
+        showStackAndUpdateStyle(getInitialScreenStack(), NavigationType.InitialScreen);
146 147
         EventBus.instance.post(new ScreenChangedEvent(screenStacks[0].peek().getScreenParams()));
147 148
     }
148 149
 
150
+    private ScreenStack getInitialScreenStack() {
151
+        return screenStacks[AppStyle.appStyle.bottomTabsInitialIndex];
152
+    }
153
+
149 154
     @Override
150 155
     public View asView() {
151 156
         return this;

+ 4
- 0
android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java View File

@@ -84,6 +84,10 @@ public class BottomTabs extends AHBottomNavigation {
84 84
         return false;
85 85
     }
86 86
 
87
+    public void setVisibilityByInitialScreen(StyleParams styleParams) {
88
+        setVisibility(styleParams.bottomTabsHidden, false);
89
+    }
90
+
87 91
     public void setVisibility(boolean hidden, boolean animated) {
88 92
         if (visibilityAnimator != null) {
89 93
             visibilityAnimator.setVisible(!hidden, animated, null);