Added in API level 1

CharacterStyle


abstract class CharacterStyle
kotlin.Any
   ↳ android.text.style.CharacterStyle

The classes that affect character-level text formatting extend this class. Most extend its subclass MetricAffectingSpan, but simple ones may just implement UpdateAppearance.

Summary

Public constructors

Public methods
open CharacterStyle!

Returns "this" for most CharacterStyles, but for CharacterStyles that were generated by wrap, returns the underlying CharacterStyle.

abstract Unit

open static CharacterStyle!

A given CharacterStyle can only applied to a single region of a given Spanned.

Public constructors

CharacterStyle

CharacterStyle()

Public methods

getUnderlying

Added in API level 1
open fun getUnderlying(): CharacterStyle!

Returns "this" for most CharacterStyles, but for CharacterStyles that were generated by wrap, returns the underlying CharacterStyle.

updateDrawState

Added in API level 1
abstract fun updateDrawState(tp: TextPaint!): Unit

wrap

Added in API level 1
open static fun wrap(cs: CharacterStyle!): CharacterStyle!

A given CharacterStyle can only applied to a single region of a given Spanned. If you need to attach the same CharacterStyle to multiple regions, you can use this method to wrap it with a new object that will have the same effect but be a distinct object so that it can also be attached without conflict.