Expose getEventDispatcher() method into UIManager interface

Summary:
This diff promotes the UIManagerModule.getEventDispatcher() to the interface UIManager and it implements this method in FabricUIManager class.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18862862

fbshipit-source-id: 424f0e601ed1807dbd5d33048daf7dc3bb200dcd
This commit is contained in:
David Vacca
2019-12-10 20:33:55 -08:00
committed by Facebook Github Bot
parent c0eddad17b
commit bc11e9c7f1
2 changed files with 10 additions and 0 deletions
@@ -56,6 +56,9 @@ public interface UIManager extends JSIModule, PerformanceCounter {
*/
void dispatchCommand(int reactTag, String commandId, @Nullable ReadableArray commandArgs);
/** @return the {@link EventDispatcher} object that is used by this class. */
<T> T getEventDispatcher();
/**
* Used by native animated module to bypass the process of updating the values through the shadow
* view hierarchy. This method will directly update native views, which means that updates for
@@ -693,6 +693,13 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
.postFrameCallback(ReactChoreographer.CallbackType.DISPATCH_UI, mDispatchUIFrameCallback);
}
@Override
@NonNull
@SuppressWarnings("unchecked")
public EventDispatcher getEventDispatcher() {
return mEventDispatcher;
}
@Override
public void onHostPause() {
ReactChoreographer.getInstance()