Sergey Y.
02/20/2024, 10:22 PMBasicTextField2
API question.
Is InlineTextContent
can be alternative to ReplacementSpan
?
Details in the thread 🧵Sergey Y.
02/20/2024, 10:23 PMBefore ReplacementSpan:
"text"
After ReplacementSpan:
[ ][ ][ ][ ] <- Each rectangle represents a character's width
We're trying to shift to BasicTextField2 but can't figure out how to replicate the character replacement with specific widths like we did with ReplacementSpan. Any tips or guidance on achieving this with BasicTextField2?
Something somewhat similar I can get from the onTextLayout callback, within textLayoutResult, called placeholderRects: ListRect, but this is opposite to what I need. I'm looking to set such already calculated rect placeholders to the BasicTextField2, not just read them.
onTextLayout = {
val textLayoutResult: TextLayoutResult? = it()
val placeholderRects: List<Rect?>? = textLayoutResult?.placeholderRects
}
Sergey Y.
02/20/2024, 10:23 PMSergey Y.
02/20/2024, 10:33 PMcodepointTransformation
and outputTransformation
features within BasicTextField2.
However, upon closer inspection, these APIs don't seem to provide the level of control over text layouting that ReplacementSpan offered in the traditional EditText setup. Specifically, they don't appear to allow for the detailed manipulation of the text layout process to override necessary parameters for our custom text shaping and rendering needs.Sergey Y.
02/20/2024, 10:42 PMSergey Y.
02/21/2024, 12:01 PMSergey Y.
02/21/2024, 12:03 PM