public static synchronized void ensure() { if (!sInitialized) { // On Android 4.1.2 the loading of the static-webp native library can fail because // of the dependency with fb_jpegturbo. In this case we have to explicitely load that // library if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN) { try { SoLoaderShim.loadLibrary("fb_jpegturbo"); } catch (UnsatisfiedLinkError error) { // Head in the sand } } SoLoaderShim.loadLibrary("static-webp"); sInitialized = true; } }
@Override public void initialize() { super.initialize(); getReactApplicationContext().addLifecycleEventListener(this); if (!hasBeenInitialized()) { // Make sure the SoLoaderShim is configured to use our loader for native libraries. // This code can be removed if using Fresco from Maven rather than from source SoLoaderShim.setHandler(new FrescoHandler()); if (mConfig == null) { mConfig = getDefaultConfig(getReactApplicationContext()); } Context context = getReactApplicationContext().getApplicationContext(); Fresco.initialize(context, mConfig); sHasBeenInitialized = true; } else if (mConfig != null) { FLog.w( ReactConstants.TAG, "Fresco has already been initialized with a different config. " + "The new Fresco configuration will be ignored!"); } mConfig = null; }
@Override public void initialize() { super.initialize(); if (!hasBeenInitialized()) { // Make sure the SoLoaderShim is configured to use our loader for native libraries. // This code can be removed if using Fresco from Maven rather than from source SoLoaderShim.setHandler(new FrescoHandler()); if (mConfig == null) { mConfig = getDefaultConfig(getReactApplicationContext()); } Context context = getReactApplicationContext().getApplicationContext(); Fresco.initialize(context, mConfig); sHasBeenInitialized = true; } else if (mConfig != null) { FLog.w( ReactConstants.TAG, "Fresco has already been initialized with a different config. " + "The new Fresco configuration will be ignored!"); } mConfig = null; }
@BeforeClass public static void allowNativeStaticInitializers() { SoLoaderShim.setHandler( new SoLoaderShim.Handler() { @Override public void loadLibrary(String libraryName) { // ignore it } }); }
@Override public void initialize() { super.initialize(); // Make sure the SoLoaderShim is configured to use our loader for native libraries. // This code can be removed if using Fresco from Maven rather than from source SoLoaderShim.setHandler(new FrescoHandler()); Context context = getReactApplicationContext().getApplicationContext(); Fresco.initialize(context, mConfig); mConfig = null; }
public static void load() { SoLoaderShim.loadLibrary("imagepipeline"); }
private static synchronized void ensure() { if (!sInitialized) { sInitialized = true; SoLoaderShim.loadLibrary("gifimage"); } }