|
@@ -9,22 +9,15 @@ import android.support.annotation.Nullable;
|
9
|
9
|
import android.support.v7.app.AppCompatActivity;
|
10
|
10
|
import android.view.KeyEvent;
|
11
|
11
|
|
12
|
|
-import com.facebook.react.bridge.Arguments;
|
13
|
12
|
import com.facebook.react.bridge.Callback;
|
14
|
|
-import com.facebook.react.bridge.ReactContext;
|
15
|
|
-import com.facebook.react.bridge.WritableMap;
|
16
|
13
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
17
|
|
-import com.facebook.react.modules.core.DeviceEventManagerModule;
|
18
|
14
|
import com.facebook.react.modules.core.PermissionAwareActivity;
|
19
|
15
|
import com.facebook.react.modules.core.PermissionListener;
|
20
|
16
|
import com.reactnativenavigation.NavigationApplication;
|
21
|
|
-import com.reactnativenavigation.bridge.EventEmitter;
|
22
|
|
-import com.reactnativenavigation.bridge.NavigationReactEventEmitter;
|
23
|
17
|
import com.reactnativenavigation.events.Event;
|
24
|
18
|
import com.reactnativenavigation.events.EventBus;
|
25
|
19
|
import com.reactnativenavigation.events.JsDevReloadEvent;
|
26
|
20
|
import com.reactnativenavigation.events.ModalDismissedEvent;
|
27
|
|
-import com.reactnativenavigation.events.OrientationChangedEvent;
|
28
|
21
|
import com.reactnativenavigation.events.Subscriber;
|
29
|
22
|
import com.reactnativenavigation.layouts.BottomTabsLayout;
|
30
|
23
|
import com.reactnativenavigation.layouts.Layout;
|
|
@@ -39,6 +32,7 @@ import com.reactnativenavigation.params.SnackbarParams;
|
39
|
32
|
import com.reactnativenavigation.params.TitleBarButtonParams;
|
40
|
33
|
import com.reactnativenavigation.params.TitleBarLeftButtonParams;
|
41
|
34
|
import com.reactnativenavigation.react.ReactGateway;
|
|
35
|
+import com.reactnativenavigation.utils.Orientation;
|
42
|
36
|
import com.reactnativenavigation.views.SideMenu.Side;
|
43
|
37
|
|
44
|
38
|
import java.util.List;
|
|
@@ -197,23 +191,7 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
197
|
191
|
|
198
|
192
|
@Override
|
199
|
193
|
public void onConfigurationChanged(Configuration newConfig) {
|
200
|
|
- EventEmitter eventEmitter = NavigationApplication.instance.getEventEmitter();
|
201
|
|
- OrientationChangedEvent event = new OrientationChangedEvent();
|
202
|
|
- WritableMap params = Arguments.createMap();
|
203
|
|
-
|
204
|
|
- if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
205
|
|
- params.putString("orientation", "LANDSCAPE");
|
206
|
|
- }
|
207
|
|
-
|
208
|
|
- if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
209
|
|
- params.putString("orientation", "PORTRAIT");
|
210
|
|
- }
|
211
|
|
-
|
212
|
|
- if (newConfig.orientation == Configuration.ORIENTATION_UNDEFINED) {
|
213
|
|
- params.putString("orientation", "UNDEFINED");
|
214
|
|
- }
|
215
|
|
-
|
216
|
|
- eventEmitter.sendNavigatorEvent(event.getType(), params);
|
|
194
|
+ Orientation.onConfigurationChanged(newConfig);
|
217
|
195
|
NavigationApplication.instance.getActivityCallbacks().onConfigurationChanged(newConfig);
|
218
|
196
|
super.onConfigurationChanged(newConfig);
|
219
|
197
|
}
|