|
@@ -5,7 +5,6 @@ import android.graphics.drawable.Drawable;
|
5
|
5
|
import android.os.AsyncTask;
|
6
|
6
|
import android.os.Bundle;
|
7
|
7
|
import android.support.design.widget.CoordinatorLayout;
|
8
|
|
-import android.view.View;
|
9
|
8
|
|
10
|
9
|
import com.aurelhubert.ahbottomnavigation.AHBottomNavigation;
|
11
|
10
|
import com.aurelhubert.ahbottomnavigation.AHBottomNavigationItem;
|
|
@@ -115,7 +114,7 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
|
115
|
114
|
StyleHelper.updateStyles(mToolbar, getCurrentScreen());
|
116
|
115
|
|
117
|
116
|
if (shouldToggleTabs(screen)) {
|
118
|
|
- toggleTabs(screen.bottomTabsHidden, false);
|
|
117
|
+ mBottomNavigation.toggleTabs(screen.bottomTabsHidden, false);
|
119
|
118
|
}
|
120
|
119
|
}
|
121
|
120
|
|
|
@@ -129,7 +128,7 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
|
129
|
128
|
StyleHelper.updateStyles(mToolbar, currentScreen);
|
130
|
129
|
|
131
|
130
|
if (shouldToggleTabs(currentScreen)) {
|
132
|
|
- toggleTabs(currentScreen.bottomTabsHidden, false);
|
|
131
|
+ mBottomNavigation.toggleTabs(currentScreen.bottomTabsHidden, false);
|
133
|
132
|
}
|
134
|
133
|
|
135
|
134
|
return popped;
|
|
@@ -148,7 +147,7 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
|
148
|
147
|
StyleHelper.updateStyles(mToolbar, currentScreen);
|
149
|
148
|
|
150
|
149
|
if (shouldToggleTabs(currentScreen)) {
|
151
|
|
- toggleTabs(currentScreen.bottomTabsHidden, false);
|
|
150
|
+ mBottomNavigation.toggleTabs(currentScreen.bottomTabsHidden, false);
|
152
|
151
|
}
|
153
|
152
|
|
154
|
153
|
return popped;
|
|
@@ -236,24 +235,17 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
|
236
|
235
|
public void toggleTabs(ReadableMap params) {
|
237
|
236
|
boolean hide = params.getBoolean(KEY_HIDDEN);
|
238
|
237
|
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) {
|
244
|
|
- if (hide) {
|
245
|
|
-// mBottomNavigation.hideBottomNavigation(animated);
|
246
|
|
- mBottomNavigation.setVisibility(View.GONE);
|
247
|
|
- } else {
|
248
|
|
- mBottomNavigation.setVisibility(View.VISIBLE);
|
249
|
|
-// mBottomNavigation.restoreBottomNavigation(animated);
|
250
|
|
- }
|
|
238
|
+ mBottomNavigation.toggleTabs(hide, animated);
|
251
|
239
|
}
|
252
|
240
|
|
253
|
241
|
private boolean shouldToggleTabs(Screen newScreen) {
|
254
|
242
|
return mBottomNavigation.isShown() == newScreen.bottomTabsHidden;
|
255
|
243
|
}
|
256
|
244
|
|
|
245
|
+ public void notifyScroll(int direction) {
|
|
246
|
+ mBottomNavigation.onScroll(direction);
|
|
247
|
+ }
|
|
248
|
+
|
257
|
249
|
private static class SetupTabsTask extends AsyncTask<Void, Void, Map<Screen, Drawable>> {
|
258
|
250
|
private BottomTabActivity mActivity;
|
259
|
251
|
private RnnToolBar mToolBar;
|
|
@@ -308,7 +300,6 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
|
308
|
300
|
this.onTabSelected(0, false);
|
309
|
301
|
}
|
310
|
302
|
|
311
|
|
-
|
312
|
303
|
@Override
|
313
|
304
|
protected void removeAllReactViews() {
|
314
|
305
|
for (ScreenStack screenStack : mScreenStacks) {
|