mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Make LayoutMetricsConversions internal (#50575)
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.fabric.mounting.LayoutMetricsConversions). ## Changelog: [INTERNAL] - Make com.facebook.react.fabric.mounting.LayoutMetricsConversions internal Pull Request resolved: https://github.com/facebook/react-native/pull/50575 Test Plan: ```bash yarn test-android yarn android ``` Reviewed By: javache Differential Revision: D72696380 Pulled By: cortinico fbshipit-source-id: 629854e17094aec3c0e0e949aa786ae09ae15b06
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2da062f9d1
commit
154ad42811
@@ -2411,21 +2411,6 @@ public final class com/facebook/react/fabric/events/FabricEventEmitter : com/fac
|
||||
public fun receiveTouches (Ljava/lang/String;Lcom/facebook/react/bridge/WritableArray;Lcom/facebook/react/bridge/WritableArray;)V
|
||||
}
|
||||
|
||||
public abstract interface class com/facebook/react/fabric/mounting/LayoutMetricsConversions {
|
||||
public static final field Companion Lcom/facebook/react/fabric/mounting/LayoutMetricsConversions$Companion;
|
||||
public static fun getMaxSize (I)F
|
||||
public static fun getMinSize (I)F
|
||||
public static fun getYogaMeasureMode (FF)Lcom/facebook/yoga/YogaMeasureMode;
|
||||
public static fun getYogaSize (FF)F
|
||||
}
|
||||
|
||||
public final class com/facebook/react/fabric/mounting/LayoutMetricsConversions$Companion {
|
||||
public final fun getMaxSize (I)F
|
||||
public final fun getMinSize (I)F
|
||||
public final fun getYogaMeasureMode (FF)Lcom/facebook/yoga/YogaMeasureMode;
|
||||
public final fun getYogaSize (FF)F
|
||||
}
|
||||
|
||||
public class com/facebook/react/fabric/mounting/MountItemDispatcher {
|
||||
public fun <init> (Lcom/facebook/react/fabric/mounting/MountingManager;Lcom/facebook/react/fabric/mounting/MountItemDispatcher$ItemDispatchListener;)V
|
||||
public fun addMountItem (Lcom/facebook/react/fabric/mounting/mountitems/MountItem;)V
|
||||
|
||||
+6
-6
@@ -11,18 +11,18 @@ import android.view.View.MeasureSpec
|
||||
import com.facebook.react.uimanager.PixelUtil.dpToPx
|
||||
import com.facebook.yoga.YogaMeasureMode
|
||||
|
||||
public interface LayoutMetricsConversions {
|
||||
internal interface LayoutMetricsConversions {
|
||||
|
||||
public companion object {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
public fun getMinSize(viewMeasureSpec: Int): Float {
|
||||
fun getMinSize(viewMeasureSpec: Int): Float {
|
||||
val mode = MeasureSpec.getMode(viewMeasureSpec)
|
||||
val size = MeasureSpec.getSize(viewMeasureSpec)
|
||||
return if (mode == MeasureSpec.EXACTLY) size.toFloat() else 0f
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public fun getMaxSize(viewMeasureSpec: Int): Float {
|
||||
fun getMaxSize(viewMeasureSpec: Int): Float {
|
||||
val mode = MeasureSpec.getMode(viewMeasureSpec)
|
||||
val size = MeasureSpec.getSize(viewMeasureSpec)
|
||||
|
||||
@@ -31,7 +31,7 @@ public interface LayoutMetricsConversions {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public fun getYogaSize(minSize: Float, maxSize: Float): Float =
|
||||
fun getYogaSize(minSize: Float, maxSize: Float): Float =
|
||||
if (minSize == maxSize) {
|
||||
maxSize.dpToPx()
|
||||
} else if (maxSize.isInfinite()) {
|
||||
@@ -41,7 +41,7 @@ public interface LayoutMetricsConversions {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public fun getYogaMeasureMode(minSize: Float, maxSize: Float): YogaMeasureMode =
|
||||
fun getYogaMeasureMode(minSize: Float, maxSize: Float): YogaMeasureMode =
|
||||
if (minSize == maxSize) {
|
||||
YogaMeasureMode.EXACTLY
|
||||
} else if (maxSize.isInfinite()) {
|
||||
|
||||
Reference in New Issue
Block a user