Stay organized with collections
Save and categorize content based on your preferences.
LeadingMarginSpan.LeadingMarginSpan2
public
static
interface
LeadingMarginSpan.LeadingMarginSpan2
implements
LeadingMarginSpan,
WrapTogetherSpan
android.text.style.LeadingMarginSpan.LeadingMarginSpan2
|
An extended version of LeadingMarginSpan
, which allows the
implementor to specify the number of lines of the paragraph to which
this object is attached that the "first line of paragraph" margin width
will be applied to.
There should only be one LeadingMarginSpan2 per paragraph. The leading
margin line count affects all LeadingMarginSpans in the paragraph,
adjusting the number of lines to which the first line margin is applied.
As with LeadingMarginSpans, LeadingMarginSpan2s should be attached from
the beginning to the end of a paragraph.
Summary
Public methods |
abstract
int
|
getLeadingMarginLineCount()
Returns the number of lines of the paragraph to which this object is
attached that the "first line" margin will apply to.
|
Inherited methods |
From interface
android.text.style.LeadingMarginSpan
abstract
void
|
drawLeadingMargin(Canvas c, Paint p, int x, int dir, int top, int baseline, int bottom, CharSequence text, int start, int end, boolean first, Layout layout)
Renders the leading margin.
|
abstract
int
|
getLeadingMargin(boolean first)
Returns the amount by which to adjust the leading margin.
|
|
Public methods
getLeadingMarginLineCount
public abstract int getLeadingMarginLineCount ()
Returns the number of lines of the paragraph to which this object is
attached that the "first line" margin will apply to.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# LeadingMarginSpan.LeadingMarginSpan2\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nLeadingMarginSpan.LeadingMarginSpan2\n====================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/text/style/LeadingMarginSpan.LeadingMarginSpan2 \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nLeadingMarginSpan.LeadingMarginSpan2\n`\n\n\n`\n\n\nimplements\n\n`[LeadingMarginSpan](/reference/android/text/style/LeadingMarginSpan)`,\n\n`[WrapTogetherSpan](/reference/android/text/style/WrapTogetherSpan)`\n\n\n`\n\n|---------------------------------------------------------|\n| android.text.style.LeadingMarginSpan.LeadingMarginSpan2 |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAn extended version of [LeadingMarginSpan](/reference/android/text/style/LeadingMarginSpan), which allows the\nimplementor to specify the number of lines of the paragraph to which\nthis object is attached that the \"first line of paragraph\" margin width\nwill be applied to.\n\n\nThere should only be one LeadingMarginSpan2 per paragraph. The leading\nmargin line count affects all LeadingMarginSpans in the paragraph,\nadjusting the number of lines to which the first line margin is applied.\n\n\nAs with LeadingMarginSpans, LeadingMarginSpan2s should be attached from\nthe beginning to the end of a paragraph.\n\nSummary\n-------\n\n| ### Public methods ||\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract int` | ` `[getLeadingMarginLineCount](/reference/android/text/style/LeadingMarginSpan.LeadingMarginSpan2#getLeadingMarginLineCount())`() ` Returns the number of lines of the paragraph to which this object is attached that the \"first line\" margin will apply to. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[android.text.style.LeadingMarginSpan](/reference/android/text/style/LeadingMarginSpan)` ` |------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[drawLeadingMargin](/reference/android/text/style/LeadingMarginSpan#drawLeadingMargin(android.graphics.Canvas,%20android.graphics.Paint,%20int,%20int,%20int,%20int,%20int,%20java.lang.CharSequence,%20int,%20int,%20boolean,%20android.text.Layout))`(`[Canvas](/reference/android/graphics/Canvas)` c, `[Paint](/reference/android/graphics/Paint)` p, int x, int dir, int top, int baseline, int bottom, `[CharSequence](/reference/java/lang/CharSequence)` text, int start, int end, boolean first, `[Layout](/reference/android/text/Layout)` layout) ` Renders the leading margin. | | ` abstract int` | ` `[getLeadingMargin](/reference/android/text/style/LeadingMarginSpan#getLeadingMargin(boolean))`(boolean first) ` Returns the amount by which to adjust the leading margin. | ||\n\nPublic methods\n--------------\n\n### getLeadingMarginLineCount\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getLeadingMarginLineCount ()\n```\n\nReturns the number of lines of the paragraph to which this object is\nattached that the \"first line\" margin will apply to.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |"]]