Added in API level 1

MetricAffectingSpan


abstract class MetricAffectingSpan : CharacterStyle, UpdateLayout
AbsoluteSizeSpan

A span that changes the size of the text it's attached to.

LocaleSpan

Changes the Locale of the text to which the span is attached.

RelativeSizeSpan

Uniformly scales the size of the text to which it's attached by a certain proportion.

ReplacementSpan

ScaleXSpan

Scales horizontally the size of the text to which it's attached by a certain factor.

StyleSpan

Span that allows setting the style of the text it's attached to.

SubscriptSpan

The span that moves the position of the text baseline lower.

SuperscriptSpan

The span that moves the position of the text baseline higher.

TextAppearanceSpan

Sets the text appearance using the given TextAppearance attributes.

TypefaceSpan

Span that updates the typeface of the text it's attached to.

DynamicDrawableSpan

Span that replaces the text it's attached to with a Drawable that can be aligned with the bottom or with the baseline of the surrounding text.

ImageSpan

Span that replaces the text it's attached to with a Drawable that can be aligned with the bottom or with the baseline of the surrounding text.

The classes that affect character-level text formatting in a way that changes the width or height of characters extend this class.

Summary

Public constructors

Public methods
open MetricAffectingSpan!

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

abstract Unit

Classes that extend MetricAffectingSpan implement this method to update the text formatting in a way that can change the width or height of characters.

Inherited functions
Unit updateDrawState(tp: TextPaint!)

CharacterStyle! wrap(cs: 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.

Public constructors

MetricAffectingSpan

MetricAffectingSpan()

Public methods

getUnderlying

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

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

updateMeasureState

Added in API level 1
abstract fun updateMeasureState(textPaint: TextPaint): Unit

Classes that extend MetricAffectingSpan implement this method to update the text formatting in a way that can change the width or height of characters.

Parameters
textPaint TextPaint: the paint used for drawing the text This value cannot be null.