Standard
open class Standard : LeadingMarginSpan, ParcelableSpan
| kotlin.Any | |
| ↳ | android.text.style.LeadingMarginSpan.Standard |
The standard implementation of LeadingMarginSpan, which adjusts the margin but does not do any rendering.
Summary
| Public constructors | |
|---|---|
|
Constructor taking an indent for all lines. |
|
|
Constructor taking separate indents for the first and subsequent lines. |
|
| Public methods | |
|---|---|
| open Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| open Unit |
drawLeadingMargin(c: Canvas!, p: Paint!, x: Int, dir: Int, top: Int, baseline: Int, bottom: Int, text: CharSequence!, start: Int, end: Int, first: Boolean, layout: Layout!)Renders the leading margin. |
| open Int |
getLeadingMargin(first: Boolean)Returns the amount by which to adjust the leading margin. |
| open Int |
Return a special type identifier for this span class. |
| open Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
Public constructors
Standard
Standard(every: Int)
Constructor taking an indent for all lines.
| Parameters | |
|---|---|
every |
Int: the indent of each line |
Standard
Standard(
first: Int,
rest: Int)
Constructor taking separate indents for the first and subsequent lines.
| Parameters | |
|---|---|
first |
Int: the indent for the first line of the paragraph |
rest |
Int: the indent for the remaining lines of the paragraph |
Public methods
describeContents
open fun describeContents(): Int
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
drawLeadingMargin
open fun drawLeadingMargin(
c: Canvas!,
p: Paint!,
x: Int,
dir: Int,
top: Int,
baseline: Int,
bottom: Int,
text: CharSequence!,
start: Int,
end: Int,
first: Boolean,
layout: Layout!
): Unit
Renders the leading margin. This is called before the margin has been adjusted by the value returned by getLeadingMargin(boolean).
| Parameters | |
|---|---|
c |
Canvas!: the canvas |
p |
Paint!: the paint. The this should be left unchanged on exit. |
x |
Int: the current position of the margin |
dir |
Int: the base direction of the paragraph; if negative, the margin is to the right of the text, otherwise it is to the left. |
top |
Int: the top of the line |
baseline |
Int: the baseline of the line |
bottom |
Int: the bottom of the line |
text |
CharSequence!: the text |
start |
Int: the start of the line |
end |
Int: the end of the line |
first |
Boolean: true if this is the first line of its paragraph |
layout |
Layout!: the layout containing this line |
getLeadingMargin
open fun getLeadingMargin(first: Boolean): Int
Returns the amount by which to adjust the leading margin. Positive values move away from the leading edge of the paragraph, negative values move towards it.
| Parameters | |
|---|---|
first |
Boolean: true if the request is for the first line of a paragraph, false for subsequent lines |
| Return | |
|---|---|
Int |
the offset for the margin. |
getSpanTypeId
open fun getSpanTypeId(): Int
Return a special type identifier for this span class.
writeToParcel
open fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. 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 the following:
|