From cccc180f9da7cc0c51fce296f9159aa3d47bc701 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 12 Feb 2026 23:24:00 -0800 Subject: [PATCH] Fix HasBetterKotlinAlternativeMethod: Use Kotlin joinToString in TextAttributeProps (#55505) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55505 Replace `TextUtils.join(", ", features)` with Kotlin's idiomatic `features.joinToString(", ")` to fix the HasBetterKotlinAlternativeMethod lint warning. Also removed the now-unused `TextUtils` import while keeping the `TextUtils.TruncateAt` import that is still in use. changelog: [internal] internal Reviewed By: alanleedev Differential Revision: D92021465 fbshipit-source-id: 3cb9e286f9f46f82817b0257dde73230ba2298d6 --- .../java/com/facebook/react/views/text/TextAttributeProps.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt index 433afa5793a..45c8bec4c2b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt @@ -9,7 +9,6 @@ package com.facebook.react.views.text import android.os.Build import android.text.Layout -import android.text.TextUtils import android.text.TextUtils.TruncateAt import android.util.LayoutDirection import android.view.Gravity @@ -238,7 +237,7 @@ public class TextAttributeProps private constructor() { } } } - fontFeatureSettings = TextUtils.join(", ", features) + fontFeatureSettings = features.joinToString(", ") } private fun setFontWeight(fontWeightString: String?) {