Added in API level 1

ScaleXSpan


open class ScaleXSpan : MetricAffectingSpan, ParcelableSpan
kotlin.Any
   ↳ android.text.style.CharacterStyle
   ↳ android.text.style.MetricAffectingSpan
   ↳ android.text.style.ScaleXSpan

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

Values > 1.0 will stretch the text wider. Values < 1.0 will stretch the text narrower.

For example, a ScaleXSpan that stretches the text size by 100% can be constructed like this:

<code>SpannableString string = new SpannableString("Text with ScaleX span");
 string.setSpan(new ScaleXSpan(2f), 10, 16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);</code>
Text scaled by 100% with ScaleXSpan.

Summary

Public constructors
ScaleXSpan(proportion: Float)

Creates a ScaleXSpan based on a proportion.

Creates a ScaleXSpan from a parcel.

Public methods
open Int

open Float

Get the horizontal scale factor for the text.

open Int

open String

open Unit

open Unit

open Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Inherited functions

Public constructors

ScaleXSpan

Added in API level 1
ScaleXSpan(proportion: Float)

Creates a ScaleXSpan based on a proportion. Values > 1.0 will stretch the text wider. Values < 1.0 will stretch the text narrower.

Parameters
proportion Float: the horizontal scale factor. Value is 0 or greater

ScaleXSpan

Added in API level 3
ScaleXSpan(src: Parcel)

Creates a ScaleXSpan from a parcel.

Parameters
src Parcel: This value cannot be null.

Public methods

describeContents

Added in API level 3
open fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getScaleX

Added in API level 1
open fun getScaleX(): Float

Get the horizontal scale factor for the text.

Return
Float the horizontal scale factor.

getSpanTypeId

Added in API level 3
open fun getSpanTypeId(): Int

toString

Added in API level 1
open fun toString(): String
Return
String a string representation of the object.

updateDrawState

Added in API level 1
open fun updateDrawState(ds: TextPaint!): Unit

updateMeasureState

Added in API level 1
open fun updateMeasureState(ds: TextPaint): Unit
Parameters
textPaint the paint used for drawing the text This value cannot be null.

writeToParcel

Added in API level 3
open fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES