Added in API level 1

Spannable


interface Spannable : Spanned
android.text.Spannable

This is the interface for text to which markup objects can be attached and detached. Not all Spannable classes have mutable text; see Editable for that.

Summary

Nested classes
open

Factory used by TextView to create new Spannables.

Inherited constants
Public methods
abstract Unit
removeSpan(what: Any!)

Remove the specified object from the range of text to which it was attached, if any.

abstract Unit
setSpan(what: Any!, start: Int, end: Int, flags: Int)

Attach the specified markup object to the range start…end of the text, or move the object to that range if it was already attached elsewhere.

Inherited functions

Public methods

removeSpan

Added in API level 1
abstract fun removeSpan(what: Any!): Unit

Remove the specified object from the range of text to which it was attached, if any. It is OK to remove an object that was never attached in the first place.

setSpan

Added in API level 1
abstract fun setSpan(
    what: Any!,
    start: Int,
    end: Int,
    flags: Int
): Unit

Attach the specified markup object to the range start…end of the text, or move the object to that range if it was already attached elsewhere. See Spanned for an explanation of what the flags mean. The object can be one that has meaning only within your application, or it can be one that the text system will use to affect text display or behavior. Some noteworthy ones are the subclasses of android.text.style.CharacterStyle and android.text.style.ParagraphStyle, and android.text.TextWatcher and android.text.SpanWatcher.