Przeglądaj źródła

Set BottomTabs style after stack changes

Guy Carmeli 8 lat temu
rodzic
commit
28a2f01873

+ 6
- 0
android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java Wyświetl plik

@@ -79,6 +79,7 @@ public class BottomTabsLayout extends RelativeLayout implements Layout, AHBottom
79 79
     public boolean onBackPressed() {
80 80
         if (getCurrentScreenStack().canPop()) {
81 81
             getCurrentScreenStack().pop();
82
+            bottomTabs.setStyleFromScreen(getCurrentScreenStack().getCurrentScreenStyleParams());
82 83
             return true;
83 84
         } else {
84 85
             return false;
@@ -116,16 +117,19 @@ public class BottomTabsLayout extends RelativeLayout implements Layout, AHBottom
116 117
     @Override
117 118
     public void push(ScreenParams screenParams) {
118 119
         getCurrentScreenStack().push(screenParams);
120
+        bottomTabs.setStyleFromScreen(screenParams.styleParams);
119 121
     }
120 122
 
121 123
     @Override
122 124
     public void pop(ScreenParams screenParams) {
123 125
         getCurrentScreenStack().pop();
126
+        bottomTabs.setStyleFromScreen(screenParams.styleParams);
124 127
     }
125 128
 
126 129
     @Override
127 130
     public void popToRoot(ScreenParams params) {
128 131
         getCurrentScreenStack().popToRoot();
132
+        bottomTabs.setStyleFromScreen(getCurrentScreenStack().getCurrentScreenStyleParams());
129 133
     }
130 134
 
131 135
     @Override
@@ -137,6 +141,8 @@ public class BottomTabsLayout extends RelativeLayout implements Layout, AHBottom
137 141
         ScreenStack newStack = new ScreenStack(activity, params);
138 142
         screenStacks[currentStackIndex] = newStack;
139 143
         addView(newStack, 0, new RelativeLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
144
+
145
+        bottomTabs.setStyleFromScreen(params.styleParams);
140 146
     }
141 147
 
142 148
     @Override