Java 类com.facebook.common.soloader.SoLoaderShim 实例源码

项目:GitHub    文件:StaticWebpNativeLoader.java   
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;
  }
}
项目:RNLearn_Project1    文件:FrescoModule.java   
@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;
}
项目:RNLearn_Project1    文件:FrescoModule.java   
@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;
}
项目:Ironman    文件:FrescoModule.java   
@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;
}
项目:GitHub    文件:TestUsingNativeMemoryChunk.java   
@BeforeClass
public static void allowNativeStaticInitializers() {
  SoLoaderShim.setHandler(
      new SoLoaderShim.Handler() {
        @Override
        public void loadLibrary(String libraryName) {
          // ignore it
        }
      });
}
项目:ReactNativeSignatureExample    文件:FrescoModule.java   
@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;
}
项目:react-native-ibeacon-android    文件:FrescoModule.java   
@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;
}
项目:react-native-box-loaders    文件:FrescoModule.java   
@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;
}
项目:GitHub    文件:ImagePipelineNativeLoader.java   
public static void load() {
  SoLoaderShim.loadLibrary("imagepipeline");
}
项目:GitHub    文件:GifImage.java   
private static synchronized void ensure() {
  if (!sInitialized) {
    sInitialized = true;
    SoLoaderShim.loadLibrary("gifimage");
  }
}