Kaynağa Gözat

Send event type when pressing Toolbar buttons

Guy Carmeli 8 yıl önce
ebeveyn
işleme
6296cb1b09

+ 3
- 0
android/app/src/main/java/com/reactnativenavigation/core/RctManager.java Dosyayı Görüntüle

@@ -25,6 +25,8 @@ import static com.facebook.react.modules.core.DeviceEventManagerModule.RCTDevice
25 25
 public class RctManager {
26 26
     private static final String TAG = "RctManager";
27 27
     private static final String KEY_EVENT_ID = "id";
28
+    private static final String KEY_EVENT_TYPE = "type";
29
+    private static final String EVENT_TYPE = "NavBarButtonPress";
28 30
     private static RctManager sInstance;
29 31
 
30 32
     private ReactInstanceManager mReactManager;
@@ -136,6 +138,7 @@ public class RctManager {
136 138
             return;
137 139
         }
138 140
 
141
+        params.putString(KEY_EVENT_TYPE, EVENT_TYPE);
139 142
         params.putString(KEY_EVENT_ID, eventName);
140 143
         params.putString(Screen.KEY_NAVIGATOR_EVENT_ID, screen.navigatorEventId);
141 144
         eventEmitter.emit(screen.navigatorEventId, params);