Slide 38
Slide 38 text
TextFieldBuffer
aka “StringBuilder with selection”
class TextFieldBuffer: CharSequence, Appendable {
val length: Int
var 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)
// lots more to come…
}