Daniel Zlotin 8 yıl önce
ebeveyn
işleme
e97ede9a32

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/controllers/ActivityLifecycleDelegate.java Dosyayı Görüntüle

@@ -4,7 +4,7 @@ import com.facebook.react.ReactInstanceManager;
4 4
 import com.facebook.react.bridge.ReactContext;
5 5
 import com.reactnativenavigation.NavigationActivity;
6 6
 import com.reactnativenavigation.react.DevPermissionRequest;
7
-import com.reactnativenavigation.react.NavigationEventEmitter;
7
+import com.reactnativenavigation.react.NavigationEvent;
8 8
 
9 9
 import java.util.concurrent.atomic.AtomicBoolean;
10 10
 
@@ -60,7 +60,7 @@ public class ActivityLifecycleDelegate {
60 60
 
61 61
 	private void emitAppLaunchedOnceIfNeeded() {
62 62
 		if (appLaunchEmitted.compareAndSet(false, true)) {
63
-			new NavigationEventEmitter(reactInstanceManager.getCurrentReactContext()).appLaunched();
63
+			new NavigationEvent(reactInstanceManager.getCurrentReactContext()).appLaunched();
64 64
 		}
65 65
 	}
66 66
 

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/layout/impl/RootLayout.java Dosyayı Görüntüle

@@ -8,7 +8,7 @@ import android.widget.FrameLayout;
8 8
 import com.facebook.react.ReactInstanceManager;
9 9
 import com.facebook.react.ReactRootView;
10 10
 import com.reactnativenavigation.layout.Layout;
11
-import com.reactnativenavigation.react.NavigationEventEmitter;
11
+import com.reactnativenavigation.react.NavigationEvent;
12 12
 import com.reactnativenavigation.utils.CompatUtils;
13 13
 
14 14
 public class RootLayout implements Layout, View.OnAttachStateChangeListener {
@@ -61,10 +61,10 @@ public class RootLayout implements Layout, View.OnAttachStateChangeListener {
61 61
 	}
62 62
 
63 63
 	private void onStart() {
64
-		new NavigationEventEmitter(reactInstanceManager.getCurrentReactContext()).containerStart(id);
64
+		new NavigationEvent(reactInstanceManager.getCurrentReactContext()).containerStart(id);
65 65
 	}
66 66
 
67 67
 	private void onStop() {
68
-		new NavigationEventEmitter(reactInstanceManager.getCurrentReactContext()).containerStop(id);
68
+		new NavigationEvent(reactInstanceManager.getCurrentReactContext()).containerStop(id);
69 69
 	}
70 70
 }

lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationEventEmitter.java → lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationEvent.java Dosyayı Görüntüle

@@ -7,14 +7,14 @@ import com.facebook.react.modules.core.DeviceEventManagerModule;
7 7
 
8 8
 import static com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;
9 9
 
10
-public class NavigationEventEmitter {
10
+public class NavigationEvent {
11 11
 	private static final String onAppLaunched = "RNN.appLaunched";
12 12
 	private static final String containerStart = "RNN.containerStart";
13 13
 	private static final String containerStop = "RNN.containerStop";
14 14
 
15 15
 	private final RCTDeviceEventEmitter emitter;
16 16
 
17
-	public NavigationEventEmitter(ReactContext reactContext) {
17
+	public NavigationEvent(ReactContext reactContext) {
18 18
 		this.emitter = reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);
19 19
 	}
20 20
 
@@ -23,16 +23,10 @@ public class NavigationEventEmitter {
23 23
 	}
24 24
 
25 25
 	public void containerStop(String id) {
26
-		WritableMap data = Arguments.createMap();
27
-		data.putString("id", id);
28
-//        emit(containerStop, data);
29 26
 		emit(containerStop, id);
30 27
 	}
31 28
 
32 29
 	public void containerStart(String id) {
33
-		WritableMap data = Arguments.createMap();
34
-		data.putString("id", id);
35
-//        emit(containerStart, data);
36 30
 		emit(containerStart, id);
37 31
 	}
38 32