|
@@ -7,9 +7,9 @@ import com.facebook.react.bridge.WritableMap;
|
7
|
7
|
import static com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;
|
8
|
8
|
|
9
|
9
|
public class NavigationEventEmitter {
|
10
|
|
- private static String onAppLaunched = "RNN.appLaunched";
|
11
|
|
- private static String containerStart = "RNN.containerStart";
|
12
|
|
- private static String containerStop = "RNN.containerStop";
|
|
10
|
+ private static final String onAppLaunched = "RNN.appLaunched";
|
|
11
|
+ private static final String containerStart = "RNN.containerStart";
|
|
12
|
+ private static final String containerStop = "RNN.containerStop";
|
13
|
13
|
|
14
|
14
|
public static NavigationEventEmitter emit(ReactContext context) {
|
15
|
15
|
return new NavigationEventEmitter(context);
|
|
@@ -26,7 +26,28 @@ public class NavigationEventEmitter {
|
26
|
26
|
}
|
27
|
27
|
|
28
|
28
|
private void emit(String eventName) {
|
29
|
|
- WritableMap data = Arguments.createMap();
|
30
|
|
- emitter.emit(eventName, data);
|
31
|
|
- }
|
|
29
|
+ emit(eventName, Arguments.createMap());
|
|
30
|
+ }
|
|
31
|
+
|
|
32
|
+ private void emit(String eventName, WritableMap data) {
|
|
33
|
+ emitter.emit(eventName, data);
|
|
34
|
+ }
|
|
35
|
+
|
|
36
|
+ private void emit(String eventName, String param) {
|
|
37
|
+ emitter.emit(eventName, param);
|
|
38
|
+ }
|
|
39
|
+
|
|
40
|
+ public void containerStop(String id) {
|
|
41
|
+ WritableMap data = Arguments.createMap();
|
|
42
|
+ data.putString("id", id);
|
|
43
|
+// emit(containerStop, data);
|
|
44
|
+ emit(containerStop, id);
|
|
45
|
+ }
|
|
46
|
+
|
|
47
|
+ public void containerStart(String id) {
|
|
48
|
+ WritableMap data = Arguments.createMap();
|
|
49
|
+ data.putString("id", id);
|
|
50
|
+// emit(containerStart, data);
|
|
51
|
+ emit(containerStart, id);
|
|
52
|
+ }
|
32
|
53
|
}
|