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>
ScaleXSpan
.
Summary
Public constructors | |
---|---|
ScaleXSpan(src: Parcel) Creates a |
|
ScaleXSpan(proportion: Float) Creates a |
Public methods | |
---|---|
open Int | |
open Float |
Get the horizontal scale factor for the text. |
open Int | |
open String |
toString() |
open Unit |
updateDrawState(ds: TextPaint!) |
open Unit | |
open Unit |
writeToParcel(dest: Parcel, flags: Int) Flatten this object in to a Parcel. |
Inherited functions | |
---|---|
Public constructors
ScaleXSpan
ScaleXSpan(src: Parcel)
Creates a ScaleXSpan
from a parcel.
Parameters | |
---|---|
src |
Parcel: This value cannot be null . |
ScaleXSpan
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 |
Public methods
describeContents
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
open fun getScaleX(): Float
Get the horizontal scale factor for the text.
Return | |
---|---|
Float |
the horizontal scale factor. |
toString
open fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
updateMeasureState
open fun updateMeasureState(ds: TextPaint): Unit
Parameters | |
---|---|
textPaint |
the paint used for drawing the text This value cannot be null . |
writeToParcel
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 |