Browse Source

Initial v2 commit on Android

Guy Carmeli 7 years ago
parent
commit
8d5ec5014b
100 changed files with 339 additions and 0 deletions
  1. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/NavigationApplication.java
  2. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/animation/VisibilityAnimator.java
  3. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/bridge/BundleConverter.java
  4. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/bridge/EventEmitter.java
  5. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/bridge/NavigationReactEventEmitter.java
  6. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/bridge/NavigationReactModule.java
  7. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/bridge/NavigationReactPackage.java
  8. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/controllers/ActivityCallbacks.java
  9. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/controllers/IntentDataHandler.java
  10. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/controllers/LandscapeNavigationActivity.java
  11. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/controllers/Modal.java
  12. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/controllers/ModalController.java
  13. 339
    0
      android/app/deprecated/java/com/reactnativenavigation/controllers/NavigationActivity.java
  14. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/controllers/NavigationCommandsHandler.java
  15. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/controllers/PortraitNavigationActivity.java
  16. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/controllers/SplashActivity.java
  17. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/events/ContextualMenuHiddenEvent.java
  18. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/events/Event.java
  19. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/events/EventBus.java
  20. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/events/FabSetEvent.java
  21. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/events/JsDevReloadEvent.java
  22. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/events/ModalDismissedEvent.java
  23. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/events/ScreenChangedEvent.java
  24. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/events/Subscriber.java
  25. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/events/ViewPagerScreenChangedEvent.java
  26. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/events/ViewPagerScreenScrollStartEvent.java
  27. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/layouts/BottomTabsLayout.java
  28. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/layouts/Layout.java
  29. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/layouts/LayoutFactory.java
  30. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/layouts/ModalScreenLayout.java
  31. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/layouts/ScreenStackContainer.java
  32. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/layouts/SingleScreenLayout.java
  33. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/ActivityParams.java
  34. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/AppStyle.java
  35. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/BaseScreenParams.java
  36. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/BaseTitleBarButtonParams.java
  37. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/CollapsingTopBarParams.java
  38. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/ContextualMenuButtonParams.java
  39. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/ContextualMenuParams.java
  40. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/FabActionParams.java
  41. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/FabParams.java
  42. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/NavigationParams.java
  43. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/PageParams.java
  44. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/ScreenParams.java
  45. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/SideMenuParams.java
  46. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/SnackbarParams.java
  47. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/StyleParams.java
  48. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/TitleBarButtonParams.java
  49. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/TitleBarLeftButtonParams.java
  50. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/ActivityParamsParser.java
  51. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/ButtonParser.java
  52. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/CollapsingTopBarParamsParser.java
  53. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/ContextualMenuButtonParamsParser.java
  54. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/ContextualMenuParamsParser.java
  55. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/FabActionParamsParser.java
  56. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/FabParamsParser.java
  57. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/Parser.java
  58. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/ScreenParamsParser.java
  59. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/SideMenuParamsParser.java
  60. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/SnackbarParamsParser.java
  61. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/StyleParamsParser.java
  62. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/TitleBarButtonParamsParser.java
  63. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/TitleBarLeftButtonParamsParser.java
  64. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/params/parsers/TopTabParamsParser.java
  65. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/react/ImageLoader.java
  66. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/react/JsDevImageLoader.java
  67. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/react/JsDevReloadHandler.java
  68. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/react/JsDevReloadListenerReplacer.java
  69. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/react/NavigationReactGateway.java
  70. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/react/ReactDevPermission.java
  71. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/react/ReactGateway.java
  72. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/react/ResourceDrawableIdHelper.java
  73. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/screens/CollapsingSingleScreen.java
  74. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/screens/CollapsingViewPagerScreen.java
  75. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/screens/ContentViewPagerAdapter.java
  76. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/screens/FragmentScreen.java
  77. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/screens/Screen.java
  78. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/screens/ScreenAnimator.java
  79. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/screens/ScreenFactory.java
  80. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/screens/ScreenStack.java
  81. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/screens/SingleScreen.java
  82. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/screens/ViewPagerScreen.java
  83. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/utils/KeyboardVisibilityDetector.java
  84. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/utils/ReflectionUtils.java
  85. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/utils/Task.java
  86. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/utils/ViewUtils.java
  87. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/BottomTabs.java
  88. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/ButtonFactory.java
  89. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/CollapsingContentView.java
  90. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/ContentView.java
  91. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/ContextualMenu.java
  92. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/ContextualMenuButton.java
  93. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/FloatingActionButtonAnimator.java
  94. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/FloatingActionButtonCoordinator.java
  95. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/LeftButton.java
  96. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/LeftButtonOnClickListener.java
  97. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/Scrim.java
  98. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/ScrollDirectionListener.java
  99. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/SideMenu.java
  100. 0
    0
      android/app/deprecated/java/com/reactnativenavigation/views/SnackbarAndFabContainer.java

android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java → android/app/deprecated/java/com/reactnativenavigation/NavigationApplication.java View File


android/app/src/main/java/com/reactnativenavigation/animation/VisibilityAnimator.java → android/app/deprecated/java/com/reactnativenavigation/animation/VisibilityAnimator.java View File


android/app/src/main/java/com/reactnativenavigation/bridge/BundleConverter.java → android/app/deprecated/java/com/reactnativenavigation/bridge/BundleConverter.java View File


android/app/src/main/java/com/reactnativenavigation/bridge/EventEmitter.java → android/app/deprecated/java/com/reactnativenavigation/bridge/EventEmitter.java View File


android/app/src/main/java/com/reactnativenavigation/bridge/NavigationReactEventEmitter.java → android/app/deprecated/java/com/reactnativenavigation/bridge/NavigationReactEventEmitter.java View File


android/app/src/main/java/com/reactnativenavigation/bridge/NavigationReactModule.java → android/app/deprecated/java/com/reactnativenavigation/bridge/NavigationReactModule.java View File


android/app/src/main/java/com/reactnativenavigation/bridge/NavigationReactPackage.java → android/app/deprecated/java/com/reactnativenavigation/bridge/NavigationReactPackage.java View File


android/app/src/main/java/com/reactnativenavigation/controllers/ActivityCallbacks.java → android/app/deprecated/java/com/reactnativenavigation/controllers/ActivityCallbacks.java View File


android/app/src/main/java/com/reactnativenavigation/controllers/IntentDataHandler.java → android/app/deprecated/java/com/reactnativenavigation/controllers/IntentDataHandler.java View File


android/app/src/main/java/com/reactnativenavigation/controllers/LandscapeNavigationActivity.java → android/app/deprecated/java/com/reactnativenavigation/controllers/LandscapeNavigationActivity.java View File


android/app/src/main/java/com/reactnativenavigation/controllers/Modal.java → android/app/deprecated/java/com/reactnativenavigation/controllers/Modal.java View File


android/app/src/main/java/com/reactnativenavigation/controllers/ModalController.java → android/app/deprecated/java/com/reactnativenavigation/controllers/ModalController.java View File


+ 339
- 0
android/app/deprecated/java/com/reactnativenavigation/controllers/NavigationActivity.java View File

@@ -0,0 +1,339 @@
1
+package com.reactnativenavigation.controllers;
2
+
3
+import android.annotation.TargetApi;
4
+import android.content.Intent;
5
+import android.os.Build;
6
+import android.os.Bundle;
7
+import android.support.annotation.Nullable;
8
+import android.support.v7.app.AppCompatActivity;
9
+import android.view.KeyEvent;
10
+
11
+import com.facebook.react.bridge.Callback;
12
+import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
13
+import com.facebook.react.modules.core.PermissionAwareActivity;
14
+import com.facebook.react.modules.core.PermissionListener;
15
+import com.reactnativenavigation.NavigationApplication;
16
+import com.reactnativenavigation.events.Event;
17
+import com.reactnativenavigation.events.EventBus;
18
+import com.reactnativenavigation.events.JsDevReloadEvent;
19
+import com.reactnativenavigation.events.ModalDismissedEvent;
20
+import com.reactnativenavigation.events.Subscriber;
21
+import com.reactnativenavigation.layouts.BottomTabsLayout;
22
+import com.reactnativenavigation.layouts.Layout;
23
+import com.reactnativenavigation.layouts.LayoutFactory;
24
+import com.reactnativenavigation.params.ActivityParams;
25
+import com.reactnativenavigation.params.AppStyle;
26
+import com.reactnativenavigation.params.ContextualMenuParams;
27
+import com.reactnativenavigation.params.FabParams;
28
+import com.reactnativenavigation.params.ScreenParams;
29
+import com.reactnativenavigation.params.SnackbarParams;
30
+import com.reactnativenavigation.params.TitleBarButtonParams;
31
+import com.reactnativenavigation.params.TitleBarLeftButtonParams;
32
+import com.reactnativenavigation.react.JsDevReloadHandler;
33
+import com.reactnativenavigation.views.SideMenu.Side;
34
+
35
+import java.util.List;
36
+
37
+public class NavigationActivity extends AppCompatActivity implements DefaultHardwareBackBtnHandler, Subscriber, PermissionAwareActivity {
38
+
39
+    /**
40
+     * Although we start multiple activities, we make sure to pass Intent.CLEAR_TASK | Intent.NEW_TASK
41
+     * So that we actually have only 1 instance of the activity running at one time.
42
+     * We hold the currentActivity (resume->pause) so we know when we need to destroy the javascript context
43
+     * (when currentActivity is null, ie pause and destroy was called without resume).
44
+     * This is somewhat weird, and in the future we better use a single activity with changing contentView similar to ReactNative impl.
45
+     * Along with that, we should handle commands from the bridge using onNewIntent
46
+     */
47
+    static NavigationActivity currentActivity;
48
+
49
+    private ActivityParams activityParams;
50
+    private ModalController modalController;
51
+    private Layout layout;
52
+    @Nullable private PermissionListener mPermissionListener;
53
+
54
+    @Override
55
+    protected void onCreate(Bundle savedInstanceState) {
56
+        super.onCreate(savedInstanceState);
57
+
58
+        if (!NavigationApplication.instance.isReactContextInitialized()) {
59
+            NavigationApplication.instance.startReactContextOnceInBackgroundAndExecuteJS();
60
+            return;
61
+        }
62
+
63
+        activityParams = NavigationCommandsHandler.parseActivityParams(getIntent());
64
+
65
+        disableActivityShowAnimationIfNeeded();
66
+        createLayout();
67
+        createModalController();
68
+        NavigationApplication.instance.getActivityCallbacks().onActivityCreated(this, savedInstanceState);
69
+    }
70
+
71
+    private void disableActivityShowAnimationIfNeeded() {
72
+        if (!activityParams.animateShow) {
73
+            overridePendingTransition(0, 0);
74
+        }
75
+    }
76
+
77
+    private void createModalController() {
78
+        modalController = new ModalController(this);
79
+    }
80
+
81
+    private void createLayout() {
82
+        layout = LayoutFactory.create(this, activityParams);
83
+        if (hasBackgroundColor()) {
84
+            layout.asView().setBackgroundColor(AppStyle.appStyle.screenBackgroundColor.getColor());
85
+        }
86
+        setContentView(layout.asView());
87
+    }
88
+
89
+    private boolean hasBackgroundColor() {
90
+        return AppStyle.appStyle.screenBackgroundColor != null &&
91
+               AppStyle.appStyle.screenBackgroundColor.hasColor();
92
+    }
93
+
94
+    @Override
95
+    protected void onStart() {
96
+        super.onStart();
97
+        NavigationApplication.instance.getActivityCallbacks().onActivityStarted(this);
98
+    }
99
+
100
+    @Override
101
+    protected void onResume() {
102
+        super.onResume();
103
+        if (isFinishing() || !NavigationApplication.instance.isReactContextInitialized()) {
104
+            return;
105
+        }
106
+
107
+        currentActivity = this;
108
+        setDeepLinkData();
109
+        NavigationApplication.instance.getReactGateway().onResumeActivity(this, this);
110
+        NavigationApplication.instance.getActivityCallbacks().onActivityResumed(this);
111
+        EventBus.instance.register(this);
112
+    }
113
+
114
+    private void setDeepLinkData() {
115
+        if (IntentDataHandler.hasIntentData()) {
116
+            IntentDataHandler.setIntentData(getIntent());
117
+        }
118
+    }
119
+
120
+    @Override
121
+    protected void onPause() {
122
+        super.onPause();
123
+        currentActivity = null;
124
+        NavigationApplication.instance.getReactGateway().onPauseActivity();
125
+        NavigationApplication.instance.getActivityCallbacks().onActivityPaused(this);
126
+        EventBus.instance.unregister(this);
127
+    }
128
+
129
+    @Override
130
+    protected void onStop() {
131
+        super.onStop();
132
+        NavigationApplication.instance.getActivityCallbacks().onActivityStopped(this);
133
+    }
134
+
135
+    @Override
136
+    protected void onDestroy() {
137
+        destroyLayouts();
138
+        destroyJsIfNeeded();
139
+        NavigationApplication.instance.getActivityCallbacks().onActivityDestroyed(this);
140
+        super.onDestroy();
141
+    }
142
+
143
+    private void destroyLayouts() {
144
+        if (modalController != null) {
145
+            modalController.destroy();
146
+        }
147
+        if (layout != null) {
148
+            layout.destroy();
149
+            layout = null;
150
+        }
151
+    }
152
+
153
+    private void destroyJsIfNeeded() {
154
+        if (currentActivity == null || currentActivity.isFinishing()) {
155
+            NavigationApplication.instance.getReactGateway().onDestroyApp();
156
+        }
157
+    }
158
+
159
+    @Override
160
+    public void invokeDefaultOnBackPressed() {
161
+        super.onBackPressed();
162
+    }
163
+
164
+    @Override
165
+    public void onBackPressed() {
166
+        if (layout != null && !layout.onBackPressed()) {
167
+            NavigationApplication.instance.getReactGateway().onBackPressed();
168
+        }
169
+    }
170
+
171
+    @Override
172
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
173
+        NavigationApplication.instance.getReactGateway().onActivityResult(requestCode, resultCode, data);
174
+        NavigationApplication.instance.getActivityCallbacks().onActivityResult(requestCode, resultCode, data);
175
+    }
176
+
177
+    @Override
178
+    public boolean onKeyUp(int keyCode, KeyEvent event) {
179
+        return JsDevReloadHandler.onKeyUp(getCurrentFocus(), keyCode) || super.onKeyUp(keyCode, event);
180
+    }
181
+
182
+    void push(ScreenParams params) {
183
+        if (modalController.containsNavigator(params.getNavigatorId())) {
184
+            modalController.push(params);
185
+        } else {
186
+            layout.push(params);
187
+        }
188
+    }
189
+
190
+    void pop(ScreenParams params) {
191
+        if (modalController.containsNavigator(params.getNavigatorId())) {
192
+            modalController.pop(params);
193
+        } else {
194
+            layout.pop(params);
195
+        }
196
+    }
197
+
198
+    void popToRoot(ScreenParams params) {
199
+        if (modalController.containsNavigator(params.getNavigatorId())) {
200
+            modalController.popToRoot(params);
201
+        } else {
202
+            layout.popToRoot(params);
203
+        }
204
+    }
205
+
206
+    void newStack(ScreenParams params) {
207
+        if (modalController.containsNavigator(params.getNavigatorId())) {
208
+            modalController.newStack(params);
209
+        } else {
210
+            layout.newStack(params);
211
+        }
212
+    }
213
+
214
+    void showModal(ScreenParams screenParams) {
215
+        modalController.showModal(screenParams);
216
+    }
217
+
218
+    void dismissTopModal() {
219
+        modalController.dismissTopModal();
220
+    }
221
+
222
+    void dismissAllModals() {
223
+        modalController.dismissAllModals();
224
+    }
225
+
226
+    //TODO all these setters should be combined to something like setStyle
227
+    void setTopBarVisible(String screenInstanceId, boolean hidden, boolean animated) {
228
+        layout.setTopBarVisible(screenInstanceId, hidden, animated);
229
+        modalController.setTopBarVisible(screenInstanceId, hidden, animated);
230
+    }
231
+
232
+    void setBottomTabsVisible(boolean hidden, boolean animated) {
233
+        if (layout instanceof BottomTabsLayout) {
234
+            ((BottomTabsLayout) layout).setBottomTabsVisible(hidden, animated);
235
+        }
236
+    }
237
+
238
+    void setTitleBarTitle(String screenInstanceId, String title) {
239
+        layout.setTitleBarTitle(screenInstanceId, title);
240
+        modalController.setTitleBarTitle(screenInstanceId, title);
241
+    }
242
+
243
+    public void setTitleBarSubtitle(String screenInstanceId, String subtitle) {
244
+        layout.setTitleBarSubtitle(screenInstanceId, subtitle);
245
+        modalController.setTitleBarSubtitle(screenInstanceId, subtitle);
246
+    }
247
+
248
+    void setTitleBarButtons(String screenInstanceId, String navigatorEventId, List<TitleBarButtonParams> titleBarButtons) {
249
+        layout.setTitleBarRightButtons(screenInstanceId, navigatorEventId, titleBarButtons);
250
+        modalController.setTitleBarRightButtons(screenInstanceId, navigatorEventId, titleBarButtons);
251
+    }
252
+
253
+    void setTitleBarLeftButton(String screenInstanceId, String navigatorEventId, TitleBarLeftButtonParams titleBarLeftButton) {
254
+        layout.setTitleBarLeftButton(screenInstanceId, navigatorEventId, titleBarLeftButton);
255
+        modalController.setTitleBarLeftButton(screenInstanceId, navigatorEventId, titleBarLeftButton);
256
+    }
257
+
258
+    void setScreenFab(String screenInstanceId, String navigatorEventId, FabParams fab) {
259
+        layout.setFab(screenInstanceId, navigatorEventId, fab);
260
+    }
261
+
262
+    public void toggleSideMenuVisible(boolean animated, Side side) {
263
+        layout.toggleSideMenuVisible(animated, side);
264
+    }
265
+
266
+    public void setSideMenuVisible(boolean animated, boolean visible, Side side) {
267
+        layout.setSideMenuVisible(animated, visible, side);
268
+    }
269
+
270
+    public void selectBottomTabByTabIndex(Integer index) {
271
+        if (layout instanceof BottomTabsLayout) {
272
+            ((BottomTabsLayout) layout).selectBottomTabByTabIndex(index);
273
+        }
274
+    }
275
+
276
+    public void selectBottomTabByNavigatorId(String navigatorId) {
277
+        if (layout instanceof BottomTabsLayout) {
278
+            ((BottomTabsLayout) layout).selectBottomTabByNavigatorId(navigatorId);
279
+        }
280
+    }
281
+
282
+    public void setBottomTabBadgeByIndex(Integer index, String badge) {
283
+        if (layout instanceof BottomTabsLayout) {
284
+            ((BottomTabsLayout) layout).setBottomTabBadgeByIndex(index, badge);
285
+        }
286
+    }
287
+
288
+    public void setBottomTabBadgeByNavigatorId(String navigatorId, String badge) {
289
+        if (layout instanceof BottomTabsLayout) {
290
+            ((BottomTabsLayout) layout).setBottomTabBadgeByNavigatorId(navigatorId, badge);
291
+        }
292
+    }
293
+
294
+    public void showSnackbar(SnackbarParams params) {
295
+        layout.showSnackbar(params);
296
+    }
297
+
298
+    public void showContextualMenu(String screenInstanceId, ContextualMenuParams params, Callback onButtonClicked) {
299
+        layout.showContextualMenu(screenInstanceId, params, onButtonClicked);
300
+        modalController.showContextualMenu(screenInstanceId, params, onButtonClicked);
301
+    }
302
+
303
+    public void dismissContextualMenu(String screenInstanceId) {
304
+        layout.dismissContextualMenu(screenInstanceId);
305
+        modalController.dismissContextualMenu(screenInstanceId);
306
+    }
307
+
308
+    @Override
309
+    public void onEvent(Event event) {
310
+        if (event.getType().equals(ModalDismissedEvent.TYPE)) {
311
+            handleModalDismissedEvent();
312
+        } else if (event.getType().equals(JsDevReloadEvent.TYPE)) {
313
+            handleJsDevReloadEvent();
314
+        }
315
+    }
316
+
317
+    private void handleModalDismissedEvent() {
318
+        if (!modalController.isShowing()) {
319
+            layout.onModalDismissed();
320
+        }
321
+    }
322
+
323
+    private void handleJsDevReloadEvent() {
324
+        modalController.destroy();
325
+        layout.destroy();
326
+    }
327
+
328
+    @TargetApi(Build.VERSION_CODES.M)
329
+    public void requestPermissions(String[] permissions, int requestCode, PermissionListener listener) {
330
+        mPermissionListener = listener;
331
+        requestPermissions(permissions, requestCode);
332
+    }
333
+
334
+    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
335
+        if (mPermissionListener != null && mPermissionListener.onRequestPermissionsResult(requestCode, permissions, grantResults)) {
336
+            mPermissionListener = null;
337
+        }
338
+    }
339
+}

android/app/src/main/java/com/reactnativenavigation/controllers/NavigationCommandsHandler.java → android/app/deprecated/java/com/reactnativenavigation/controllers/NavigationCommandsHandler.java View File


android/app/src/main/java/com/reactnativenavigation/controllers/PortraitNavigationActivity.java → android/app/deprecated/java/com/reactnativenavigation/controllers/PortraitNavigationActivity.java View File


android/app/src/main/java/com/reactnativenavigation/controllers/SplashActivity.java → android/app/deprecated/java/com/reactnativenavigation/controllers/SplashActivity.java View File


android/app/src/main/java/com/reactnativenavigation/events/ContextualMenuHiddenEvent.java → android/app/deprecated/java/com/reactnativenavigation/events/ContextualMenuHiddenEvent.java View File


android/app/src/main/java/com/reactnativenavigation/events/Event.java → android/app/deprecated/java/com/reactnativenavigation/events/Event.java View File


android/app/src/main/java/com/reactnativenavigation/events/EventBus.java → android/app/deprecated/java/com/reactnativenavigation/events/EventBus.java View File


android/app/src/main/java/com/reactnativenavigation/events/FabSetEvent.java → android/app/deprecated/java/com/reactnativenavigation/events/FabSetEvent.java View File


android/app/src/main/java/com/reactnativenavigation/events/JsDevReloadEvent.java → android/app/deprecated/java/com/reactnativenavigation/events/JsDevReloadEvent.java View File


android/app/src/main/java/com/reactnativenavigation/events/ModalDismissedEvent.java → android/app/deprecated/java/com/reactnativenavigation/events/ModalDismissedEvent.java View File


android/app/src/main/java/com/reactnativenavigation/events/ScreenChangedEvent.java → android/app/deprecated/java/com/reactnativenavigation/events/ScreenChangedEvent.java View File


android/app/src/main/java/com/reactnativenavigation/events/Subscriber.java → android/app/deprecated/java/com/reactnativenavigation/events/Subscriber.java View File


android/app/src/main/java/com/reactnativenavigation/events/ViewPagerScreenChangedEvent.java → android/app/deprecated/java/com/reactnativenavigation/events/ViewPagerScreenChangedEvent.java View File


android/app/src/main/java/com/reactnativenavigation/events/ViewPagerScreenScrollStartEvent.java → android/app/deprecated/java/com/reactnativenavigation/events/ViewPagerScreenScrollStartEvent.java View File


android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java → android/app/deprecated/java/com/reactnativenavigation/layouts/BottomTabsLayout.java View File


android/app/src/main/java/com/reactnativenavigation/layouts/Layout.java → android/app/deprecated/java/com/reactnativenavigation/layouts/Layout.java View File


android/app/src/main/java/com/reactnativenavigation/layouts/LayoutFactory.java → android/app/deprecated/java/com/reactnativenavigation/layouts/LayoutFactory.java View File


android/app/src/main/java/com/reactnativenavigation/layouts/ModalScreenLayout.java → android/app/deprecated/java/com/reactnativenavigation/layouts/ModalScreenLayout.java View File


android/app/src/main/java/com/reactnativenavigation/layouts/ScreenStackContainer.java → android/app/deprecated/java/com/reactnativenavigation/layouts/ScreenStackContainer.java View File


android/app/src/main/java/com/reactnativenavigation/layouts/SingleScreenLayout.java → android/app/deprecated/java/com/reactnativenavigation/layouts/SingleScreenLayout.java View File


android/app/src/main/java/com/reactnativenavigation/params/ActivityParams.java → android/app/deprecated/java/com/reactnativenavigation/params/ActivityParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/AppStyle.java → android/app/deprecated/java/com/reactnativenavigation/params/AppStyle.java View File


android/app/src/main/java/com/reactnativenavigation/params/BaseScreenParams.java → android/app/deprecated/java/com/reactnativenavigation/params/BaseScreenParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/BaseTitleBarButtonParams.java → android/app/deprecated/java/com/reactnativenavigation/params/BaseTitleBarButtonParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/CollapsingTopBarParams.java → android/app/deprecated/java/com/reactnativenavigation/params/CollapsingTopBarParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/ContextualMenuButtonParams.java → android/app/deprecated/java/com/reactnativenavigation/params/ContextualMenuButtonParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/ContextualMenuParams.java → android/app/deprecated/java/com/reactnativenavigation/params/ContextualMenuParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/FabActionParams.java → android/app/deprecated/java/com/reactnativenavigation/params/FabActionParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/FabParams.java → android/app/deprecated/java/com/reactnativenavigation/params/FabParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/NavigationParams.java → android/app/deprecated/java/com/reactnativenavigation/params/NavigationParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/PageParams.java → android/app/deprecated/java/com/reactnativenavigation/params/PageParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/ScreenParams.java → android/app/deprecated/java/com/reactnativenavigation/params/ScreenParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/SideMenuParams.java → android/app/deprecated/java/com/reactnativenavigation/params/SideMenuParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/SnackbarParams.java → android/app/deprecated/java/com/reactnativenavigation/params/SnackbarParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/StyleParams.java → android/app/deprecated/java/com/reactnativenavigation/params/StyleParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/TitleBarButtonParams.java → android/app/deprecated/java/com/reactnativenavigation/params/TitleBarButtonParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/TitleBarLeftButtonParams.java → android/app/deprecated/java/com/reactnativenavigation/params/TitleBarLeftButtonParams.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/ActivityParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/ActivityParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/ButtonParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/ButtonParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/CollapsingTopBarParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/CollapsingTopBarParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/ContextualMenuButtonParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/ContextualMenuButtonParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/ContextualMenuParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/ContextualMenuParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/FabActionParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/FabActionParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/FabParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/FabParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/Parser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/Parser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/ScreenParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/ScreenParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/SideMenuParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/SideMenuParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/SnackbarParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/SnackbarParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/StyleParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/StyleParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/TitleBarButtonParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/TitleBarButtonParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/TitleBarLeftButtonParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/TitleBarLeftButtonParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/params/parsers/TopTabParamsParser.java → android/app/deprecated/java/com/reactnativenavigation/params/parsers/TopTabParamsParser.java View File


android/app/src/main/java/com/reactnativenavigation/react/ImageLoader.java → android/app/deprecated/java/com/reactnativenavigation/react/ImageLoader.java View File


android/app/src/main/java/com/reactnativenavigation/react/JsDevImageLoader.java → android/app/deprecated/java/com/reactnativenavigation/react/JsDevImageLoader.java View File


android/app/src/main/java/com/reactnativenavigation/react/JsDevReloadHandler.java → android/app/deprecated/java/com/reactnativenavigation/react/JsDevReloadHandler.java View File


android/app/src/main/java/com/reactnativenavigation/react/JsDevReloadListenerReplacer.java → android/app/deprecated/java/com/reactnativenavigation/react/JsDevReloadListenerReplacer.java View File


android/app/src/main/java/com/reactnativenavigation/react/NavigationReactGateway.java → android/app/deprecated/java/com/reactnativenavigation/react/NavigationReactGateway.java View File


android/app/src/main/java/com/reactnativenavigation/react/ReactDevPermission.java → android/app/deprecated/java/com/reactnativenavigation/react/ReactDevPermission.java View File


android/app/src/main/java/com/reactnativenavigation/react/ReactGateway.java → android/app/deprecated/java/com/reactnativenavigation/react/ReactGateway.java View File


android/app/src/main/java/com/reactnativenavigation/react/ResourceDrawableIdHelper.java → android/app/deprecated/java/com/reactnativenavigation/react/ResourceDrawableIdHelper.java View File


android/app/src/main/java/com/reactnativenavigation/screens/CollapsingSingleScreen.java → android/app/deprecated/java/com/reactnativenavigation/screens/CollapsingSingleScreen.java View File


android/app/src/main/java/com/reactnativenavigation/screens/CollapsingViewPagerScreen.java → android/app/deprecated/java/com/reactnativenavigation/screens/CollapsingViewPagerScreen.java View File


android/app/src/main/java/com/reactnativenavigation/screens/ContentViewPagerAdapter.java → android/app/deprecated/java/com/reactnativenavigation/screens/ContentViewPagerAdapter.java View File


android/app/src/main/java/com/reactnativenavigation/screens/FragmentScreen.java → android/app/deprecated/java/com/reactnativenavigation/screens/FragmentScreen.java View File


android/app/src/main/java/com/reactnativenavigation/screens/Screen.java → android/app/deprecated/java/com/reactnativenavigation/screens/Screen.java View File


android/app/src/main/java/com/reactnativenavigation/screens/ScreenAnimator.java → android/app/deprecated/java/com/reactnativenavigation/screens/ScreenAnimator.java View File


android/app/src/main/java/com/reactnativenavigation/screens/ScreenFactory.java → android/app/deprecated/java/com/reactnativenavigation/screens/ScreenFactory.java View File


android/app/src/main/java/com/reactnativenavigation/screens/ScreenStack.java → android/app/deprecated/java/com/reactnativenavigation/screens/ScreenStack.java View File


android/app/src/main/java/com/reactnativenavigation/screens/SingleScreen.java → android/app/deprecated/java/com/reactnativenavigation/screens/SingleScreen.java View File


android/app/src/main/java/com/reactnativenavigation/screens/ViewPagerScreen.java → android/app/deprecated/java/com/reactnativenavigation/screens/ViewPagerScreen.java View File


android/app/src/main/java/com/reactnativenavigation/utils/KeyboardVisibilityDetector.java → android/app/deprecated/java/com/reactnativenavigation/utils/KeyboardVisibilityDetector.java View File


android/app/src/main/java/com/reactnativenavigation/utils/ReflectionUtils.java → android/app/deprecated/java/com/reactnativenavigation/utils/ReflectionUtils.java View File


android/app/src/main/java/com/reactnativenavigation/utils/Task.java → android/app/deprecated/java/com/reactnativenavigation/utils/Task.java View File


android/app/src/main/java/com/reactnativenavigation/utils/ViewUtils.java → android/app/deprecated/java/com/reactnativenavigation/utils/ViewUtils.java View File


android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java → android/app/deprecated/java/com/reactnativenavigation/views/BottomTabs.java View File


android/app/src/main/java/com/reactnativenavigation/views/ButtonFactory.java → android/app/deprecated/java/com/reactnativenavigation/views/ButtonFactory.java View File


android/app/src/main/java/com/reactnativenavigation/views/CollapsingContentView.java → android/app/deprecated/java/com/reactnativenavigation/views/CollapsingContentView.java View File


android/app/src/main/java/com/reactnativenavigation/views/ContentView.java → android/app/deprecated/java/com/reactnativenavigation/views/ContentView.java View File


android/app/src/main/java/com/reactnativenavigation/views/ContextualMenu.java → android/app/deprecated/java/com/reactnativenavigation/views/ContextualMenu.java View File


android/app/src/main/java/com/reactnativenavigation/views/ContextualMenuButton.java → android/app/deprecated/java/com/reactnativenavigation/views/ContextualMenuButton.java View File


android/app/src/main/java/com/reactnativenavigation/views/FloatingActionButtonAnimator.java → android/app/deprecated/java/com/reactnativenavigation/views/FloatingActionButtonAnimator.java View File


android/app/src/main/java/com/reactnativenavigation/views/FloatingActionButtonCoordinator.java → android/app/deprecated/java/com/reactnativenavigation/views/FloatingActionButtonCoordinator.java View File


android/app/src/main/java/com/reactnativenavigation/views/LeftButton.java → android/app/deprecated/java/com/reactnativenavigation/views/LeftButton.java View File


android/app/src/main/java/com/reactnativenavigation/views/LeftButtonOnClickListener.java → android/app/deprecated/java/com/reactnativenavigation/views/LeftButtonOnClickListener.java View File


android/app/src/main/java/com/reactnativenavigation/views/Scrim.java → android/app/deprecated/java/com/reactnativenavigation/views/Scrim.java View File


android/app/src/main/java/com/reactnativenavigation/views/ScrollDirectionListener.java → android/app/deprecated/java/com/reactnativenavigation/views/ScrollDirectionListener.java View File


android/app/src/main/java/com/reactnativenavigation/views/SideMenu.java → android/app/deprecated/java/com/reactnativenavigation/views/SideMenu.java View File


android/app/src/main/java/com/reactnativenavigation/views/SnackbarAndFabContainer.java → android/app/deprecated/java/com/reactnativenavigation/views/SnackbarAndFabContainer.java View File


Some files were not shown because too many files changed in this diff