Fix FrescoModule not initialized in Nodes

Reviewed By: AaaChiuuu

Differential Revision: D4687127

fbshipit-source-id: d387ff665374bd4ef40fc2e9c19543f2bacf4a66
This commit is contained in:
Andrew Y. Chen 2017-03-16 16:26:02 -07:00 committed by Facebook Github Bot
parent 55f48eb9f6
commit 63fa621df1
2 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,7 @@ android_library(
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_target("java/com/facebook/react/bridge:bridge"),
react_native_target("java/com/facebook/react/common:common"),
react_native_target("java/com/facebook/react/modules/fresco:fresco"),
react_native_target("java/com/facebook/react/modules/i18nmanager:i18nmanager"),
react_native_target("java/com/facebook/react/touch:touch"),
react_native_target("java/com/facebook/react/uimanager:uimanager"),

View File

@ -18,6 +18,7 @@ import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.modules.fresco.FrescoModule;
import com.facebook.react.modules.i18nmanager.I18nUtil;
import com.facebook.react.uimanager.ReactShadowNode;
import com.facebook.react.uimanager.ReactStylesDiffMap;
@ -98,6 +99,7 @@ public class FlatUIImplementation extends UIImplementation {
// initialization is undefined, and this is pretty much the earliest when we are guarantied
// that Fresco is initalized and DraweeControllerBuilder can be queried. This also happens
// relatively rarely to have any performance considerations.
mReactContext.getNativeModule(FrescoModule.class); // initialize Fresco
DraweeRequestHelper.setDraweeControllerBuilder(
mRCTImageViewManager.getDraweeControllerBuilder());
mRCTImageViewManager = null;