The Compose Text team is completely rethinking the text field APIs from scratch. Come learn why, how we're approaching the process, and get a sneak peak at what the future might look like.
length: Int val selection: TextRange fun append(text: CharSequence?) fun replace(start: Int, end: Int, text: CharSequence) fun insert(index: Int, text: CharSequence) fun delete(start: Int, end: Int) fun replace(regex: Regex, text: CharSequence) fun setSelection(range: TextRange) fun placeCursorBeforeCharAt(offset: Int) // lots more to come… }
TransformedText } class TransformedText( val text: AnnotatedString, val offsetMapping: OffsetMapping ) interface OffsetMapping { fun originalToTransformed(offset: Int): Int fun transformedToOriginal(offset: Int): Int }