diff --git a/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt b/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt index a4720a461327..0febf21eedd0 100644 --- a/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt +++ b/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt @@ -12,6 +12,7 @@ import android.text.Editable import android.text.InputType import android.text.InputFilter import android.text.Spanned +import android.text.TextUtils import android.text.TextWatcher import android.text.style.ReplacementSpan import android.util.TypedValue @@ -281,10 +282,17 @@ class T3ComposerEditorView(context: Context, appContext: AppContext) : ExpoView( } fun setSingleLineCentered(centered: Boolean) { - editor.gravity = if (centered) { - Gravity.CENTER_VERTICAL or Gravity.START + if (centered) { + editor.isSingleLine = true + editor.maxLines = 1 + editor.ellipsize = TextUtils.TruncateAt.END + editor.gravity = Gravity.CENTER_VERTICAL or Gravity.START } else { - Gravity.TOP or Gravity.START + editor.isSingleLine = false + editor.maxLines = Int.MAX_VALUE + editor.ellipsize = null + editor.gravity = Gravity.TOP or Gravity.START + updateInputFlags() } } diff --git a/apps/mobile/src/features/threads/ThreadComposer.tsx b/apps/mobile/src/features/threads/ThreadComposer.tsx index 680c9cf0babe..ab0f179aeb66 100644 --- a/apps/mobile/src/features/threads/ThreadComposer.tsx +++ b/apps/mobile/src/features/threads/ThreadComposer.tsx @@ -828,8 +828,8 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer onBlur={handleBlur} onSubmit={handleSend} scrollEnabled={isExpanded} - // Android: collapsed single line centers natively (gravity) in - // a pill-height box matching the send button; iOS keeps insets. + // Android: collapsed single line centers natively and ellipsizes + // in a pill-height box close to the send button; iOS keeps insets. singleLineCentered={!isExpanded} contentInsetVertical={isExpanded || Platform.OS === "android" ? 0 : 6} style={ @@ -840,7 +840,7 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer paddingVertical: 4, } : { - height: 36, + minHeight: 40, } } textStyle={{