mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-02 23:05:01 +08:00
Backed out changeset 322626be193e
Reviewed By: wutalman Differential Revision: D6258856 fbshipit-source-id: 392dc91f87148c70817f13858a7fcd368f028b2d
This commit is contained in:
committed by
Facebook Github Bot
parent
164591218f
commit
a6465d1c17
@@ -17,6 +17,7 @@ import android.content.res.Configuration;
|
||||
import com.facebook.common.logging.FLog;
|
||||
import com.facebook.debug.holder.PrinterHolder;
|
||||
import com.facebook.debug.tags.ReactDebugOverlayTags;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.react.animation.Animation;
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
import com.facebook.react.bridge.Callback;
|
||||
@@ -116,6 +117,11 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
|
||||
private int mBatchId = 0;
|
||||
|
||||
// Defines if events were already exported to JS. We do not send them more
|
||||
// than once as they are stored and mixed in with Fiber for every ViewManager
|
||||
// on JS side.
|
||||
private boolean mEventsWereSentToJS = false;
|
||||
|
||||
public UIManagerModule(
|
||||
ReactApplicationContext reactContext,
|
||||
ViewManagerResolver viewManagerResolver,
|
||||
@@ -229,6 +235,7 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
}
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public @Nullable WritableMap getConstantsForViewManager(final String viewManagerName) {
|
||||
ViewManager targetView =
|
||||
@@ -245,8 +252,13 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
try {
|
||||
Map<String, Object> viewManagerConstants =
|
||||
UIManagerModuleConstantsHelper.createConstantsForViewManager(
|
||||
targetView, null, mCustomDirectEvents);
|
||||
targetView,
|
||||
mEventsWereSentToJS ? null : UIManagerModuleConstants.getBubblingEventTypeConstants(),
|
||||
mEventsWereSentToJS ? null : UIManagerModuleConstants.getDirectEventTypeConstants(),
|
||||
null,
|
||||
mCustomDirectEvents);
|
||||
if (viewManagerConstants != null) {
|
||||
mEventsWereSentToJS = true;
|
||||
return Arguments.makeNativeMap(viewManagerConstants);
|
||||
}
|
||||
return null;
|
||||
@@ -255,12 +267,9 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public WritableMap getDefaultEventTypes() {
|
||||
return Arguments.makeNativeMap(UIManagerModuleConstantsHelper.getDefaultExportableEventTypes());
|
||||
}
|
||||
|
||||
/** Resolves Direct Event name exposed to JS from the one known to the Native side. */
|
||||
/**
|
||||
* Resolves Direct Event name exposed to JS from the one known to the Native side.
|
||||
*/
|
||||
public CustomEventNamesResolver getDirectEventNamesResolver() {
|
||||
return new CustomEventNamesResolver() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user