From 249159ce2b3f1016156cfa180c341c8f4c5cd26d Mon Sep 17 00:00:00 2001 From: Michal Zielinski Date: Thu, 12 Dec 2024 03:42:39 -0800 Subject: [PATCH] Expose ellipsize in Kotlin TextInput wrapper Summary: As per title - TextInputSpec has ellipsize prop but it was never exposed in TextInput kotlin wrapper. Reviewed By: pentiumao Differential Revision: D67130920 fbshipit-source-id: 2eaa6a240234e6bea90f9fdc9e8fec1f3c2f2a8d --- .../main/kotlin/com/facebook/litho/kotlin/widget/TextInput.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/litho-widget-kotlin/src/main/kotlin/com/facebook/litho/kotlin/widget/TextInput.kt b/litho-widget-kotlin/src/main/kotlin/com/facebook/litho/kotlin/widget/TextInput.kt index c38f68565ce..3e729f67550 100644 --- a/litho-widget-kotlin/src/main/kotlin/com/facebook/litho/kotlin/widget/TextInput.kt +++ b/litho-widget-kotlin/src/main/kotlin/com/facebook/litho/kotlin/widget/TextInput.kt @@ -21,6 +21,7 @@ import android.graphics.Color import android.graphics.Typeface import android.graphics.drawable.Drawable import android.text.InputFilter +import android.text.TextUtils.TruncateAt import android.text.TextWatcher import android.view.Gravity import android.view.View @@ -64,6 +65,7 @@ inline fun ResourcesScope.TextInput( imeOptions: Int = EditorInfo.IME_NULL, inputFilter: InputFilter? = null, inputFilters: List? = null, + ellipsize: TruncateAt? = null, /** Called when the text entered by the user changes. */ noinline onTextChanged: ((TextChangedEvent) -> Unit)? = null, /** Called when the selection (particular case: cursor position) gets changed by user. */ @@ -114,5 +116,6 @@ inline fun ResourcesScope.TextInput( onKeyPreIme?.let { keyPreImeEventHandler(eventHandlerWithReturn(it)) } onEditorAction?.let { editorActionEventHandler(eventHandlerWithReturn(it)) } onInputConnection?.let { inputConnectionEventHandler(eventHandlerWithReturn(it)) } + ellipsize?.let { ellipsize(it) } } .build()