Skip to content

Commit 786c6e8

Browse files
mateoguzmanafacebook-github-bot
authored andcommitted
Make FontMetricsUtil internal (facebook#50506)
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.text.FontMetricsUtil). ## Changelog: [INTERNAL] - Make com.facebook.react.views.text.FontMetricsUtil internal Pull Request resolved: facebook#50506 Test Plan: ```bash yarn test-android yarn android ``` Reviewed By: javache Differential Revision: D72549765 Pulled By: cortinico fbshipit-source-id: b7e29dfb716ce7c93620b14adec1425345b13ac1
1 parent ad33089 commit 786c6e8

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

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

-5
Original file line numberDiff line numberDiff line change
@@ -6513,11 +6513,6 @@ public final class com/facebook/react/views/text/DefaultStyleValuesUtil {
65136513
public static final fun getDefaultTextColorHint (Landroid/content/Context;)Landroid/content/res/ColorStateList;
65146514
}
65156515

6516-
public final class com/facebook/react/views/text/FontMetricsUtil {
6517-
public static final field INSTANCE Lcom/facebook/react/views/text/FontMetricsUtil;
6518-
public static final fun getFontMetrics (Ljava/lang/CharSequence;Landroid/text/Layout;Landroid/text/TextPaint;Landroid/content/Context;)Lcom/facebook/react/bridge/WritableArray;
6519-
}
6520-
65216516
public abstract class com/facebook/react/views/text/ReactBaseTextShadowNode : com/facebook/react/uimanager/LayoutShadowNode {
65226517
public static final field DEFAULT_TEXT_SHADOW_COLOR I
65236518
public static final field PROP_SHADOW_COLOR Ljava/lang/String;

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ import android.text.TextPaint
1414
import com.facebook.react.bridge.Arguments
1515
import com.facebook.react.bridge.WritableArray
1616

17-
public object FontMetricsUtil {
17+
internal object FontMetricsUtil {
1818

1919
private const val CAP_HEIGHT_MEASUREMENT_TEXT = "T"
2020
private const val X_HEIGHT_MEASUREMENT_TEXT = "x"
2121
private const val AMPLIFICATION_FACTOR = 100f
2222

2323
@JvmStatic
24-
public fun getFontMetrics(
24+
fun getFontMetrics(
2525
text: CharSequence,
2626
layout: Layout,
2727
paint: TextPaint,

0 commit comments

Comments
 (0)