diff --git a/example/__tests__/nitro-input-sizing.harness.tsx b/example/__tests__/nitro-input-sizing.harness.tsx
index a2ad4aa..ddca70f 100644
--- a/example/__tests__/nitro-input-sizing.harness.tsx
+++ b/example/__tests__/nitro-input-sizing.harness.tsx
@@ -18,7 +18,7 @@
import React, { createRef, useLayoutEffect, useRef, useState } from 'react'
import { View } from 'react-native'
import { describe, expect, it } from 'react-native-harness'
-import { NitroInput, NumberFormat, type NitroInputHandle, type NitroInputProps } from 'react-native-nitro-input'
+import { NitroInput, NitroNumber, NitroText, NumberFormat, type NitroInputHandle, type NitroInputProps } from 'react-native-nitro-input'
import { render, sleep, waitFor } from './test-utils'
const usd = new NumberFormat('en-US', { style: 'currency', currency: 'USD' })
@@ -136,3 +136,83 @@ describe('NitroInput first layout', () => {
await waitFor(() => expect(rectOf(state.view!).width).toBeGreaterThan(before + 20))
})
})
+
+describe('a TextInput style', () => {
+ // Fabric hands a view its style's keys as props: when a native prop shared a
+ // name with a text style key, `style={{ fontWeight: '700' }}` threw. The
+ // native props are named so that none can (PropNameCollisions.test); this is
+ // the same check on a device, for every component, every text style key.
+ const textStyle = {
+ fontSize: 22,
+ fontWeight: '700' as const,
+ fontFamily: 'OpenRunde-Semibold',
+ fontStyle: 'italic' as const,
+ color: 'tomato',
+ letterSpacing: 1,
+ lineHeight: 30,
+ textAlign: 'center' as const,
+ textAlignVertical: 'center' as const,
+ textDecorationLine: 'underline' as const,
+ textTransform: 'uppercase' as const,
+ fontVariant: ['tabular-nums' as const],
+ }
+
+ it('is taken by NitroInput, as TextInput takes it', async () => {
+ const { state, Box } = boxed()
+ await render(
+
+
+
+ )
+ await expectFinalAtMount(state)
+ // Measured at the style's 22 pt, not the default 32.
+ expect(state.mounted!.height).toBeLessThan(40)
+ })
+
+ it('does not reach NitroNumber or NitroText as props', async () => {
+ const { state, Box } = boxed()
+ await render(
+
+ {/* Their style is a view style; a text style is what an app might still pass. */}
+
+ styled
+
+ )
+ await waitFor(() => expect(state.mounted).not.toBeNull())
+ await sleep(SETTLE_MS)
+ expect(rectOf(state.view!).width).toBeGreaterThan(0)
+ })
+})
+
+describe('a size TextInput would give', () => {
+ it('is lineHeight tall on one line', async () => {
+ const { state, Box } = boxed()
+ await render(
+
+
+
+ )
+ await expectFinalAtMount(state)
+ expect(state.mounted!.height).toBeCloseTo(40, 0)
+ })
+
+ it('grows by its padding and border instead of squeezing the text', async () => {
+ const plain = boxed()
+ const padded = boxed()
+ await render(
+
+
+
+
+
+
+
+
+ )
+ await expectFinalAtMount(padded.state)
+ const a = rectOf(plain.state.view!)
+ const b = rectOf(padded.state.view!)
+ expect(b.width - a.width).toBeCloseTo(18, 0)
+ expect(b.height - a.height).toBeCloseTo(8, 0)
+ })
+})
diff --git a/packages/react-native-nitro-input/CHANGELOG.md b/packages/react-native-nitro-input/CHANGELOG.md
index d12f55d..5bc62eb 100644
--- a/packages/react-native-nitro-input/CHANGELOG.md
+++ b/packages/react-native-nitro-input/CHANGELOG.md
@@ -61,6 +61,33 @@
text area as the field's own text and hint are: in a padded field narrower
than its placeholder (or once the typed text filled it), the tail ran over
the padding to the field's edge. iOS already clipped it.
+- **A `TextInput` style no longer crashes a field, and `NitroInput` reads
+ its typography from it.** Fabric hands a view its style's keys as props,
+ and six to eight of each view's native props shared a name with a text
+ style key: `style={{ fontWeight: '700' }}` threw ("Value is a string,
+ expected a number") on `NitroInput`, `NitroNumber` and `NitroText`, and a
+ numeric `fontSize` or `color` there was fought over by the style and the
+ prop. The native props are renamed (`textSize`, `textWeight`,
+ `textFamily`, `textColor`, `textLetterSpacing`, `textLineHeight`,
+ `textAlignment`, `textVerticalAlignment`); the components' own props keep
+ their names. A test now fails if any native prop shares a name with a React
+ Native style key or view prop. `NitroInput` also takes `fontSize`,
+ `fontWeight`, `fontFamily`, `color`, `letterSpacing`, `lineHeight`,
+ `textAlign` and `textAlignVertical` from `style`, as `TextInput` does (its
+ `style` is typed as `TextInput`'s); the props of the same name win.
+- **`NitroInput` matches `TextInput` in three more places**, found by a
+ visual comparison of the two side by side:
+ - Android: `textAlign` `center` / `right` on a plain field did nothing; the
+ alignment set when the field became plain (before `textAlign` arrived in
+ the same commit) overrode it.
+ - A `style` padding or border insets the text and adds to the size the
+ field works out for itself, as `TextInput`'s does. An `autoWidth` field
+ with `paddingHorizontal: 8` squeezed its text to "…" on iOS; on Android
+ the padding did not inset the text at all (React Native never hands a
+ Nitro view its padding there, so the view now insets its text, overlay and
+ frame itself).
+ - iOS: `lineHeight` sets a single line's height, as on Android; it was the
+ font's own line box whatever the prop said.
## 0.3.8
diff --git a/packages/react-native-nitro-input/README.md b/packages/react-native-nitro-input/README.md
index 5b2378c..750a249 100644
--- a/packages/react-native-nitro-input/README.md
+++ b/packages/react-native-nitro-input/README.md
@@ -587,7 +587,7 @@ screen behaves like theirs with these settings:
| `onKeyPress` | `(event) => void` | – | Before the text changes: the character, `'Backspace'` or `'Enter'`. |
| `onNativeRef` | `(ref) => void` | – | Receives the Nitro object on mount. |
| `id` / `aria-label` | `string` | – | React Native's HTML-style aliases for `nativeID` / `accessibilityLabel`, resolved here because a Nitro view is handed the raw props; each wins over the older spelling. |
-| `style`, `testID`, … | `ViewProps` | – | Regular view props. `testID` and the accessibility label are forwarded to the system field, the element VoiceOver, TalkBack and e2e tools interact with. The field takes its width from its parent like a `TextInput`; see `autoWidth`. |
+| `style`, `testID`, … | `ViewProps`; `style` as `TextInput`'s | – | Regular view props. `testID` and the accessibility label are forwarded to the system field, the element VoiceOver, TalkBack and e2e tools interact with. The field takes its width from its parent like a `TextInput`; see `autoWidth`. As on a `TextInput`, `style` can carry the typography (`fontSize`, `fontWeight`, `fontFamily`, `color`, `letterSpacing`, `lineHeight`, `textAlign`, `textAlignVertical`; the props of the same name win), and its padding and border inset the text and add to a size the field works out for itself. Two deliberate differences: digits are always tabular (Android's Roboto has them anyway, and a field keeps its width whether it reflows or not), and Android gets no default padding (iOS's `TextInput` has none; React Native's Android one keeps the platform field's). |
`keyboardType`: `'default' | 'number-pad' | 'decimal-pad' | 'numeric' | 'email-address' | 'phone-pad' | 'url' | 'ascii-capable' | 'numbers-and-punctuation'`.
diff --git a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt
index a015ae0..87a0b2d 100644
--- a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt
+++ b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt
@@ -127,7 +127,7 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr
set(v) { field = v; markConfigDirty() }
override var suffixAlign: NitroInputAffixAlign = NitroInputAffixAlign.BASELINE
set(v) { field = v; markConfigDirty() }
- override var letterSpacing: Double = 0.0
+ override var textLetterSpacing: Double = 0.0
set(v) { field = v; markConfigDirty() }
override var prefixSpacing: Double = Double.POSITIVE_INFINITY
set(v) { field = v; markConfigDirty() }
@@ -171,17 +171,17 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr
set(v) { field = v; markConfigDirty() }
override var effect: NitroInputEffect = NitroInputEffect.AUTO
set(v) { field = v; markConfigDirty() }
- override var fontSize: Double = 32.0
+ override var textSize: Double = 32.0
set(v) { field = v; markConfigDirty() }
- override var lineHeight: Double = 0.0
+ override var textLineHeight: Double = 0.0
set(v) { field = v; markConfigDirty() }
- override var fontWeight: Double = 400.0
+ override var textWeight: Double = 400.0
set(v) { field = v; markConfigDirty() }
- override var fontFamily: String = ""
+ override var textFamily: String = ""
set(v) { field = v; markConfigDirty() }
- override var color: Double = Double.NaN
+ override var textColor: Double = Double.NaN
set(v) { field = v; markConfigDirty() }
- override var textAlign: NitroInputTextAlign = NitroInputTextAlign.AUTO
+ override var textAlignment: NitroInputTextAlign = NitroInputTextAlign.AUTO
set(v) { field = v; markConfigDirty() }
override var rightToLeft: Boolean = false
set(v) { field = v; markConfigDirty() }
@@ -213,7 +213,15 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr
set(v) { field = v; markConfigDirty() }
override var numberOfLines: Double = 0.0
set(v) { field = v; markConfigDirty() }
- override var textAlignVertical: NitroInputTextAlignVertical = NitroInputTextAlignVertical.AUTO
+ override var textVerticalAlignment: NitroInputTextAlignVertical = NitroInputTextAlignVertical.AUTO
+ set(v) { field = v; markConfigDirty() }
+ override var textInsetLeft: Double = 0.0
+ set(v) { field = v; markConfigDirty() }
+ override var textInsetTop: Double = 0.0
+ set(v) { field = v; markConfigDirty() }
+ override var textInsetRight: Double = 0.0
+ set(v) { field = v; markConfigDirty() }
+ override var textInsetBottom: Double = 0.0
set(v) { field = v; markConfigDirty() }
override var scrollEnabled: Boolean = true
set(v) { field = v; markConfigDirty() }
@@ -414,7 +422,7 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr
prefixFontSize = Double.NaN
suffixFontSize = Double.NaN
signPlacement = NitroInputSignPlacement.BEFOREAFFIX
- letterSpacing = 0.0
+ textLetterSpacing = 0.0
prefixSpacing = Double.POSITIVE_INFINITY
suffixSpacing = Double.POSITIVE_INFINITY
prefixOffset = 0.0
@@ -438,12 +446,12 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr
easing = NitroInputEasing.EXPO
bounce = 0.15
effect = NitroInputEffect.AUTO
- fontSize = 32.0
- lineHeight = 0.0
- fontWeight = 400.0
- fontFamily = ""
- color = Double.NaN
- textAlign = NitroInputTextAlign.AUTO
+ textSize = 32.0
+ textLineHeight = 0.0
+ textWeight = 400.0
+ textFamily = ""
+ textColor = Double.NaN
+ textAlignment = NitroInputTextAlign.AUTO
rightToLeft = false
caretColor = Double.NaN
selectionColor = Double.NaN
@@ -459,7 +467,11 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr
editable = true
multiline = false
numberOfLines = 0.0
- textAlignVertical = NitroInputTextAlignVertical.AUTO
+ textVerticalAlignment = NitroInputTextAlignVertical.AUTO
+ textInsetLeft = 0.0
+ textInsetTop = 0.0
+ textInsetRight = 0.0
+ textInsetBottom = 0.0
scrollEnabled = true
autoFocus = false
plain = false
@@ -631,7 +643,7 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr
// which sizes the field before this view exists.
inputView.format = formatOf(this)
inputView.typography = sizingTypographyOf(this, inputView.resources.displayMetrics.density).copy(
- color = colorFromARGB(color),
+ color = colorFromARGB(textColor),
placeholderColor = colorFromARGB(placeholderColor),
prefixAlign = mapAffixAlign(prefixAlign),
suffixAlign = mapAffixAlign(suffixAlign),
@@ -699,7 +711,7 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr
plain = plain,
multiline = multiline,
numberOfLines = clampInt(numberOfLines, 0, 1000, 0),
- textAlignVertical = when (textAlignVertical) {
+ textAlignVertical = when (textVerticalAlignment) {
NitroInputTextAlignVertical.TOP -> NitroInputView.TextAlignVertical.TOP
NitroInputTextAlignVertical.CENTER -> NitroInputView.TextAlignVertical.CENTER
NitroInputTextAlignVertical.BOTTOM -> NitroInputView.TextAlignVertical.BOTTOM
@@ -735,7 +747,11 @@ class HybridNitroInputView(private val context: ThemedReactContext) : HybridNitr
strokeWidth = Math.max(0.0, finite(strokeWidth, 1.0)).toFloat(),
fillColor = colorFromARGB(fillColor),
)
- inputView.alignment = when (textAlign) {
+ inputView.contentInsets = android.graphics.RectF(
+ Math.max(0.0, finite(textInsetLeft, 0.0)).toFloat(), Math.max(0.0, finite(textInsetTop, 0.0)).toFloat(),
+ Math.max(0.0, finite(textInsetRight, 0.0)).toFloat(), Math.max(0.0, finite(textInsetBottom, 0.0)).toFloat(),
+ )
+ inputView.alignment = when (textAlignment) {
NitroInputTextAlign.CENTER -> NitroInputView.Alignment.CENTER
NitroInputTextAlign.RIGHT -> NitroInputView.Alignment.RIGHT
NitroInputTextAlign.LEFT -> NitroInputView.Alignment.LEFT
diff --git a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt
index 7a07d63..51551e6 100644
--- a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt
+++ b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt
@@ -141,7 +141,7 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit
set(v) { field = v; markConfigDirty() }
override var shimmerDelay: Double? = null
set(v) { field = v; markConfigDirty() }
- override var fontSize: Double? = null
+ override var textSize: Double? = null
set(v) { field = v; markConfigDirty() }
override var prefixFontSize: Double? = null
set(v) { field = v; markConfigDirty() }
@@ -153,7 +153,7 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit
set(v) { field = v; markConfigDirty() }
override var suffixAlign: NitroNumberAffixAlign? = null
set(v) { field = v; markConfigDirty() }
- override var letterSpacing: Double? = null
+ override var textLetterSpacing: Double? = null
set(v) { field = v; markConfigDirty() }
override var prefixSpacing: Double? = null
set(v) { field = v; markConfigDirty() }
@@ -201,13 +201,13 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit
set(v) { field = v; markConfigDirty() }
override var maxFontSizeMultiplier: Double? = null
set(v) { field = v; markConfigDirty() }
- override var fontWeight: Double? = null
+ override var textWeight: Double? = null
set(v) { field = v; markConfigDirty() }
- override var fontFamily: String? = null
+ override var textFamily: String? = null
set(v) { field = v; markConfigDirty() }
- override var color: Double? = null
+ override var textColor: Double? = null
set(v) { field = v; markConfigDirty() }
- override var textAlign: NitroNumberTextAlign? = null
+ override var textAlignment: NitroNumberTextAlign? = null
set(v) { field = v; markConfigDirty() }
override var rightToLeft: Boolean? = null
set(v) { field = v; markConfigDirty() }
@@ -360,13 +360,13 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit
shimmerBaseColor = null
shimmerDirection = null
shimmerDelay = null
- fontSize = null
+ textSize = null
prefixFontSize = null
suffixFontSize = null
affixAlign = null
prefixAlign = null
suffixAlign = null
- letterSpacing = null
+ textLetterSpacing = null
prefixSpacing = null
suffixSpacing = null
prefixOffset = null
@@ -391,10 +391,10 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit
minimumFontScale = null
allowFontScaling = null
maxFontSizeMultiplier = null
- fontWeight = null
- fontFamily = null
- color = null
- textAlign = null
+ textWeight = null
+ textFamily = null
+ textColor = null
+ textAlignment = null
rightToLeft = null
onSizeChange = null
configDirty = true
@@ -447,15 +447,15 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit
configDirty = false
rollingView.typography = NitroNumberView.Typography(
- fontSize = (fontSize ?: 32.0).toFloat(),
+ fontSize = (textSize ?: 32.0).toFloat(),
prefixFontSize = prefixFontSize?.toFloat(),
suffixFontSize = suffixFontSize?.toFloat(),
- fontWeight = clampInt(fontWeight, 100, 900, 400),
- fontFamily = fontFamily,
- color = color?.let { colorFromARGB(it) },
+ fontWeight = clampInt(textWeight, 100, 900, 400),
+ fontFamily = textFamily,
+ color = textColor?.let { colorFromARGB(it) },
prefixAlign = mapAffixAlign(prefixAlign ?: affixAlign),
suffixAlign = mapAffixAlign(suffixAlign ?: affixAlign),
- letterSpacing = (letterSpacing ?: 0.0).takeIf { it.isFinite() }?.toFloat() ?: 0f,
+ letterSpacing = (textLetterSpacing ?: 0.0).takeIf { it.isFinite() }?.toFloat() ?: 0f,
prefixSpacing = prefixSpacing?.takeIf { it.isFinite() }?.toFloat(),
suffixSpacing = suffixSpacing?.takeIf { it.isFinite() }?.toFloat(),
prefixOffset = (prefixOffset ?: 0.0).takeIf { it.isFinite() }?.toFloat() ?: 0f,
@@ -545,7 +545,7 @@ class HybridNitroNumberView(private val context: ThemedReactContext) : HybridNit
downColor = flashDownColor?.let { colorFromARGB(it) },
durationMs = Math.max(50.0, flashDuration ?: 600.0).toLong(),
)
- rollingView.alignment = when (textAlign) {
+ rollingView.alignment = when (textAlignment) {
NitroNumberTextAlign.CENTER -> NitroNumberView.Alignment.CENTER
NitroNumberTextAlign.RIGHT -> NitroNumberView.Alignment.RIGHT
NitroNumberTextAlign.LEFT -> NitroNumberView.Alignment.LEFT
diff --git a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt
index 711f17c..8e2cdb1 100644
--- a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt
+++ b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt
@@ -26,12 +26,12 @@ class HybridNitroTextView(private val context: ThemedReactContext) : HybridNitro
override var text: String = ""
// Unset unless the element set it: the wrapper sends only those.
- override var fontSize: Double? = null
- override var fontWeight: Double? = null
- override var fontFamily: String? = null
- override var color: Double? = null
- override var letterSpacing: Double? = null
- override var textAlign: NitroNumberTextAlign? = null
+ override var textSize: Double? = null
+ override var textWeight: Double? = null
+ override var textFamily: String? = null
+ override var textColor: Double? = null
+ override var textLetterSpacing: Double? = null
+ override var textAlignment: NitroNumberTextAlign? = null
override var rightToLeft: Boolean? = null
override var duration: Double? = null
override var easing: NitroInputEasing? = null
@@ -57,12 +57,12 @@ class HybridNitroTextView(private val context: ThemedReactContext) : HybridNitro
private fun apply() {
textView.style = NitroTextView.Style(
- fontSize = fontSize?.takeIf { it.isFinite() && it > 0 } ?: 17.0,
- fontWeight = fontWeight?.takeIf { it.isFinite() } ?: 400.0,
- fontFamily = fontFamily ?: "",
- color = color?.let(::colorFromARGB),
- letterSpacing = (letterSpacing?.takeIf { it.isFinite() } ?: 0.0).toFloat(),
- textAlign = when (textAlign) {
+ fontSize = textSize?.takeIf { it.isFinite() && it > 0 } ?: 17.0,
+ fontWeight = textWeight?.takeIf { it.isFinite() } ?: 400.0,
+ fontFamily = textFamily ?: "",
+ color = textColor?.let(::colorFromARGB),
+ letterSpacing = (textLetterSpacing?.takeIf { it.isFinite() } ?: 0.0).toFloat(),
+ textAlign = when (textAlignment) {
NitroNumberTextAlign.LEFT -> NitroNumberView.Alignment.LEFT
NitroNumberTextAlign.CENTER -> NitroNumberView.Alignment.CENTER
NitroNumberTextAlign.RIGHT -> NitroNumberView.Alignment.RIGHT
@@ -116,8 +116,8 @@ class HybridNitroTextView(private val context: ThemedReactContext) : HybridNitro
override fun prepareForRecycle() {
// The next element's props arrive as a first mount's do, only the ones it set.
text = ""
- fontSize = null; fontWeight = null; fontFamily = null; color = null; letterSpacing = null
- textAlign = null; rightToLeft = null
+ textSize = null; textWeight = null; textFamily = null; textColor = null; textLetterSpacing = null
+ textAlignment = null; rightToLeft = null
duration = null; easing = null; bounce = null; effect = null; respectReduceMotion = null
loading = null
shimmerColor = null; shimmerDuration = null; shimmerAngle = null; shimmerWidth = null
diff --git a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/InputSizing.kt b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/InputSizing.kt
index 4b73c70..bf34c3d 100644
--- a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/InputSizing.kt
+++ b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/InputSizing.kt
@@ -34,13 +34,13 @@ internal interface InputSizingProps {
val suffix: String
val signPlacement: NitroInputSignPlacement
val placeholder: String
- val fontSize: Double
- val lineHeight: Double
+ val textSize: Double
+ val textLineHeight: Double
val prefixFontSize: Double
val suffixFontSize: Double
- val fontWeight: Double
- val fontFamily: String
- val letterSpacing: Double
+ val textWeight: Double
+ val textFamily: String
+ val textLetterSpacing: Double
val prefixSpacing: Double
val suffixSpacing: Double
val allowFontScaling: Boolean
@@ -87,15 +87,15 @@ internal fun formatOf(p: InputSizingProps) = Format(
/** The typography's sizing half; the view adds the colours, alignment and offsets. */
internal fun sizingTypographyOf(p: InputSizingProps, density: Float): Typography {
- val size = finiteOr(p.fontSize, 32.0).toFloat()
+ val size = finiteOr(p.textSize, 32.0).toFloat()
return Typography(
fontSize = size,
- lineHeightPx = (max(0.0, finiteOr(p.lineHeight, 0.0)) * density).toFloat(),
+ lineHeightPx = (max(0.0, finiteOr(p.textLineHeight, 0.0)) * density).toFloat(),
prefixFontSize = finiteOr(p.prefixFontSize, size.toDouble()).toFloat(),
suffixFontSize = finiteOr(p.suffixFontSize, size.toDouble()).toFloat(),
- fontWeight = clampedInt(p.fontWeight, 100, 900, 400),
- fontFamily = p.fontFamily.ifEmpty { null },
- letterSpacing = if (p.letterSpacing.isFinite()) p.letterSpacing.toFloat() else 0f,
+ fontWeight = clampedInt(p.textWeight, 100, 900, 400),
+ fontFamily = p.textFamily.ifEmpty { null },
+ letterSpacing = if (p.textLetterSpacing.isFinite()) p.textLetterSpacing.toFloat() else 0f,
prefixSpacing = p.prefixSpacing.takeIf { it.isFinite() }?.toFloat(),
suffixSpacing = p.suffixSpacing.takeIf { it.isFinite() }?.toFloat(),
allowFontScaling = p.allowFontScaling,
@@ -379,13 +379,13 @@ internal class SizingProps(s: NitroInputSizing) : InputSizingProps {
override val suffix = s.suffix
override val signPlacement = s.signPlacement
override val placeholder = s.placeholder
- override val fontSize = s.fontSize
- override val lineHeight = s.lineHeight
+ override val textSize = s.textSize
+ override val textLineHeight = s.textLineHeight
override val prefixFontSize = s.prefixFontSize
override val suffixFontSize = s.suffixFontSize
- override val fontWeight = s.fontWeight
- override val fontFamily = s.fontFamily
- override val letterSpacing = s.letterSpacing
+ override val textWeight = s.textWeight
+ override val textFamily = s.textFamily
+ override val textLetterSpacing = s.textLetterSpacing
override val prefixSpacing = s.prefixSpacing
override val suffixSpacing = s.suffixSpacing
override val allowFontScaling = s.allowFontScaling
diff --git a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt
index 7d7be64..573214d 100644
--- a/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt
+++ b/packages/react-native-nitro-input/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt
@@ -303,9 +303,45 @@ class NitroInputView(context: Context) : FrameLayout(context) {
if (field == value) return
field = value
applyEditTextLayout()
+ // The gravity alone did nothing: the plain field's text alignment, set
+ // when it became plain (before `textAlign` arrived in the same commit),
+ // overrides it, so a centred or right-aligned field stayed at the start.
+ applyTextAlignment()
overlay.invalidate()
}
+ /**
+ * A plain field's own text alignment. `AUTO` is the start edge of the layout
+ * direction; `LEFT` and `RIGHT` are absolute, which only
+ * `TEXT_ALIGNMENT_GRAVITY` over an absolute gravity gives - `VIEW_START` /
+ * `VIEW_END` would flip with the direction. A reflowing field's edit text is
+ * hidden behind the overlay and stays at the start.
+ */
+ private fun applyTextAlignment() {
+ editText.textAlignment = if (!keyboard.plain) TEXT_ALIGNMENT_VIEW_START else when (alignment) {
+ Alignment.AUTO -> TEXT_ALIGNMENT_VIEW_START
+ Alignment.CENTER -> TEXT_ALIGNMENT_CENTER
+ Alignment.LEFT, Alignment.RIGHT -> TEXT_ALIGNMENT_GRAVITY
+ }
+ }
+
+ /**
+ * The style's padding and border, in dp. React Native lays an iOS view's
+ * content out inside them, but never hands a Nitro view on Android its
+ * padding, so the text ran to the field's edges: they inset the edit text,
+ * the overlay and the frame here instead (JS sends them; see `NitroInput`).
+ */
+ var contentInsets: android.graphics.RectF = android.graphics.RectF()
+ set(value) {
+ if (field == value) return
+ field = value
+ setPadding(
+ (value.left * density).roundToInt(), (value.top * density).roundToInt(),
+ (value.right * density).roundToInt(), (value.bottom * density).roundToInt(),
+ )
+ invalidate()
+ }
+
/** The outline / fill and floating label this view draws for itself. */
var inputFrame: Frame = Frame()
set(value) {
@@ -1010,14 +1046,7 @@ class NitroInputView(context: Context) : FrameLayout(context) {
applyNativeCursor()
applyAutoSize()
applyAffixes()
- // `AUTO` is the start edge of the layout direction; `LEFT` and `RIGHT`
- // are absolute, which only `TEXT_ALIGNMENT_GRAVITY` over an absolute
- // gravity gives - `VIEW_START` / `VIEW_END` would flip with the direction.
- editText.textAlignment = when (alignment) {
- Alignment.AUTO -> TEXT_ALIGNMENT_VIEW_START
- Alignment.CENTER -> TEXT_ALIGNMENT_CENTER
- Alignment.LEFT, Alignment.RIGHT -> TEXT_ALIGNMENT_GRAVITY
- }
+ applyTextAlignment()
// The width now comes from the field, not the engine.
reportIntrinsicSize()
} else {
@@ -2038,7 +2067,18 @@ class NitroInputView(context: Context) : FrameLayout(context) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
- if (!inputFrame.draws || width <= 0 || height <= 0) return
+ // Inside the style's padding and border, as React Native lays the frame
+ // out on iOS (see [contentInsets]).
+ val boxWidth = width - paddingLeft - paddingRight
+ val boxHeight = height - paddingTop - paddingBottom
+ if (!inputFrame.draws || boxWidth <= 0 || boxHeight <= 0) return
+ val saved = canvas.save()
+ canvas.translate(paddingLeft.toFloat(), paddingTop.toFloat())
+ drawFrame(canvas, boxWidth, boxHeight)
+ canvas.restoreToCount(saved)
+ }
+
+ private fun drawFrame(canvas: Canvas, width: Int, height: Int) {
val filled = inputFrame.variant == Variant.FILLED
val stroke = strokeWidthPx
diff --git a/packages/react-native-nitro-input/ios/HybridNitroInputView.swift b/packages/react-native-nitro-input/ios/HybridNitroInputView.swift
index 36e1625..d1803cd 100644
--- a/packages/react-native-nitro-input/ios/HybridNitroInputView.swift
+++ b/packages/react-native-nitro-input/ios/HybridNitroInputView.swift
@@ -117,7 +117,7 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView {
var signPlacement: NitroInputSignPlacement = .beforeaffix { didSet { markConfigDirty() } }
var prefixAlign: NitroInputAffixAlign = .baseline { didSet { markConfigDirty() } }
var suffixAlign: NitroInputAffixAlign = .baseline { didSet { markConfigDirty() } }
- var letterSpacing: Double = 0 { didSet { markConfigDirty() } }
+ var textLetterSpacing: Double = 0 { didSet { markConfigDirty() } }
var prefixSpacing: Double = .infinity { didSet { markConfigDirty() } }
var suffixSpacing: Double = .infinity { didSet { markConfigDirty() } }
var prefixOffset: Double = 0 { didSet { markConfigDirty() } }
@@ -128,12 +128,12 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView {
var easing: NitroInputEasing = .expo { didSet { markConfigDirty() } }
var bounce: Double = 0.15 { didSet { markConfigDirty() } }
var effect: NitroInputEffect = .auto { didSet { markConfigDirty() } }
- var fontSize: Double = 32 { didSet { markConfigDirty() } }
- var lineHeight: Double = 0 { didSet { markConfigDirty() } }
- var fontWeight: Double = 400 { didSet { markConfigDirty() } }
- var fontFamily: String = "" { didSet { markConfigDirty() } }
- var color: Double = .nan { didSet { markConfigDirty() } }
- var textAlign: NitroInputTextAlign = .auto { didSet { markConfigDirty() } }
+ var textSize: Double = 32 { didSet { markConfigDirty() } }
+ var textLineHeight: Double = 0 { didSet { markConfigDirty() } }
+ var textWeight: Double = 400 { didSet { markConfigDirty() } }
+ var textFamily: String = "" { didSet { markConfigDirty() } }
+ var textColor: Double = .nan { didSet { markConfigDirty() } }
+ var textAlignment: NitroInputTextAlign = .auto { didSet { markConfigDirty() } }
var rightToLeft: Bool = false { didSet { markConfigDirty() } }
var caretColor: Double = .nan { didSet { markConfigDirty() } }
var selectionColor: Double = .nan { didSet { markConfigDirty() } }
@@ -149,7 +149,13 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView {
var editable: Bool = true { didSet { markConfigDirty() } }
var multiline: Bool = false { didSet { markConfigDirty() } }
var numberOfLines: Double = 0 { didSet { markConfigDirty() } }
- var textAlignVertical: NitroInputTextAlignVertical = .auto { didSet { markConfigDirty() } }
+ var textVerticalAlignment: NitroInputTextAlignVertical = .auto { didSet { markConfigDirty() } }
+ /// The style's padding and border. Android insets its content by them; on
+ /// iOS React Native already lays the view's content out inside them.
+ var textInsetLeft: Double = 0
+ var textInsetTop: Double = 0
+ var textInsetRight: Double = 0
+ var textInsetBottom: Double = 0
var scrollEnabled: Bool = true { didSet { markConfigDirty() } }
var autoFocus: Bool = false { didSet { markConfigDirty() } }
var fieldTestID: String = "" { didSet { markConfigDirty() } }
@@ -330,7 +336,7 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView {
signPlacement = .beforeaffix
prefixAlign = .baseline
suffixAlign = .baseline
- letterSpacing = 0
+ textLetterSpacing = 0
prefixSpacing = .infinity
suffixSpacing = .infinity
prefixOffset = 0
@@ -341,12 +347,12 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView {
easing = .expo
bounce = 0.15
effect = .auto
- fontSize = 32
- lineHeight = 0
- fontWeight = 400
- fontFamily = ""
- color = .nan
- textAlign = .auto
+ textSize = 32
+ textLineHeight = 0
+ textWeight = 400
+ textFamily = ""
+ textColor = .nan
+ textAlignment = .auto
rightToLeft = false
caretColor = .nan
selectionColor = .nan
@@ -362,7 +368,11 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView {
editable = true
multiline = false
numberOfLines = 0
- textAlignVertical = .auto
+ textVerticalAlignment = .auto
+ textInsetLeft = 0
+ textInsetTop = 0
+ textInsetRight = 0
+ textInsetBottom = 0
scrollEnabled = true
autoFocus = false
fieldTestID = ""
@@ -552,7 +562,7 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView {
// which sizes the field before this view exists (InputSizing.swift).
let format = InputMapping.format(self)
var typography = InputMapping.sizingTypography(self)
- typography.color = Self.color(fromARGB: color) ?? .label
+ typography.color = Self.color(fromARGB: textColor) ?? .label
typography.placeholderColor = Self.color(fromARGB: placeholderColor) ?? .placeholderText
typography.prefixAlign = Self.mapAffixAlign(prefixAlign)
typography.suffixAlign = Self.mapAffixAlign(suffixAlign)
@@ -575,7 +585,7 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView {
traits.editable = editable
traits.multiline = multiline
traits.numberOfLines = numberOfLines.isFinite ? max(0, Int(numberOfLines)) : 0
- traits.textAlignVertical = switch textAlignVertical {
+ traits.textAlignVertical = switch textVerticalAlignment {
case .top: .top
case .center: .center
case .bottom: .bottom
@@ -625,7 +635,7 @@ final class HybridNitroInputView: HybridNitroInputViewSpec, RecyclableView {
inputView.timing = timing
inputView.traits = traits
inputView.worklets = worklets
- inputView.alignment = Self.mapAlignment(textAlign)
+ inputView.alignment = Self.mapAlignment(textAlignment)
// Fabric does not hand a Hybrid View its layout direction, so JS resolves
// it and the view is told outright; `effectiveUserInterfaceLayoutDirection`
// then reads it back for everything that has an edge.
diff --git a/packages/react-native-nitro-input/ios/HybridNitroNumberView.swift b/packages/react-native-nitro-input/ios/HybridNitroNumberView.swift
index ff7291b..ebc8762 100644
--- a/packages/react-native-nitro-input/ios/HybridNitroNumberView.swift
+++ b/packages/react-native-nitro-input/ios/HybridNitroNumberView.swift
@@ -90,13 +90,13 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView {
var shimmerBaseColor: Double? { didSet { markConfigDirty() } }
var shimmerDirection: NitroNumberShimmerDirection? { didSet { markConfigDirty() } }
var shimmerDelay: Double? { didSet { markConfigDirty() } }
- var fontSize: Double? { didSet { markConfigDirty() } }
+ var textSize: Double? { didSet { markConfigDirty() } }
var prefixFontSize: Double? { didSet { markConfigDirty() } }
var suffixFontSize: Double? { didSet { markConfigDirty() } }
var affixAlign: NitroNumberAffixAlign? { didSet { markConfigDirty() } }
var prefixAlign: NitroNumberAffixAlign? { didSet { markConfigDirty() } }
var suffixAlign: NitroNumberAffixAlign? { didSet { markConfigDirty() } }
- var letterSpacing: Double? { didSet { markConfigDirty() } }
+ var textLetterSpacing: Double? { didSet { markConfigDirty() } }
var prefixSpacing: Double? { didSet { markConfigDirty() } }
var suffixSpacing: Double? { didSet { markConfigDirty() } }
var prefixOffset: Double? { didSet { markConfigDirty() } }
@@ -121,10 +121,10 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView {
var minimumFontScale: Double? { didSet { markConfigDirty() } }
var allowFontScaling: Bool? { didSet { markConfigDirty() } }
var maxFontSizeMultiplier: Double? { didSet { markConfigDirty() } }
- var fontWeight: Double? { didSet { markConfigDirty() } }
- var fontFamily: String? { didSet { markConfigDirty() } }
- var color: Double? { didSet { markConfigDirty() } }
- var textAlign: NitroNumberTextAlign? { didSet { markConfigDirty() } }
+ var textWeight: Double? { didSet { markConfigDirty() } }
+ var textFamily: String? { didSet { markConfigDirty() } }
+ var textColor: Double? { didSet { markConfigDirty() } }
+ var textAlignment: NitroNumberTextAlign? { didSet { markConfigDirty() } }
var rightToLeft: Bool? { didSet { markConfigDirty() } }
var onSizeChange: ((Double, Double) -> Void)? {
didSet { onMain { self.rollingView.resendIntrinsicSize() } }
@@ -256,13 +256,13 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView {
shimmerBaseColor = nil
shimmerDirection = nil
shimmerDelay = nil
- fontSize = nil
+ textSize = nil
prefixFontSize = nil
suffixFontSize = nil
affixAlign = nil
prefixAlign = nil
suffixAlign = nil
- letterSpacing = nil
+ textLetterSpacing = nil
prefixSpacing = nil
suffixSpacing = nil
prefixOffset = nil
@@ -287,10 +287,10 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView {
minimumFontScale = nil
allowFontScaling = nil
maxFontSizeMultiplier = nil
- fontWeight = nil
- fontFamily = nil
- color = nil
- textAlign = nil
+ textWeight = nil
+ textFamily = nil
+ textColor = nil
+ textAlignment = nil
rightToLeft = nil
onSizeChange = nil
configDirty = true
@@ -359,16 +359,16 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView {
format.digitMax = (digitMax ?? []).map { $0.isFinite ? Int($0.rounded()) : 9 }
var typography = NitroNumberView.Typography()
- typography.fontSize = CGFloat(fontSize ?? 32)
+ typography.fontSize = CGFloat(textSize ?? 32)
typography.prefixFontSize = prefixFontSize.map { CGFloat($0) }
typography.suffixFontSize = suffixFontSize.map { CGFloat($0) }
- typography.fontWeight = CGFloat(fontWeight ?? 400)
- typography.fontFamily = fontFamily
- typography.color = color.map(Self.color(fromARGB:)) ?? .label
+ typography.fontWeight = CGFloat(textWeight ?? 400)
+ typography.fontFamily = textFamily
+ typography.color = textColor.map(Self.color(fromARGB:)) ?? .label
let sharedAlign = Self.mapAffixAlign(affixAlign)
typography.prefixAlign = prefixAlign.map { Self.mapAffixAlign($0) } ?? sharedAlign
typography.suffixAlign = suffixAlign.map { Self.mapAffixAlign($0) } ?? sharedAlign
- typography.letterSpacing = CGFloat((letterSpacing ?? 0).isFinite ? letterSpacing ?? 0 : 0)
+ typography.letterSpacing = CGFloat((textLetterSpacing ?? 0).isFinite ? textLetterSpacing ?? 0 : 0)
typography.prefixSpacing = prefixSpacing.flatMap { $0.isFinite ? CGFloat($0) : nil }
typography.suffixSpacing = suffixSpacing.flatMap { $0.isFinite ? CGFloat($0) : nil }
typography.prefixOffset = CGFloat((prefixOffset ?? 0).isFinite ? prefixOffset ?? 0 : 0)
@@ -426,7 +426,7 @@ final class HybridNitroNumberView: HybridNitroNumberViewSpec, RecyclableView {
rollingView.timing = timing
rollingView.revealMilestones = revealMilestones ?? []
rollingView.shimmer = shimmer
- rollingView.alignment = Self.mapAlignment(textAlign)
+ rollingView.alignment = Self.mapAlignment(textAlignment)
// Fabric does not hand a Hybrid View its layout direction, so JS resolves
// it and the view is told outright; `effectiveUserInterfaceLayoutDirection`
// then reads it back for the alignment and the affixes.
diff --git a/packages/react-native-nitro-input/ios/HybridNitroTextView.swift b/packages/react-native-nitro-input/ios/HybridNitroTextView.swift
index 62ce564..34b368b 100644
--- a/packages/react-native-nitro-input/ios/HybridNitroTextView.swift
+++ b/packages/react-native-nitro-input/ios/HybridNitroTextView.swift
@@ -17,12 +17,12 @@ final class HybridNitroTextView: HybridNitroTextViewSpec, RecyclableView {
var text: String = ""
// Unset unless the element set it: the wrapper sends only those.
- var fontSize: Double?
- var fontWeight: Double?
- var fontFamily: String?
- var color: Double?
- var letterSpacing: Double?
- var textAlign: NitroNumberTextAlign?
+ var textSize: Double?
+ var textWeight: Double?
+ var textFamily: String?
+ var textColor: Double?
+ var textLetterSpacing: Double?
+ var textAlignment: NitroNumberTextAlign?
var rightToLeft: Bool?
var duration: Double?
var easing: NitroInputEasing?
@@ -42,12 +42,12 @@ final class HybridNitroTextView: HybridNitroTextViewSpec, RecyclableView {
/// (the style first, so the text is laid out in its font).
func afterUpdate() {
var style = NitroTextView.Style()
- if let fontSize, fontSize.isFinite, fontSize > 0 { style.fontSize = CGFloat(fontSize) }
- if let fontWeight, fontWeight.isFinite { style.fontWeight = CGFloat(fontWeight) }
- if let fontFamily { style.fontFamily = fontFamily }
- if let color = color.flatMap(Self.color) { style.color = color }
- if let letterSpacing, letterSpacing.isFinite { style.letterSpacing = CGFloat(letterSpacing) }
- switch textAlign {
+ if let textSize, textSize.isFinite, textSize > 0 { style.fontSize = CGFloat(textSize) }
+ if let textWeight, textWeight.isFinite { style.fontWeight = CGFloat(textWeight) }
+ if let textFamily { style.fontFamily = textFamily }
+ if let color = textColor.flatMap(Self.color) { style.color = color }
+ if let textLetterSpacing, textLetterSpacing.isFinite { style.letterSpacing = CGFloat(textLetterSpacing) }
+ switch textAlignment {
case .left: style.textAlign = .left
case .center: style.textAlign = .center
case .right: style.textAlign = .right
@@ -97,8 +97,8 @@ final class HybridNitroTextView: HybridNitroTextViewSpec, RecyclableView {
/// set, so forget this one's first.
func prepareForRecycle() {
text = ""
- fontSize = nil; fontWeight = nil; fontFamily = nil; color = nil; letterSpacing = nil
- textAlign = nil; rightToLeft = nil
+ textSize = nil; textWeight = nil; textFamily = nil; textColor = nil; textLetterSpacing = nil
+ textAlignment = nil; rightToLeft = nil
duration = nil; easing = nil; bounce = nil; effect = nil; respectReduceMotion = nil
loading = nil
shimmerColor = nil; shimmerDuration = nil; shimmerAngle = nil; shimmerWidth = nil
diff --git a/packages/react-native-nitro-input/ios/InputSizing.swift b/packages/react-native-nitro-input/ios/InputSizing.swift
index 972bd9e..f195b40 100644
--- a/packages/react-native-nitro-input/ios/InputSizing.swift
+++ b/packages/react-native-nitro-input/ios/InputSizing.swift
@@ -40,13 +40,13 @@ protocol InputSizingProps {
var signPlacement: NitroInputSignPlacement { get }
var placeholder: String { get }
var maxLength: Double { get }
- var fontSize: Double { get }
- var lineHeight: Double { get }
+ var textSize: Double { get }
+ var textLineHeight: Double { get }
var prefixFontSize: Double { get }
var suffixFontSize: Double { get }
- var fontWeight: Double { get }
- var fontFamily: String { get }
- var letterSpacing: Double { get }
+ var textWeight: Double { get }
+ var textFamily: String { get }
+ var textLetterSpacing: Double { get }
var prefixSpacing: Double { get }
var suffixSpacing: Double { get }
var allowFontScaling: Bool { get }
@@ -101,13 +101,13 @@ enum InputMapping {
/// The typography's sizing half; the view adds the colours, alignment and offsets.
static func sizingTypography(_ p: some InputSizingProps) -> NitroInputView.Typography {
var typography = NitroInputView.Typography()
- typography.fontSize = CGFloat(p.fontSize.isFinite && p.fontSize > 0 ? p.fontSize : 32)
- typography.lineHeight = CGFloat(p.lineHeight.isFinite && p.lineHeight > 0 ? p.lineHeight : 0)
+ typography.fontSize = CGFloat(p.textSize.isFinite && p.textSize > 0 ? p.textSize : 32)
+ typography.lineHeight = CGFloat(p.textLineHeight.isFinite && p.textLineHeight > 0 ? p.textLineHeight : 0)
typography.prefixFontSize = p.prefixFontSize.isFinite && p.prefixFontSize > 0 ? CGFloat(p.prefixFontSize) : nil
typography.suffixFontSize = p.suffixFontSize.isFinite && p.suffixFontSize > 0 ? CGFloat(p.suffixFontSize) : nil
- typography.fontWeight = CGFloat(p.fontWeight.isFinite ? p.fontWeight : 400)
- typography.fontFamily = p.fontFamily.isEmpty ? nil : p.fontFamily
- typography.letterSpacing = CGFloat(p.letterSpacing.isFinite ? p.letterSpacing : 0)
+ typography.fontWeight = CGFloat(p.textWeight.isFinite ? p.textWeight : 400)
+ typography.fontFamily = p.textFamily.isEmpty ? nil : p.textFamily
+ typography.letterSpacing = CGFloat(p.textLetterSpacing.isFinite ? p.textLetterSpacing : 0)
typography.prefixSpacing = p.prefixSpacing.isFinite ? CGFloat(p.prefixSpacing) : nil
typography.suffixSpacing = p.suffixSpacing.isFinite ? CGFloat(p.suffixSpacing) : nil
typography.allowFontScaling = p.allowFontScaling
@@ -210,6 +210,9 @@ final class InputMetrics {
let suffixOffset: CGFloat
/// Height of the line box (the body font's line height).
let lineHeight: CGFloat
+ /// The height a single line asks for: `lineHeight` when the typography sets
+ /// one, else the font's own, as on Android (and as `TextInput` sizes itself).
+ let lineBoxHeight: CGFloat
/// The advance of one of the bullets a plain secure field draws (see `init`).
let secureBulletWidth: CGFloat
private var widthCache: [WidthKey: CGFloat] = [:]
@@ -232,6 +235,7 @@ final class InputMetrics {
prefixOffset = t.prefixOffset * scale
suffixOffset = t.suffixOffset * scale
lineHeight = ceil(body.lineHeight)
+ lineBoxHeight = t.lineHeight > 0 ? t.lineHeight : lineHeight
// A plain secure field is drawn by UITextField, which shows every
// character as U+2219 in the *system* font at the field's size - in the
// field's weight when that is the system font, regular otherwise - not as
@@ -524,7 +528,7 @@ final class HybridNitroInputMeasure: HybridNitroInputMeasureSpec {
? InputSizing.plainWidth(metrics, format: format, text: text, hint: hint, tail: tail, secure: sizing.secureTextEntry)
: InputSizing.reflowWidth(metrics, format: format, text: text, hint: hint, tail: tail, secure: sizing.secureTextEntry)
let size = InputSizing.reported(width: InputFrameMetrics.width(content: width, frame: frame, metrics: metrics),
- height: InputFrameMetrics.singleLineHeight(metrics.lineHeight, frame: frame, metrics: metrics))
+ height: InputFrameMetrics.singleLineHeight(metrics.lineBoxHeight, frame: frame, metrics: metrics))
return NitroInputSize(width: Double(size.width), height: Double(size.height))
}
}
diff --git a/packages/react-native-nitro-input/ios/NitroInputView.swift b/packages/react-native-nitro-input/ios/NitroInputView.swift
index 37b8a08..af01810 100644
--- a/packages/react-native-nitro-input/ios/NitroInputView.swift
+++ b/packages/react-native-nitro-input/ios/NitroInputView.swift
@@ -1945,7 +1945,11 @@ final class NitroInputView: UIView {
private func intrinsicHeight() -> CGFloat {
// A single line is centred in its height; a frame adds its padding (and a filled label's line).
- guard traits.multiline else { return InputFrameMetrics.singleLineHeight(fonts.lineHeight, frame: inputFrame, metrics: fonts.metrics) }
+ // `lineHeight` sets a single line's height too, as on Android; it was the
+ // font's own line box here whatever the prop said.
+ guard traits.multiline else {
+ return InputFrameMetrics.singleLineHeight(fonts.metrics.lineBoxHeight, frame: inputFrame, metrics: fonts.metrics)
+ }
let line = lineBoxHeight
// Only the frame's room is on top of the text. The rest of the text view's
// inset is `lineBoxPadding`, which is the *first* line's share of the
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp
index 39cc381..ad10c89 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp
@@ -500,14 +500,14 @@ namespace margelo::nitro::nitroinput {
static const auto method = _javaPart->javaClassStatic()->getMethod /* suffixAlign */)>("setSuffixAlign");
method(_javaPart, JNitroInputAffixAlign::fromCpp(suffixAlign));
}
- double JHybridNitroInputViewSpec::getLetterSpacing() {
- static const auto method = _javaPart->javaClassStatic()->getMethod("getLetterSpacing");
+ double JHybridNitroInputViewSpec::getTextLetterSpacing() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("getTextLetterSpacing");
auto __result = method(_javaPart);
return __result;
}
- void JHybridNitroInputViewSpec::setLetterSpacing(double letterSpacing) {
- static const auto method = _javaPart->javaClassStatic()->getMethod("setLetterSpacing");
- method(_javaPart, letterSpacing);
+ void JHybridNitroInputViewSpec::setTextLetterSpacing(double textLetterSpacing) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("setTextLetterSpacing");
+ method(_javaPart, textLetterSpacing);
}
double JHybridNitroInputViewSpec::getPrefixSpacing() {
static const auto method = _javaPart->javaClassStatic()->getMethod("getPrefixSpacing");
@@ -599,59 +599,59 @@ namespace margelo::nitro::nitroinput {
static const auto method = _javaPart->javaClassStatic()->getMethod /* effect */)>("setEffect");
method(_javaPart, JNitroInputEffect::fromCpp(effect));
}
- double JHybridNitroInputViewSpec::getFontSize() {
- static const auto method = _javaPart->javaClassStatic()->getMethod("getFontSize");
+ double JHybridNitroInputViewSpec::getTextSize() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("getTextSize");
auto __result = method(_javaPart);
return __result;
}
- void JHybridNitroInputViewSpec::setFontSize(double fontSize) {
- static const auto method = _javaPart->javaClassStatic()->getMethod("setFontSize");
- method(_javaPart, fontSize);
+ void JHybridNitroInputViewSpec::setTextSize(double textSize) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("setTextSize");
+ method(_javaPart, textSize);
}
- double JHybridNitroInputViewSpec::getLineHeight() {
- static const auto method = _javaPart->javaClassStatic()->getMethod("getLineHeight");
+ double JHybridNitroInputViewSpec::getTextLineHeight() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("getTextLineHeight");
auto __result = method(_javaPart);
return __result;
}
- void JHybridNitroInputViewSpec::setLineHeight(double lineHeight) {
- static const auto method = _javaPart->javaClassStatic()->getMethod("setLineHeight");
- method(_javaPart, lineHeight);
+ void JHybridNitroInputViewSpec::setTextLineHeight(double textLineHeight) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("setTextLineHeight");
+ method(_javaPart, textLineHeight);
}
- double JHybridNitroInputViewSpec::getFontWeight() {
- static const auto method = _javaPart->javaClassStatic()->getMethod("getFontWeight");
+ double JHybridNitroInputViewSpec::getTextWeight() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("getTextWeight");
auto __result = method(_javaPart);
return __result;
}
- void JHybridNitroInputViewSpec::setFontWeight(double fontWeight) {
- static const auto method = _javaPart->javaClassStatic()->getMethod("setFontWeight");
- method(_javaPart, fontWeight);
+ void JHybridNitroInputViewSpec::setTextWeight(double textWeight) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("setTextWeight");
+ method(_javaPart, textWeight);
}
- std::string JHybridNitroInputViewSpec::getFontFamily() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontFamily");
+ std::string JHybridNitroInputViewSpec::getTextFamily() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextFamily");
auto __result = method(_javaPart);
return __result->toStdString();
}
- void JHybridNitroInputViewSpec::setFontFamily(const std::string& fontFamily) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* fontFamily */)>("setFontFamily");
- method(_javaPart, jni::make_jstring(fontFamily));
+ void JHybridNitroInputViewSpec::setTextFamily(const std::string& textFamily) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textFamily */)>("setTextFamily");
+ method(_javaPart, jni::make_jstring(textFamily));
}
- double JHybridNitroInputViewSpec::getColor() {
- static const auto method = _javaPart->javaClassStatic()->getMethod("getColor");
+ double JHybridNitroInputViewSpec::getTextColor() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("getTextColor");
auto __result = method(_javaPart);
return __result;
}
- void JHybridNitroInputViewSpec::setColor(double color) {
- static const auto method = _javaPart->javaClassStatic()->getMethod("setColor");
- method(_javaPart, color);
+ void JHybridNitroInputViewSpec::setTextColor(double textColor) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("setTextColor");
+ method(_javaPart, textColor);
}
- NitroInputTextAlign JHybridNitroInputViewSpec::getTextAlign() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlign");
+ NitroInputTextAlign JHybridNitroInputViewSpec::getTextAlignment() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlignment");
auto __result = method(_javaPart);
return __result->toCpp();
}
- void JHybridNitroInputViewSpec::setTextAlign(NitroInputTextAlign textAlign) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlign */)>("setTextAlign");
- method(_javaPart, JNitroInputTextAlign::fromCpp(textAlign));
+ void JHybridNitroInputViewSpec::setTextAlignment(NitroInputTextAlign textAlignment) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlignment */)>("setTextAlignment");
+ method(_javaPart, JNitroInputTextAlign::fromCpp(textAlignment));
}
bool JHybridNitroInputViewSpec::getRightToLeft() {
static const auto method = _javaPart->javaClassStatic()->getMethod("getRightToLeft");
@@ -788,14 +788,50 @@ namespace margelo::nitro::nitroinput {
static const auto method = _javaPart->javaClassStatic()->getMethod("setNumberOfLines");
method(_javaPart, numberOfLines);
}
- NitroInputTextAlignVertical JHybridNitroInputViewSpec::getTextAlignVertical() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlignVertical");
+ NitroInputTextAlignVertical JHybridNitroInputViewSpec::getTextVerticalAlignment() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextVerticalAlignment");
auto __result = method(_javaPart);
return __result->toCpp();
}
- void JHybridNitroInputViewSpec::setTextAlignVertical(NitroInputTextAlignVertical textAlignVertical) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlignVertical */)>("setTextAlignVertical");
- method(_javaPart, JNitroInputTextAlignVertical::fromCpp(textAlignVertical));
+ void JHybridNitroInputViewSpec::setTextVerticalAlignment(NitroInputTextAlignVertical textVerticalAlignment) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textVerticalAlignment */)>("setTextVerticalAlignment");
+ method(_javaPart, JNitroInputTextAlignVertical::fromCpp(textVerticalAlignment));
+ }
+ double JHybridNitroInputViewSpec::getTextInsetLeft() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("getTextInsetLeft");
+ auto __result = method(_javaPart);
+ return __result;
+ }
+ void JHybridNitroInputViewSpec::setTextInsetLeft(double textInsetLeft) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("setTextInsetLeft");
+ method(_javaPart, textInsetLeft);
+ }
+ double JHybridNitroInputViewSpec::getTextInsetTop() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("getTextInsetTop");
+ auto __result = method(_javaPart);
+ return __result;
+ }
+ void JHybridNitroInputViewSpec::setTextInsetTop(double textInsetTop) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("setTextInsetTop");
+ method(_javaPart, textInsetTop);
+ }
+ double JHybridNitroInputViewSpec::getTextInsetRight() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("getTextInsetRight");
+ auto __result = method(_javaPart);
+ return __result;
+ }
+ void JHybridNitroInputViewSpec::setTextInsetRight(double textInsetRight) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("setTextInsetRight");
+ method(_javaPart, textInsetRight);
+ }
+ double JHybridNitroInputViewSpec::getTextInsetBottom() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("getTextInsetBottom");
+ auto __result = method(_javaPart);
+ return __result;
+ }
+ void JHybridNitroInputViewSpec::setTextInsetBottom(double textInsetBottom) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod("setTextInsetBottom");
+ method(_javaPart, textInsetBottom);
}
bool JHybridNitroInputViewSpec::getScrollEnabled() {
static const auto method = _javaPart->javaClassStatic()->getMethod("getScrollEnabled");
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp
index 6a9022c..d6cf3ea 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp
@@ -122,8 +122,8 @@ namespace margelo::nitro::nitroinput {
void setPrefixAlign(NitroInputAffixAlign prefixAlign) override;
NitroInputAffixAlign getSuffixAlign() override;
void setSuffixAlign(NitroInputAffixAlign suffixAlign) override;
- double getLetterSpacing() override;
- void setLetterSpacing(double letterSpacing) override;
+ double getTextLetterSpacing() override;
+ void setTextLetterSpacing(double textLetterSpacing) override;
double getPrefixSpacing() override;
void setPrefixSpacing(double prefixSpacing) override;
double getSuffixSpacing() override;
@@ -144,18 +144,18 @@ namespace margelo::nitro::nitroinput {
void setBounce(double bounce) override;
NitroInputEffect getEffect() override;
void setEffect(NitroInputEffect effect) override;
- double getFontSize() override;
- void setFontSize(double fontSize) override;
- double getLineHeight() override;
- void setLineHeight(double lineHeight) override;
- double getFontWeight() override;
- void setFontWeight(double fontWeight) override;
- std::string getFontFamily() override;
- void setFontFamily(const std::string& fontFamily) override;
- double getColor() override;
- void setColor(double color) override;
- NitroInputTextAlign getTextAlign() override;
- void setTextAlign(NitroInputTextAlign textAlign) override;
+ double getTextSize() override;
+ void setTextSize(double textSize) override;
+ double getTextLineHeight() override;
+ void setTextLineHeight(double textLineHeight) override;
+ double getTextWeight() override;
+ void setTextWeight(double textWeight) override;
+ std::string getTextFamily() override;
+ void setTextFamily(const std::string& textFamily) override;
+ double getTextColor() override;
+ void setTextColor(double textColor) override;
+ NitroInputTextAlign getTextAlignment() override;
+ void setTextAlignment(NitroInputTextAlign textAlignment) override;
bool getRightToLeft() override;
void setRightToLeft(bool rightToLeft) override;
double getCaretColor() override;
@@ -186,8 +186,16 @@ namespace margelo::nitro::nitroinput {
void setMultiline(bool multiline) override;
double getNumberOfLines() override;
void setNumberOfLines(double numberOfLines) override;
- NitroInputTextAlignVertical getTextAlignVertical() override;
- void setTextAlignVertical(NitroInputTextAlignVertical textAlignVertical) override;
+ NitroInputTextAlignVertical getTextVerticalAlignment() override;
+ void setTextVerticalAlignment(NitroInputTextAlignVertical textVerticalAlignment) override;
+ double getTextInsetLeft() override;
+ void setTextInsetLeft(double textInsetLeft) override;
+ double getTextInsetTop() override;
+ void setTextInsetTop(double textInsetTop) override;
+ double getTextInsetRight() override;
+ void setTextInsetRight(double textInsetRight) override;
+ double getTextInsetBottom() override;
+ void setTextInsetBottom(double textInsetBottom) override;
bool getScrollEnabled() override;
void setScrollEnabled(bool scrollEnabled) override;
bool getAutoFocus() override;
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp
index df2cfb3..32bc256 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp
@@ -386,14 +386,14 @@ namespace margelo::nitro::nitroinput {
static const auto method = _javaPart->javaClassStatic()->getMethod /* shimmerDelay */)>("setShimmerDelay");
method(_javaPart, shimmerDelay.has_value() ? jni::JDouble::valueOf(shimmerDelay.value()) : nullptr);
}
- std::optional JHybridNitroNumberViewSpec::getFontSize() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontSize");
+ std::optional JHybridNitroNumberViewSpec::getTextSize() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextSize");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
}
- void JHybridNitroNumberViewSpec::setFontSize(std::optional fontSize) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* fontSize */)>("setFontSize");
- method(_javaPart, fontSize.has_value() ? jni::JDouble::valueOf(fontSize.value()) : nullptr);
+ void JHybridNitroNumberViewSpec::setTextSize(std::optional textSize) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textSize */)>("setTextSize");
+ method(_javaPart, textSize.has_value() ? jni::JDouble::valueOf(textSize.value()) : nullptr);
}
std::optional JHybridNitroNumberViewSpec::getPrefixFontSize() {
static const auto method = _javaPart->javaClassStatic()->getMethod()>("getPrefixFontSize");
@@ -440,14 +440,14 @@ namespace margelo::nitro::nitroinput {
static const auto method = _javaPart->javaClassStatic()->getMethod /* suffixAlign */)>("setSuffixAlign");
method(_javaPart, suffixAlign.has_value() ? JNitroNumberAffixAlign::fromCpp(suffixAlign.value()) : nullptr);
}
- std::optional JHybridNitroNumberViewSpec::getLetterSpacing() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getLetterSpacing");
+ std::optional JHybridNitroNumberViewSpec::getTextLetterSpacing() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextLetterSpacing");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
}
- void JHybridNitroNumberViewSpec::setLetterSpacing(std::optional letterSpacing) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* letterSpacing */)>("setLetterSpacing");
- method(_javaPart, letterSpacing.has_value() ? jni::JDouble::valueOf(letterSpacing.value()) : nullptr);
+ void JHybridNitroNumberViewSpec::setTextLetterSpacing(std::optional textLetterSpacing) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textLetterSpacing */)>("setTextLetterSpacing");
+ method(_javaPart, textLetterSpacing.has_value() ? jni::JDouble::valueOf(textLetterSpacing.value()) : nullptr);
}
std::optional JHybridNitroNumberViewSpec::getPrefixSpacing() {
static const auto method = _javaPart->javaClassStatic()->getMethod()>("getPrefixSpacing");
@@ -685,41 +685,41 @@ namespace margelo::nitro::nitroinput {
static const auto method = _javaPart->javaClassStatic()->getMethod /* maxFontSizeMultiplier */)>("setMaxFontSizeMultiplier");
method(_javaPart, maxFontSizeMultiplier.has_value() ? jni::JDouble::valueOf(maxFontSizeMultiplier.value()) : nullptr);
}
- std::optional JHybridNitroNumberViewSpec::getFontWeight() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontWeight");
+ std::optional JHybridNitroNumberViewSpec::getTextWeight() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextWeight");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
}
- void JHybridNitroNumberViewSpec::setFontWeight(std::optional fontWeight) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* fontWeight */)>("setFontWeight");
- method(_javaPart, fontWeight.has_value() ? jni::JDouble::valueOf(fontWeight.value()) : nullptr);
+ void JHybridNitroNumberViewSpec::setTextWeight(std::optional textWeight) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textWeight */)>("setTextWeight");
+ method(_javaPart, textWeight.has_value() ? jni::JDouble::valueOf(textWeight.value()) : nullptr);
}
- std::optional JHybridNitroNumberViewSpec::getFontFamily() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontFamily");
+ std::optional JHybridNitroNumberViewSpec::getTextFamily() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextFamily");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
}
- void JHybridNitroNumberViewSpec::setFontFamily(const std::optional& fontFamily) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* fontFamily */)>("setFontFamily");
- method(_javaPart, fontFamily.has_value() ? jni::make_jstring(fontFamily.value()) : nullptr);
+ void JHybridNitroNumberViewSpec::setTextFamily(const std::optional& textFamily) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textFamily */)>("setTextFamily");
+ method(_javaPart, textFamily.has_value() ? jni::make_jstring(textFamily.value()) : nullptr);
}
- std::optional JHybridNitroNumberViewSpec::getColor() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getColor");
+ std::optional JHybridNitroNumberViewSpec::getTextColor() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextColor");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
}
- void JHybridNitroNumberViewSpec::setColor(std::optional color) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* color */)>("setColor");
- method(_javaPart, color.has_value() ? jni::JDouble::valueOf(color.value()) : nullptr);
+ void JHybridNitroNumberViewSpec::setTextColor(std::optional textColor) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textColor */)>("setTextColor");
+ method(_javaPart, textColor.has_value() ? jni::JDouble::valueOf(textColor.value()) : nullptr);
}
- std::optional JHybridNitroNumberViewSpec::getTextAlign() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlign");
+ std::optional JHybridNitroNumberViewSpec::getTextAlignment() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlignment");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
}
- void JHybridNitroNumberViewSpec::setTextAlign(std::optional textAlign) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlign */)>("setTextAlign");
- method(_javaPart, textAlign.has_value() ? JNitroNumberTextAlign::fromCpp(textAlign.value()) : nullptr);
+ void JHybridNitroNumberViewSpec::setTextAlignment(std::optional textAlignment) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlignment */)>("setTextAlignment");
+ method(_javaPart, textAlignment.has_value() ? JNitroNumberTextAlign::fromCpp(textAlignment.value()) : nullptr);
}
std::optional JHybridNitroNumberViewSpec::getRightToLeft() {
static const auto method = _javaPart->javaClassStatic()->getMethod()>("getRightToLeft");
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp
index b1f25e4..9403eeb 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp
@@ -116,8 +116,8 @@ namespace margelo::nitro::nitroinput {
void setShimmerDirection(std::optional shimmerDirection) override;
std::optional getShimmerDelay() override;
void setShimmerDelay(std::optional shimmerDelay) override;
- std::optional getFontSize() override;
- void setFontSize(std::optional fontSize) override;
+ std::optional getTextSize() override;
+ void setTextSize(std::optional textSize) override;
std::optional getPrefixFontSize() override;
void setPrefixFontSize(std::optional prefixFontSize) override;
std::optional getSuffixFontSize() override;
@@ -128,8 +128,8 @@ namespace margelo::nitro::nitroinput {
void setPrefixAlign(std::optional prefixAlign) override;
std::optional getSuffixAlign() override;
void setSuffixAlign(std::optional suffixAlign) override;
- std::optional getLetterSpacing() override;
- void setLetterSpacing(std::optional letterSpacing) override;
+ std::optional getTextLetterSpacing() override;
+ void setTextLetterSpacing(std::optional textLetterSpacing) override;
std::optional getPrefixSpacing() override;
void setPrefixSpacing(std::optional prefixSpacing) override;
std::optional getSuffixSpacing() override;
@@ -174,14 +174,14 @@ namespace margelo::nitro::nitroinput {
void setAllowFontScaling(std::optional allowFontScaling) override;
std::optional getMaxFontSizeMultiplier() override;
void setMaxFontSizeMultiplier(std::optional maxFontSizeMultiplier) override;
- std::optional getFontWeight() override;
- void setFontWeight(std::optional fontWeight) override;
- std::optional getFontFamily() override;
- void setFontFamily(const std::optional& fontFamily) override;
- std::optional getColor() override;
- void setColor(std::optional color) override;
- std::optional getTextAlign() override;
- void setTextAlign(std::optional textAlign) override;
+ std::optional getTextWeight() override;
+ void setTextWeight(std::optional textWeight) override;
+ std::optional getTextFamily() override;
+ void setTextFamily(const std::optional& textFamily) override;
+ std::optional getTextColor() override;
+ void setTextColor(std::optional textColor) override;
+ std::optional getTextAlignment() override;
+ void setTextAlignment(std::optional textAlignment) override;
std::optional getRightToLeft() override;
void setRightToLeft(std::optional rightToLeft) override;
std::optional> getOnSizeChange() override;
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp
index 018021f..4f78ee6 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp
@@ -66,59 +66,59 @@ namespace margelo::nitro::nitroinput {
static const auto method = _javaPart->javaClassStatic()->getMethod /* text */)>("setText");
method(_javaPart, jni::make_jstring(text));
}
- std::optional JHybridNitroTextViewSpec::getFontSize() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontSize");
+ std::optional JHybridNitroTextViewSpec::getTextSize() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextSize");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
}
- void JHybridNitroTextViewSpec::setFontSize(std::optional fontSize) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* fontSize */)>("setFontSize");
- method(_javaPart, fontSize.has_value() ? jni::JDouble::valueOf(fontSize.value()) : nullptr);
+ void JHybridNitroTextViewSpec::setTextSize(std::optional textSize) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textSize */)>("setTextSize");
+ method(_javaPart, textSize.has_value() ? jni::JDouble::valueOf(textSize.value()) : nullptr);
}
- std::optional JHybridNitroTextViewSpec::getFontWeight() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontWeight");
+ std::optional JHybridNitroTextViewSpec::getTextWeight() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextWeight");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
}
- void JHybridNitroTextViewSpec::setFontWeight(std::optional fontWeight) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* fontWeight */)>("setFontWeight");
- method(_javaPart, fontWeight.has_value() ? jni::JDouble::valueOf(fontWeight.value()) : nullptr);
+ void JHybridNitroTextViewSpec::setTextWeight(std::optional textWeight) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textWeight */)>("setTextWeight");
+ method(_javaPart, textWeight.has_value() ? jni::JDouble::valueOf(textWeight.value()) : nullptr);
}
- std::optional JHybridNitroTextViewSpec::getFontFamily() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getFontFamily");
+ std::optional JHybridNitroTextViewSpec::getTextFamily() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextFamily");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
}
- void JHybridNitroTextViewSpec::setFontFamily(const std::optional& fontFamily) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* fontFamily */)>("setFontFamily");
- method(_javaPart, fontFamily.has_value() ? jni::make_jstring(fontFamily.value()) : nullptr);
+ void JHybridNitroTextViewSpec::setTextFamily(const std::optional& textFamily) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textFamily */)>("setTextFamily");
+ method(_javaPart, textFamily.has_value() ? jni::make_jstring(textFamily.value()) : nullptr);
}
- std::optional JHybridNitroTextViewSpec::getColor() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getColor");
+ std::optional JHybridNitroTextViewSpec::getTextColor() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextColor");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
}
- void JHybridNitroTextViewSpec::setColor(std::optional color) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* color */)>("setColor");
- method(_javaPart, color.has_value() ? jni::JDouble::valueOf(color.value()) : nullptr);
+ void JHybridNitroTextViewSpec::setTextColor(std::optional textColor) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textColor */)>("setTextColor");
+ method(_javaPart, textColor.has_value() ? jni::JDouble::valueOf(textColor.value()) : nullptr);
}
- std::optional JHybridNitroTextViewSpec::getLetterSpacing() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getLetterSpacing");
+ std::optional JHybridNitroTextViewSpec::getTextLetterSpacing() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextLetterSpacing");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
}
- void JHybridNitroTextViewSpec::setLetterSpacing(std::optional letterSpacing) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* letterSpacing */)>("setLetterSpacing");
- method(_javaPart, letterSpacing.has_value() ? jni::JDouble::valueOf(letterSpacing.value()) : nullptr);
+ void JHybridNitroTextViewSpec::setTextLetterSpacing(std::optional textLetterSpacing) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textLetterSpacing */)>("setTextLetterSpacing");
+ method(_javaPart, textLetterSpacing.has_value() ? jni::JDouble::valueOf(textLetterSpacing.value()) : nullptr);
}
- std::optional JHybridNitroTextViewSpec::getTextAlign() {
- static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlign");
+ std::optional JHybridNitroTextViewSpec::getTextAlignment() {
+ static const auto method = _javaPart->javaClassStatic()->getMethod()>("getTextAlignment");
auto __result = method(_javaPart);
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
}
- void JHybridNitroTextViewSpec::setTextAlign(std::optional textAlign) {
- static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlign */)>("setTextAlign");
- method(_javaPart, textAlign.has_value() ? JNitroNumberTextAlign::fromCpp(textAlign.value()) : nullptr);
+ void JHybridNitroTextViewSpec::setTextAlignment(std::optional textAlignment) {
+ static const auto method = _javaPart->javaClassStatic()->getMethod /* textAlignment */)>("setTextAlignment");
+ method(_javaPart, textAlignment.has_value() ? JNitroNumberTextAlign::fromCpp(textAlignment.value()) : nullptr);
}
std::optional JHybridNitroTextViewSpec::getRightToLeft() {
static const auto method = _javaPart->javaClassStatic()->getMethod()>("getRightToLeft");
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp
index fc73205..aa0cb49 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp
@@ -52,18 +52,18 @@ namespace margelo::nitro::nitroinput {
// Properties
std::string getText() override;
void setText(const std::string& text) override;
- std::optional getFontSize() override;
- void setFontSize(std::optional fontSize) override;
- std::optional getFontWeight() override;
- void setFontWeight(std::optional fontWeight) override;
- std::optional getFontFamily() override;
- void setFontFamily(const std::optional& fontFamily) override;
- std::optional getColor() override;
- void setColor(std::optional color) override;
- std::optional getLetterSpacing() override;
- void setLetterSpacing(std::optional letterSpacing) override;
- std::optional getTextAlign() override;
- void setTextAlign(std::optional textAlign) override;
+ std::optional getTextSize() override;
+ void setTextSize(std::optional textSize) override;
+ std::optional getTextWeight() override;
+ void setTextWeight(std::optional textWeight) override;
+ std::optional getTextFamily() override;
+ void setTextFamily(const std::optional& textFamily) override;
+ std::optional getTextColor() override;
+ void setTextColor(std::optional textColor) override;
+ std::optional getTextLetterSpacing() override;
+ void setTextLetterSpacing(std::optional textLetterSpacing) override;
+ std::optional getTextAlignment() override;
+ void setTextAlignment(std::optional textAlignment) override;
std::optional getRightToLeft() override;
void setRightToLeft(std::optional rightToLeft) override;
std::optional getDuration() override;
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JNitroInputSizing.hpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JNitroInputSizing.hpp
index c14f049..e5f1b82 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/JNitroInputSizing.hpp
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/JNitroInputSizing.hpp
@@ -96,20 +96,20 @@ namespace margelo::nitro::nitroinput {
jni::local_ref maskSlotPlaceholder = this->getFieldValue(fieldMaskSlotPlaceholder);
static const auto fieldKeepPlaceholder = clazz->getField("keepPlaceholder");
jboolean keepPlaceholder = this->getFieldValue(fieldKeepPlaceholder);
- static const auto fieldFontSize = clazz->getField("fontSize");
- double fontSize = this->getFieldValue(fieldFontSize);
- static const auto fieldLineHeight = clazz->getField("lineHeight");
- double lineHeight = this->getFieldValue(fieldLineHeight);
+ static const auto fieldTextSize = clazz->getField("textSize");
+ double textSize = this->getFieldValue(fieldTextSize);
+ static const auto fieldTextLineHeight = clazz->getField("textLineHeight");
+ double textLineHeight = this->getFieldValue(fieldTextLineHeight);
static const auto fieldPrefixFontSize = clazz->getField("prefixFontSize");
double prefixFontSize = this->getFieldValue(fieldPrefixFontSize);
static const auto fieldSuffixFontSize = clazz->getField("suffixFontSize");
double suffixFontSize = this->getFieldValue(fieldSuffixFontSize);
- static const auto fieldFontWeight = clazz->getField("fontWeight");
- double fontWeight = this->getFieldValue(fieldFontWeight);
- static const auto fieldFontFamily = clazz->getField("fontFamily");
- jni::local_ref fontFamily = this->getFieldValue(fieldFontFamily);
- static const auto fieldLetterSpacing = clazz->getField("letterSpacing");
- double letterSpacing = this->getFieldValue(fieldLetterSpacing);
+ static const auto fieldTextWeight = clazz->getField("textWeight");
+ double textWeight = this->getFieldValue(fieldTextWeight);
+ static const auto fieldTextFamily = clazz->getField("textFamily");
+ jni::local_ref textFamily = this->getFieldValue(fieldTextFamily);
+ static const auto fieldTextLetterSpacing = clazz->getField("textLetterSpacing");
+ double textLetterSpacing = this->getFieldValue(fieldTextLetterSpacing);
static const auto fieldPrefixSpacing = clazz->getField("prefixSpacing");
double prefixSpacing = this->getFieldValue(fieldPrefixSpacing);
static const auto fieldSuffixSpacing = clazz->getField("suffixSpacing");
@@ -180,13 +180,13 @@ namespace margelo::nitro::nitroinput {
}(maskCharacterMap),
maskSlotPlaceholder->toStdString(),
static_cast(keepPlaceholder),
- fontSize,
- lineHeight,
+ textSize,
+ textLineHeight,
prefixFontSize,
suffixFontSize,
- fontWeight,
- fontFamily->toStdString(),
- letterSpacing,
+ textWeight,
+ textFamily->toStdString(),
+ textLetterSpacing,
prefixSpacing,
suffixSpacing,
static_cast(allowFontScaling),
@@ -261,13 +261,13 @@ namespace margelo::nitro::nitroinput {
}(value.maskCharacterMap),
jni::make_jstring(value.maskSlotPlaceholder),
value.keepPlaceholder,
- value.fontSize,
- value.lineHeight,
+ value.textSize,
+ value.textLineHeight,
value.prefixFontSize,
value.suffixFontSize,
- value.fontWeight,
- jni::make_jstring(value.fontFamily),
- value.letterSpacing,
+ value.textWeight,
+ jni::make_jstring(value.textFamily),
+ value.textLetterSpacing,
value.prefixSpacing,
value.suffixSpacing,
value.allowFontScaling,
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp
index 02c692c..c963ef6 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp
@@ -234,9 +234,9 @@ void JHybridNitroInputViewStateUpdater::updateViewProps(jni::alias_refsetSuffixAlign(newProps->suffixAlign.get());
}
if (oldProps == nullptr
- ? newProps->letterSpacing.isProvided()
- : !newProps->letterSpacing.hasSameValue(oldProps->letterSpacing)) {
- hybridView->setLetterSpacing(newProps->letterSpacing.get());
+ ? newProps->textLetterSpacing.isProvided()
+ : !newProps->textLetterSpacing.hasSameValue(oldProps->textLetterSpacing)) {
+ hybridView->setTextLetterSpacing(newProps->textLetterSpacing.get());
}
if (oldProps == nullptr
? newProps->prefixSpacing.isProvided()
@@ -289,34 +289,34 @@ void JHybridNitroInputViewStateUpdater::updateViewProps(jni::alias_refsetEffect(newProps->effect.get());
}
if (oldProps == nullptr
- ? newProps->fontSize.isProvided()
- : !newProps->fontSize.hasSameValue(oldProps->fontSize)) {
- hybridView->setFontSize(newProps->fontSize.get());
+ ? newProps->textSize.isProvided()
+ : !newProps->textSize.hasSameValue(oldProps->textSize)) {
+ hybridView->setTextSize(newProps->textSize.get());
}
if (oldProps == nullptr
- ? newProps->lineHeight.isProvided()
- : !newProps->lineHeight.hasSameValue(oldProps->lineHeight)) {
- hybridView->setLineHeight(newProps->lineHeight.get());
+ ? newProps->textLineHeight.isProvided()
+ : !newProps->textLineHeight.hasSameValue(oldProps->textLineHeight)) {
+ hybridView->setTextLineHeight(newProps->textLineHeight.get());
}
if (oldProps == nullptr
- ? newProps->fontWeight.isProvided()
- : !newProps->fontWeight.hasSameValue(oldProps->fontWeight)) {
- hybridView->setFontWeight(newProps->fontWeight.get());
+ ? newProps->textWeight.isProvided()
+ : !newProps->textWeight.hasSameValue(oldProps->textWeight)) {
+ hybridView->setTextWeight(newProps->textWeight.get());
}
if (oldProps == nullptr
- ? newProps->fontFamily.isProvided()
- : !newProps->fontFamily.hasSameValue(oldProps->fontFamily)) {
- hybridView->setFontFamily(newProps->fontFamily.get());
+ ? newProps->textFamily.isProvided()
+ : !newProps->textFamily.hasSameValue(oldProps->textFamily)) {
+ hybridView->setTextFamily(newProps->textFamily.get());
}
if (oldProps == nullptr
- ? newProps->color.isProvided()
- : !newProps->color.hasSameValue(oldProps->color)) {
- hybridView->setColor(newProps->color.get());
+ ? newProps->textColor.isProvided()
+ : !newProps->textColor.hasSameValue(oldProps->textColor)) {
+ hybridView->setTextColor(newProps->textColor.get());
}
if (oldProps == nullptr
- ? newProps->textAlign.isProvided()
- : !newProps->textAlign.hasSameValue(oldProps->textAlign)) {
- hybridView->setTextAlign(newProps->textAlign.get());
+ ? newProps->textAlignment.isProvided()
+ : !newProps->textAlignment.hasSameValue(oldProps->textAlignment)) {
+ hybridView->setTextAlignment(newProps->textAlignment.get());
}
if (oldProps == nullptr
? newProps->rightToLeft.isProvided()
@@ -394,9 +394,29 @@ void JHybridNitroInputViewStateUpdater::updateViewProps(jni::alias_refsetNumberOfLines(newProps->numberOfLines.get());
}
if (oldProps == nullptr
- ? newProps->textAlignVertical.isProvided()
- : !newProps->textAlignVertical.hasSameValue(oldProps->textAlignVertical)) {
- hybridView->setTextAlignVertical(newProps->textAlignVertical.get());
+ ? newProps->textVerticalAlignment.isProvided()
+ : !newProps->textVerticalAlignment.hasSameValue(oldProps->textVerticalAlignment)) {
+ hybridView->setTextVerticalAlignment(newProps->textVerticalAlignment.get());
+ }
+ if (oldProps == nullptr
+ ? newProps->textInsetLeft.isProvided()
+ : !newProps->textInsetLeft.hasSameValue(oldProps->textInsetLeft)) {
+ hybridView->setTextInsetLeft(newProps->textInsetLeft.get());
+ }
+ if (oldProps == nullptr
+ ? newProps->textInsetTop.isProvided()
+ : !newProps->textInsetTop.hasSameValue(oldProps->textInsetTop)) {
+ hybridView->setTextInsetTop(newProps->textInsetTop.get());
+ }
+ if (oldProps == nullptr
+ ? newProps->textInsetRight.isProvided()
+ : !newProps->textInsetRight.hasSameValue(oldProps->textInsetRight)) {
+ hybridView->setTextInsetRight(newProps->textInsetRight.get());
+ }
+ if (oldProps == nullptr
+ ? newProps->textInsetBottom.isProvided()
+ : !newProps->textInsetBottom.hasSameValue(oldProps->textInsetBottom)) {
+ hybridView->setTextInsetBottom(newProps->textInsetBottom.get());
}
if (oldProps == nullptr
? newProps->scrollEnabled.isProvided()
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp
index 2ad796e..6a778d4 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp
@@ -219,9 +219,9 @@ void JHybridNitroNumberViewStateUpdater::updateViewProps(jni::alias_refsetShimmerDelay(newProps->shimmerDelay.get());
}
if (oldProps == nullptr
- ? newProps->fontSize.isProvided()
- : !newProps->fontSize.hasSameValue(oldProps->fontSize)) {
- hybridView->setFontSize(newProps->fontSize.get());
+ ? newProps->textSize.isProvided()
+ : !newProps->textSize.hasSameValue(oldProps->textSize)) {
+ hybridView->setTextSize(newProps->textSize.get());
}
if (oldProps == nullptr
? newProps->prefixFontSize.isProvided()
@@ -249,9 +249,9 @@ void JHybridNitroNumberViewStateUpdater::updateViewProps(jni::alias_refsetSuffixAlign(newProps->suffixAlign.get());
}
if (oldProps == nullptr
- ? newProps->letterSpacing.isProvided()
- : !newProps->letterSpacing.hasSameValue(oldProps->letterSpacing)) {
- hybridView->setLetterSpacing(newProps->letterSpacing.get());
+ ? newProps->textLetterSpacing.isProvided()
+ : !newProps->textLetterSpacing.hasSameValue(oldProps->textLetterSpacing)) {
+ hybridView->setTextLetterSpacing(newProps->textLetterSpacing.get());
}
if (oldProps == nullptr
? newProps->prefixSpacing.isProvided()
@@ -364,24 +364,24 @@ void JHybridNitroNumberViewStateUpdater::updateViewProps(jni::alias_refsetMaxFontSizeMultiplier(newProps->maxFontSizeMultiplier.get());
}
if (oldProps == nullptr
- ? newProps->fontWeight.isProvided()
- : !newProps->fontWeight.hasSameValue(oldProps->fontWeight)) {
- hybridView->setFontWeight(newProps->fontWeight.get());
+ ? newProps->textWeight.isProvided()
+ : !newProps->textWeight.hasSameValue(oldProps->textWeight)) {
+ hybridView->setTextWeight(newProps->textWeight.get());
}
if (oldProps == nullptr
- ? newProps->fontFamily.isProvided()
- : !newProps->fontFamily.hasSameValue(oldProps->fontFamily)) {
- hybridView->setFontFamily(newProps->fontFamily.get());
+ ? newProps->textFamily.isProvided()
+ : !newProps->textFamily.hasSameValue(oldProps->textFamily)) {
+ hybridView->setTextFamily(newProps->textFamily.get());
}
if (oldProps == nullptr
- ? newProps->color.isProvided()
- : !newProps->color.hasSameValue(oldProps->color)) {
- hybridView->setColor(newProps->color.get());
+ ? newProps->textColor.isProvided()
+ : !newProps->textColor.hasSameValue(oldProps->textColor)) {
+ hybridView->setTextColor(newProps->textColor.get());
}
if (oldProps == nullptr
- ? newProps->textAlign.isProvided()
- : !newProps->textAlign.hasSameValue(oldProps->textAlign)) {
- hybridView->setTextAlign(newProps->textAlign.get());
+ ? newProps->textAlignment.isProvided()
+ : !newProps->textAlignment.hasSameValue(oldProps->textAlignment)) {
+ hybridView->setTextAlignment(newProps->textAlignment.get());
}
if (oldProps == nullptr
? newProps->rightToLeft.isProvided()
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp
index afe0aa1..575d5e5 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp
@@ -59,34 +59,34 @@ void JHybridNitroTextViewStateUpdater::updateViewProps(jni::alias_refsetText(newProps->text.get());
}
if (oldProps == nullptr
- ? newProps->fontSize.isProvided()
- : !newProps->fontSize.hasSameValue(oldProps->fontSize)) {
- hybridView->setFontSize(newProps->fontSize.get());
+ ? newProps->textSize.isProvided()
+ : !newProps->textSize.hasSameValue(oldProps->textSize)) {
+ hybridView->setTextSize(newProps->textSize.get());
}
if (oldProps == nullptr
- ? newProps->fontWeight.isProvided()
- : !newProps->fontWeight.hasSameValue(oldProps->fontWeight)) {
- hybridView->setFontWeight(newProps->fontWeight.get());
+ ? newProps->textWeight.isProvided()
+ : !newProps->textWeight.hasSameValue(oldProps->textWeight)) {
+ hybridView->setTextWeight(newProps->textWeight.get());
}
if (oldProps == nullptr
- ? newProps->fontFamily.isProvided()
- : !newProps->fontFamily.hasSameValue(oldProps->fontFamily)) {
- hybridView->setFontFamily(newProps->fontFamily.get());
+ ? newProps->textFamily.isProvided()
+ : !newProps->textFamily.hasSameValue(oldProps->textFamily)) {
+ hybridView->setTextFamily(newProps->textFamily.get());
}
if (oldProps == nullptr
- ? newProps->color.isProvided()
- : !newProps->color.hasSameValue(oldProps->color)) {
- hybridView->setColor(newProps->color.get());
+ ? newProps->textColor.isProvided()
+ : !newProps->textColor.hasSameValue(oldProps->textColor)) {
+ hybridView->setTextColor(newProps->textColor.get());
}
if (oldProps == nullptr
- ? newProps->letterSpacing.isProvided()
- : !newProps->letterSpacing.hasSameValue(oldProps->letterSpacing)) {
- hybridView->setLetterSpacing(newProps->letterSpacing.get());
+ ? newProps->textLetterSpacing.isProvided()
+ : !newProps->textLetterSpacing.hasSameValue(oldProps->textLetterSpacing)) {
+ hybridView->setTextLetterSpacing(newProps->textLetterSpacing.get());
}
if (oldProps == nullptr
- ? newProps->textAlign.isProvided()
- : !newProps->textAlign.hasSameValue(oldProps->textAlign)) {
- hybridView->setTextAlign(newProps->textAlign.get());
+ ? newProps->textAlignment.isProvided()
+ : !newProps->textAlignment.hasSameValue(oldProps->textAlignment)) {
+ hybridView->setTextAlignment(newProps->textAlignment.get());
}
if (oldProps == nullptr
? newProps->rightToLeft.isProvided()
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt
index c4da6d3..da3d0c3 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt
@@ -247,7 +247,7 @@ abstract class HybridNitroInputViewSpec: HybridView() {
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var letterSpacing: Double
+ abstract var textLetterSpacing: Double
@get:DoNotStrip
@get:Keep
@@ -313,37 +313,37 @@ abstract class HybridNitroInputViewSpec: HybridView() {
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var fontSize: Double
+ abstract var textSize: Double
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var lineHeight: Double
+ abstract var textLineHeight: Double
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var fontWeight: Double
+ abstract var textWeight: Double
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var fontFamily: String
+ abstract var textFamily: String
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var color: Double
+ abstract var textColor: Double
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var textAlign: NitroInputTextAlign
+ abstract var textAlignment: NitroInputTextAlign
@get:DoNotStrip
@get:Keep
@@ -439,7 +439,31 @@ abstract class HybridNitroInputViewSpec: HybridView() {
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var textAlignVertical: NitroInputTextAlignVertical
+ abstract var textVerticalAlignment: NitroInputTextAlignVertical
+
+ @get:DoNotStrip
+ @get:Keep
+ @set:DoNotStrip
+ @set:Keep
+ abstract var textInsetLeft: Double
+
+ @get:DoNotStrip
+ @get:Keep
+ @set:DoNotStrip
+ @set:Keep
+ abstract var textInsetTop: Double
+
+ @get:DoNotStrip
+ @get:Keep
+ @set:DoNotStrip
+ @set:Keep
+ abstract var textInsetRight: Double
+
+ @get:DoNotStrip
+ @get:Keep
+ @set:DoNotStrip
+ @set:Keep
+ abstract var textInsetBottom: Double
@get:DoNotStrip
@get:Keep
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt
index 54f6c4d..2ca4bb5 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt
@@ -229,7 +229,7 @@ abstract class HybridNitroNumberViewSpec: HybridView() {
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var fontSize: Double?
+ abstract var textSize: Double?
@get:DoNotStrip
@get:Keep
@@ -265,7 +265,7 @@ abstract class HybridNitroNumberViewSpec: HybridView() {
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var letterSpacing: Double?
+ abstract var textLetterSpacing: Double?
@get:DoNotStrip
@get:Keep
@@ -403,25 +403,25 @@ abstract class HybridNitroNumberViewSpec: HybridView() {
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var fontWeight: Double?
+ abstract var textWeight: Double?
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var fontFamily: String?
+ abstract var textFamily: String?
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var color: Double?
+ abstract var textColor: Double?
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var textAlign: NitroNumberTextAlign?
+ abstract var textAlignment: NitroNumberTextAlign?
@get:DoNotStrip
@get:Keep
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt
index a17a20b..5f13490 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt
@@ -37,37 +37,37 @@ abstract class HybridNitroTextViewSpec: HybridView() {
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var fontSize: Double?
+ abstract var textSize: Double?
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var fontWeight: Double?
+ abstract var textWeight: Double?
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var fontFamily: String?
+ abstract var textFamily: String?
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var color: Double?
+ abstract var textColor: Double?
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var letterSpacing: Double?
+ abstract var textLetterSpacing: Double?
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
- abstract var textAlign: NitroNumberTextAlign?
+ abstract var textAlignment: NitroNumberTextAlign?
@get:DoNotStrip
@get:Keep
diff --git a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSizing.kt b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSizing.kt
index 5dc49ad..1cfe3d1 100644
--- a/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSizing.kt
+++ b/packages/react-native-nitro-input/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroInputSizing.kt
@@ -92,10 +92,10 @@ data class NitroInputSizing(
val keepPlaceholder: Boolean,
@DoNotStrip
@Keep
- val fontSize: Double,
+ val textSize: Double,
@DoNotStrip
@Keep
- val lineHeight: Double,
+ val textLineHeight: Double,
@DoNotStrip
@Keep
val prefixFontSize: Double,
@@ -104,13 +104,13 @@ data class NitroInputSizing(
val suffixFontSize: Double,
@DoNotStrip
@Keep
- val fontWeight: Double,
+ val textWeight: Double,
@DoNotStrip
@Keep
- val fontFamily: String,
+ val textFamily: String,
@DoNotStrip
@Keep
- val letterSpacing: Double,
+ val textLetterSpacing: Double,
@DoNotStrip
@Keep
val prefixSpacing: Double,
@@ -168,13 +168,13 @@ data class NitroInputSizing(
&& Objects.deepEquals(this.maskCharacterMap, other.maskCharacterMap)
&& Objects.deepEquals(this.maskSlotPlaceholder, other.maskSlotPlaceholder)
&& Objects.deepEquals(this.keepPlaceholder, other.keepPlaceholder)
- && Objects.deepEquals(this.fontSize, other.fontSize)
- && Objects.deepEquals(this.lineHeight, other.lineHeight)
+ && Objects.deepEquals(this.textSize, other.textSize)
+ && Objects.deepEquals(this.textLineHeight, other.textLineHeight)
&& Objects.deepEquals(this.prefixFontSize, other.prefixFontSize)
&& Objects.deepEquals(this.suffixFontSize, other.suffixFontSize)
- && Objects.deepEquals(this.fontWeight, other.fontWeight)
- && Objects.deepEquals(this.fontFamily, other.fontFamily)
- && Objects.deepEquals(this.letterSpacing, other.letterSpacing)
+ && Objects.deepEquals(this.textWeight, other.textWeight)
+ && Objects.deepEquals(this.textFamily, other.textFamily)
+ && Objects.deepEquals(this.textLetterSpacing, other.textLetterSpacing)
&& Objects.deepEquals(this.prefixSpacing, other.prefixSpacing)
&& Objects.deepEquals(this.suffixSpacing, other.suffixSpacing)
&& Objects.deepEquals(this.allowFontScaling, other.allowFontScaling)
@@ -212,13 +212,13 @@ data class NitroInputSizing(
maskCharacterMap,
maskSlotPlaceholder,
keepPlaceholder,
- fontSize,
- lineHeight,
+ textSize,
+ textLineHeight,
prefixFontSize,
suffixFontSize,
- fontWeight,
- fontFamily,
- letterSpacing,
+ textWeight,
+ textFamily,
+ textLetterSpacing,
prefixSpacing,
suffixSpacing,
allowFontScaling,
@@ -239,8 +239,8 @@ data class NitroInputSizing(
@Keep
@Suppress("unused")
@JvmStatic
- private fun fromCpp(text: String, mode: NitroInputMode, plain: Boolean, multiline: Boolean, secureTextEntry: Boolean, maxLength: Double, fractionDigits: Double, maxIntegerDigits: Double, groupingSeparator: String, decimalSeparator: String, prefix: String, suffix: String, signPlacement: NitroInputSignPlacement, placeholder: String, mask: String, maskNotations: Array, maskAutocomplete: Boolean, maskAutoSkip: Boolean, maskAffinityFormats: Array, maskAffinityStrategy: NitroInputMaskAffinity, maskTextCase: NitroInputTextCase, maskCharacterMap: Array, maskSlotPlaceholder: String, keepPlaceholder: Boolean, fontSize: Double, lineHeight: Double, prefixFontSize: Double, suffixFontSize: Double, fontWeight: Double, fontFamily: String, letterSpacing: Double, prefixSpacing: Double, suffixSpacing: Double, allowFontScaling: Boolean, maxFontSizeMultiplier: Double, variant: NitroInputVariant, label: String, labelBehavior: NitroInputLabelBehavior, labelFontSize: Double, cornerRadius: Double): NitroInputSizing {
- return NitroInputSizing(text, mode, plain, multiline, secureTextEntry, maxLength, fractionDigits, maxIntegerDigits, groupingSeparator, decimalSeparator, prefix, suffix, signPlacement, placeholder, mask, maskNotations, maskAutocomplete, maskAutoSkip, maskAffinityFormats, maskAffinityStrategy, maskTextCase, maskCharacterMap, maskSlotPlaceholder, keepPlaceholder, fontSize, lineHeight, prefixFontSize, suffixFontSize, fontWeight, fontFamily, letterSpacing, prefixSpacing, suffixSpacing, allowFontScaling, maxFontSizeMultiplier, variant, label, labelBehavior, labelFontSize, cornerRadius)
+ private fun fromCpp(text: String, mode: NitroInputMode, plain: Boolean, multiline: Boolean, secureTextEntry: Boolean, maxLength: Double, fractionDigits: Double, maxIntegerDigits: Double, groupingSeparator: String, decimalSeparator: String, prefix: String, suffix: String, signPlacement: NitroInputSignPlacement, placeholder: String, mask: String, maskNotations: Array, maskAutocomplete: Boolean, maskAutoSkip: Boolean, maskAffinityFormats: Array