Added possibility to mark Fresco image pipeline as already initialized for RN apps

Summary:
Changelog:
[Android][Added] - Added possibility to mark Fresco image pipeline as already initialized

Reviewed By: defHLT

Differential Revision: D41741638

fbshipit-source-id: 46f059297f3af8c1f9cb4b93ce4add895bce85df
This commit is contained in:
Alexander Oprisnik 2022-12-07 10:35:01 -08:00 коммит произвёл Facebook GitHub Bot
Родитель 6fa51e0c47
Коммит 605a52fe3e
1 изменённых файлов: 23 добавлений и 1 удалений

Просмотреть файл

@ -77,9 +77,31 @@ public class FrescoModule extends ReactContextBaseJavaModule
* @param reactContext the context to use
*/
public FrescoModule(
ReactApplicationContext reactContext, ImagePipeline imagePipeline, boolean clearOnDestroy) {
ReactApplicationContext reactContext,
@Nullable ImagePipeline imagePipeline,
boolean clearOnDestroy) {
this(reactContext, imagePipeline, clearOnDestroy, false);
}
/**
* Create a new Fresco module with a default configuration (or the previously given configuration
* via {@link #FrescoModule(ReactApplicationContext, boolean, ImagePipelineConfig)}.
*
* @param clearOnDestroy whether to clear the memory cache in onHostDestroy: this should be {@code
* true} for pure RN apps and {@code false} for apps that use Fresco outside of RN as well
* @param reactContext the context to use
* @param hasBeenInitializedExternally whether Fresco has already been initialized
*/
public FrescoModule(
ReactApplicationContext reactContext,
@Nullable ImagePipeline imagePipeline,
boolean clearOnDestroy,
boolean hasBeenInitializedExternally) {
this(reactContext, clearOnDestroy);
mImagePipeline = imagePipeline;
if (hasBeenInitializedExternally) {
sHasBeenInitialized = true;
}
}
/**