mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-10 09:29:39 +08:00
Deprecate UIManagerModule#getEventDispatcher and refactor usages
Reviewed By: shergin Differential Revision: D7832079 fbshipit-source-id: 263a2f8ff96ab6e14b91395644710b4d5f36dc50
This commit is contained in:
committed by
Facebook Github Bot
parent
a04ad8d8fb
commit
54acf3a431
@@ -7,6 +7,7 @@
|
||||
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import com.facebook.react.bridge.EventDispatcher;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import android.app.Activity;
|
||||
@@ -55,4 +56,9 @@ public class ThemedReactContext extends ReactContext {
|
||||
public @Nullable Activity getCurrentActivity() {
|
||||
return mReactApplicationContext.getCurrentActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends EventDispatcher> T getEventDispatcher() {
|
||||
return mReactApplicationContext.getEventDispatcher();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.facebook.react.bridge.LifecycleEventListener;
|
||||
import com.facebook.react.bridge.OnBatchCompleteListener;
|
||||
import com.facebook.react.bridge.PerformanceCounter;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
||||
import com.facebook.react.bridge.ReactMarker;
|
||||
import com.facebook.react.bridge.ReactMethod;
|
||||
@@ -703,6 +704,10 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
mUIImplementation.setViewHierarchyUpdateDebugListener(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is deprecated, use {@link ReactContext#getEventDispatcher()}.
|
||||
*/
|
||||
@Deprecated
|
||||
public EventDispatcher getEventDispatcher() {
|
||||
return mEventDispatcher;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user