diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 33f35efe9be..ef61e22a660 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -2989,25 +2989,6 @@ public final class com/facebook/react/modules/i18nmanager/I18nUtil$Companion { public final fun getInstance ()Lcom/facebook/react/modules/i18nmanager/I18nUtil; } -public final class com/facebook/react/modules/image/ImageLoaderModule : com/facebook/fbreact/specs/NativeImageLoaderAndroidSpec, com/facebook/react/bridge/LifecycleEventListener { - public static final field Companion Lcom/facebook/react/modules/image/ImageLoaderModule$Companion; - public static final field NAME Ljava/lang/String; - public fun (Lcom/facebook/react/bridge/ReactApplicationContext;)V - public fun (Lcom/facebook/react/bridge/ReactApplicationContext;Lcom/facebook/imagepipeline/core/ImagePipeline;Lcom/facebook/react/views/image/ReactCallerContextFactory;)V - public fun (Lcom/facebook/react/bridge/ReactApplicationContext;Ljava/lang/Object;)V - public fun abortRequest (D)V - public fun getSize (Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V - public fun getSizeWithHeaders (Ljava/lang/String;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V - public fun onHostDestroy ()V - public fun onHostPause ()V - public fun onHostResume ()V - public fun prefetchImage (Ljava/lang/String;DLcom/facebook/react/bridge/Promise;)V - public fun queryCache (Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/Promise;)V -} - -public final class com/facebook/react/modules/image/ImageLoaderModule$Companion { -} - public class com/facebook/react/modules/intent/IntentModule : com/facebook/fbreact/specs/NativeIntentAndroidSpec { public static final field Companion Lcom/facebook/react/modules/intent/IntentModule$Companion; public static final field NAME Ljava/lang/String; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt index ff5577bf94f..b441fb39156 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt @@ -35,7 +35,7 @@ import com.facebook.react.views.image.ReactCallerContextFactory import com.facebook.react.views.imagehelper.ImageSource @ReactModule(name = NativeImageLoaderAndroidSpec.NAME) -public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventListener { +internal class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventListener { private var _imagePipeline: ImagePipeline? = null private val enqueuedRequestMonitor = Any() @@ -51,18 +51,15 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis _imagePipeline = value } - public constructor(reactContext: ReactApplicationContext) : super(reactContext) { + constructor(reactContext: ReactApplicationContext) : super(reactContext) { this.callerContext = this } - public constructor( - reactContext: ReactApplicationContext, - callerContext: Any? - ) : super(reactContext) { + constructor(reactContext: ReactApplicationContext, callerContext: Any?) : super(reactContext) { this.callerContext = callerContext } - public constructor( + constructor( reactContext: ReactApplicationContext, imagePipeline: ImagePipeline, callerContextFactory: ReactCallerContextFactory @@ -80,7 +77,7 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis * when there is an error */ @ReactMethod - public override fun getSize(uriString: String?, promise: Promise) { + override fun getSize(uriString: String?, promise: Promise) { if (uriString.isNullOrEmpty()) { promise.reject(ERROR_INVALID_URI, "Cannot get the size of an image for an empty URI") return @@ -129,11 +126,7 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis * when there is an error */ @ReactMethod - public override fun getSizeWithHeaders( - uriString: String?, - headers: ReadableMap?, - promise: Promise - ) { + override fun getSizeWithHeaders(uriString: String?, headers: ReadableMap?, promise: Promise) { if (uriString.isNullOrEmpty()) { promise.reject(ERROR_INVALID_URI, "Cannot get the size of an image for an empty URI") return @@ -184,11 +177,7 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis * @param promise the promise that is fulfilled when the image is successfully prefetched or * rejected when there is an error */ - public override fun prefetchImage( - uriString: String?, - requestIdAsDouble: Double, - promise: Promise - ) { + override fun prefetchImage(uriString: String?, requestIdAsDouble: Double, promise: Promise) { val requestId = requestIdAsDouble.toInt() if (uriString.isNullOrEmpty()) { promise.reject(ERROR_INVALID_URI, "Cannot prefetch an image for an empty URI") @@ -227,13 +216,13 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis prefetchSource.subscribe(prefetchSubscriber, CallerThreadExecutor.getInstance()) } - public override fun abortRequest(requestId: Double) { + override fun abortRequest(requestId: Double) { val request = removeRequest(requestId.toInt()) request?.close() } @ReactMethod - public override fun queryCache(uris: ReadableArray, promise: Promise) { + override fun queryCache(uris: ReadableArray, promise: Promise) { // perform cache interrogation in async task as disk cache checks are expensive @Suppress("DEPRECATION", "StaticFieldLeak") object : GuardedAsyncTask(getReactApplicationContext()) { @@ -287,11 +276,11 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis } } - public companion object { + companion object { private const val ERROR_INVALID_URI = "E_INVALID_URI" private const val ERROR_PREFETCH_FAILURE = "E_PREFETCH_FAILURE" private const val ERROR_GET_SIZE_FAILURE = "E_GET_SIZE_FAILURE" - public const val NAME: String = "ImageLoader" + const val NAME: String = "ImageLoader" } }