瀏覽代碼

Send event type when pressing Toolbar buttons

Guy Carmeli 8 年之前
父節點
當前提交
6296cb1b09
共有 1 個檔案被更改,包括 3 行新增0 行删除
  1. 3
    0
      android/app/src/main/java/com/reactnativenavigation/core/RctManager.java

+ 3
- 0
android/app/src/main/java/com/reactnativenavigation/core/RctManager.java 查看文件

@@ -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);