Skip to content

Commit 6281084

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Fix HasBetterKotlinAlternativeMethod: Use Kotlin joinToString in TextAttributeProps (facebook#55505)
Summary: 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
1 parent 2875784 commit 6281084

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ package com.facebook.react.views.text
99

1010
import android.os.Build
1111
import android.text.Layout
12-
import android.text.TextUtils
1312
import android.text.TextUtils.TruncateAt
1413
import android.util.LayoutDirection
1514
import android.view.Gravity
@@ -238,7 +237,7 @@ public class TextAttributeProps private constructor() {
238237
}
239238
}
240239
}
241-
fontFeatureSettings = TextUtils.join(", ", features)
240+
fontFeatureSettings = features.joinToString(", ")
242241
}
243242

244243
private fun setFontWeight(fontWeightString: String?) {

0 commit comments

Comments
 (0)