Skip to content

Commit 6342bc3

Browse files
committed
Remove internal keywords so react-native-text-size and react-native-aztec can import Android code
1 parent 069dcd3 commit 6342bc3

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CustomLineHeightSpan.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ import kotlin.math.floor
1616
* Implements a [LineHeightSpan] which follows web-like behavior for line height, unlike
1717
* LineHeightSpan.Standard which only effects space between the baselines of adjacent line boxes
1818
* (does not impact space before the first line or after the last).
19+
*
20+
* We changed `internal` to `public` because this is still used by
21+
* react-native-text-size
1922
*/
20-
internal class CustomLineHeightSpan(height: Float) : LineHeightSpan, ReactSpan {
21-
val lineHeight: Int = ceil(height.toDouble()).toInt()
23+
public class CustomLineHeightSpan(height: Float) : LineHeightSpan, ReactSpan {
24+
public val lineHeight: Int = ceil(height.toDouble()).toInt()
2225

2326
override fun chooseHeight(
2427
text: CharSequence,

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ import com.facebook.yoga.YogaMeasureMode
3535
import com.facebook.yoga.YogaMeasureOutput
3636
import com.facebook.yoga.YogaNode
3737

38+
// We removed the `internal` from `internal class` because this is still used
39+
// by react-native-aztec
3840
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
3941
@LegacyArchitectureShadowNodeWithCxxImpl
40-
internal class ReactTextInputShadowNode
42+
public open class ReactTextInputShadowNode
4143
@JvmOverloads
4244
constructor(reactTextViewManagerCallback: ReactTextViewManagerCallback? = null) :
4345
ReactBaseTextShadowNode(reactTextViewManagerCallback), YogaMeasureFunction {
@@ -47,14 +49,14 @@ constructor(reactTextViewManagerCallback: ReactTextViewManagerCallback? = null)
4749

4850
// Represents the `text` property only, not possible nested content.
4951
@set:ReactProp(name = PROP_TEXT)
50-
var text: String? = null
52+
public var text: String? = null
5153
set(value) {
5254
field = value
5355
markUpdated()
5456
}
5557

5658
@set:ReactProp(name = PROP_PLACEHOLDER)
57-
var placeholder: String? = null
59+
public var placeholder: String? = null
5860
set(value) {
5961
field = value
6062
markUpdated()
@@ -204,10 +206,10 @@ constructor(reactTextViewManagerCallback: ReactTextViewManagerCallback? = null)
204206
return EditText(context)
205207
}
206208

207-
companion object {
208-
const val PROP_TEXT: String = "text"
209+
public companion object {
210+
public const val PROP_TEXT: String = "text"
209211

210-
const val PROP_PLACEHOLDER: String = "placeholder"
212+
public const val PROP_PLACEHOLDER: String = "placeholder"
211213

212214
init {
213215
LegacyArchitectureLogger.assertLegacyArchitecture(

0 commit comments

Comments
 (0)