Skip to content

Commit 66a4a4d

Browse files
mateoguzmanafacebook-github-bot
authored andcommitted
Make MultiSourceHelper internal (facebook#50793)
Summary: This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.views.imagehelper.MultiSourceHelper). ## Changelog: [INTERNAL] - Make com.facebook.react.views.imagehelper.MultiSourceHelper internal Pull Request resolved: facebook#50793 Test Plan: ```bash yarn test-android yarn android ``` Reviewed By: Abbondanzo Differential Revision: D73250760 Pulled By: cortinico fbshipit-source-id: 8c1103745d405a9ab36c1372f3ca6750ae8ce8e2
1 parent 5d1febf commit 66a4a4d

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5724,18 +5724,6 @@ public final class com/facebook/react/views/imagehelper/ImageSource$Companion {
57245724
public final fun getTransparentBitmapImageSource (Landroid/content/Context;)Lcom/facebook/react/views/imagehelper/ImageSource;
57255725
}
57265726

5727-
public final class com/facebook/react/views/imagehelper/MultiSourceHelper {
5728-
public static final field INSTANCE Lcom/facebook/react/views/imagehelper/MultiSourceHelper;
5729-
public static final fun getBestSourceForSize (IILjava/util/List;)Lcom/facebook/react/views/imagehelper/MultiSourceHelper$MultiSourceResult;
5730-
public static final fun getBestSourceForSize (IILjava/util/List;D)Lcom/facebook/react/views/imagehelper/MultiSourceHelper$MultiSourceResult;
5731-
}
5732-
5733-
public final class com/facebook/react/views/imagehelper/MultiSourceHelper$MultiSourceResult {
5734-
public final field bestResult Lcom/facebook/react/views/imagehelper/ImageSource;
5735-
public final field bestResultInCache Lcom/facebook/react/views/imagehelper/ImageSource;
5736-
public fun <init> (Lcom/facebook/react/views/imagehelper/ImageSource;Lcom/facebook/react/views/imagehelper/ImageSource;)V
5737-
}
5738-
57395727
public final class com/facebook/react/views/imagehelper/ResourceDrawableIdHelper {
57405728
public static final field Companion Lcom/facebook/react/views/imagehelper/ResourceDrawableIdHelper$Companion;
57415729
public final fun clear ()V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/MultiSourceHelper.kt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ import com.facebook.imagepipeline.core.ImagePipelineFactory
1111
import com.facebook.react.modules.fresco.ImageCacheControl
1212

1313
/** Helper class for dealing with multisource images. */
14-
public object MultiSourceHelper {
14+
internal object MultiSourceHelper {
1515
@JvmStatic
16-
public fun getBestSourceForSize(
17-
width: Int,
18-
height: Int,
19-
sources: List<ImageSource>
20-
): MultiSourceResult = getBestSourceForSize(width, height, sources, 1.0)
16+
fun getBestSourceForSize(width: Int, height: Int, sources: List<ImageSource>): MultiSourceResult =
17+
getBestSourceForSize(width, height, sources, 1.0)
2118

2219
/**
2320
* Chooses the image source with the size closest to the target image size.
@@ -29,7 +26,7 @@ public object MultiSourceHelper {
2926
* best source; this is useful if the image will be displayed bigger than the view (e.g. zoomed)
3027
*/
3128
@JvmStatic
32-
public fun getBestSourceForSize(
29+
fun getBestSourceForSize(
3330
width: Int,
3431
height: Int,
3532
sources: List<ImageSource>,
@@ -78,16 +75,16 @@ public object MultiSourceHelper {
7875
return MultiSourceResult(best, bestCached)
7976
}
8077

81-
public class MultiSourceResult(
78+
class MultiSourceResult(
8279
/**
8380
* Get the best result overall (closest in size to the view's size). Can be null if there were
8481
* no sources to choose from, or if there were more than 1 sources but width/height were 0.
8582
*/
86-
@JvmField public val bestResult: ImageSource?,
83+
@JvmField val bestResult: ImageSource?,
8784
/**
8885
* Get the best result (closest in size to the view's size) that is also in cache. If this
8986
* would be the same as the source from [.getBestResult], this will return `null` instead.
9087
*/
91-
@JvmField public val bestResultInCache: ImageSource?
88+
@JvmField val bestResultInCache: ImageSource?
9289
)
9390
}

0 commit comments

Comments
 (0)