Skip to content

Commit

Permalink
Added possibility to mark Fresco image pipeline as already initialize…
Browse files Browse the repository at this point in the history
…d 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
  • Loading branch information
oprisnik authored and facebook-github-bot committed Dec 7, 2022
1 parent 6fa51e0 commit 605a52f
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,31 @@ public FrescoModule(ReactApplicationContext reactContext, boolean clearOnDestroy
* @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;
}
}

/**
Expand Down

0 comments on commit 605a52f

Please sign in to comment.