|
@@ -5,6 +5,7 @@ import android.graphics.drawable.Drawable;
|
5
|
5
|
import android.os.AsyncTask;
|
6
|
6
|
import android.os.Bundle;
|
7
|
7
|
import android.view.Menu;
|
|
8
|
+import android.view.View;
|
8
|
9
|
import android.widget.FrameLayout;
|
9
|
10
|
|
10
|
11
|
import com.aurelhubert.ahbottomnavigation.AHBottomNavigation;
|
|
@@ -118,6 +119,10 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
|
118
|
119
|
}
|
119
|
120
|
}
|
120
|
121
|
StyleHelper.updateStyles(mToolbar, getCurrentScreen());
|
|
122
|
+
|
|
123
|
+ if (shouldToggleTabs(screen)) {
|
|
124
|
+ toggleTabs(screen.bottomTabsHidden, false);
|
|
125
|
+ }
|
121
|
126
|
}
|
122
|
127
|
|
123
|
128
|
@Override
|
|
@@ -126,7 +131,13 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
|
126
|
131
|
for (ScreenStack stack : mScreenStacks) {
|
127
|
132
|
if (stack.peek().navigatorId.equals(navigatorId)) {
|
128
|
133
|
Screen popped = stack.pop();
|
129
|
|
- StyleHelper.updateStyles(mToolbar, getCurrentScreen());
|
|
134
|
+ Screen currentScreen = getCurrentScreen();
|
|
135
|
+ StyleHelper.updateStyles(mToolbar, currentScreen);
|
|
136
|
+
|
|
137
|
+ if (shouldToggleTabs(currentScreen)) {
|
|
138
|
+ toggleTabs(currentScreen.bottomTabsHidden, false);
|
|
139
|
+ }
|
|
140
|
+
|
130
|
141
|
return popped;
|
131
|
142
|
}
|
132
|
143
|
}
|
|
@@ -225,13 +236,24 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
|
225
|
236
|
public void toggleTabs(ReadableMap params) {
|
226
|
237
|
boolean hide = params.getBoolean(KEY_HIDDEN);
|
227
|
238
|
boolean animated = params.getBoolean(KEY_ANIMATED);
|
|
239
|
+ toggleTabs(hide, animated);
|
|
240
|
+ }
|
|
241
|
+
|
|
242
|
+ // TODO: support animated = false -guyca
|
|
243
|
+ private void toggleTabs(boolean hide, boolean animated) {
|
228
|
244
|
if (hide) {
|
229
|
|
- mBottomNavigation.hideBottomNavigation(animated);
|
|
245
|
+// mBottomNavigation.hideBottomNavigation(animated);
|
|
246
|
+ mBottomNavigation.setVisibility(View.GONE);
|
230
|
247
|
} else {
|
231
|
|
- mBottomNavigation.restoreBottomNavigation(animated);
|
|
248
|
+ mBottomNavigation.setVisibility(View.VISIBLE);
|
|
249
|
+// mBottomNavigation.restoreBottomNavigation(animated);
|
232
|
250
|
}
|
233
|
251
|
}
|
234
|
252
|
|
|
253
|
+ private boolean shouldToggleTabs(Screen newScreen) {
|
|
254
|
+ return mBottomNavigation.isShown() == newScreen.bottomTabsHidden;
|
|
255
|
+ }
|
|
256
|
+
|
235
|
257
|
private static class SetupTabsTask extends AsyncTask<Void, Void, Map<Screen, Drawable>> {
|
236
|
258
|
private BottomTabActivity mActivity;
|
237
|
259
|
private RnnToolBar mToolBar;
|