Stay organized with collections
Save and categorize content based on your preferences.
LineHeightSpan.WithDensity
public
static
interface
LineHeightSpan.WithDensity
implements
LineHeightSpan
android.text.style.LineHeightSpan.WithDensity
|
The classes that affect the line height of paragraph with respect to density,
should implement this interface.
Summary
Public methods
chooseHeight
public abstract void chooseHeight (CharSequence text,
int start,
int end,
int spanstartv,
int lineHeight,
Paint.FontMetricsInt fm,
TextPaint paint)
Classes that implement this should define how the height is being calculated.
Parameters |
text |
CharSequence : the text |
start |
int : the start of the line |
end |
int : the end of the line |
spanstartv |
int : the start of the span |
lineHeight |
int : the line height |
fm |
Paint.FontMetricsInt |
paint |
TextPaint : the paint |
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,["# LineHeightSpan.WithDensity\n\nAdded in [API level 5](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nLineHeightSpan.WithDensity\n==========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/text/style/LineHeightSpan.WithDensity \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nLineHeightSpan.WithDensity\n`\n\n\n`\n\n\nimplements\n\n`[LineHeightSpan](/reference/android/text/style/LineHeightSpan)`\n\n\n`\n\n|-----------------------------------------------|\n| android.text.style.LineHeightSpan.WithDensity |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe classes that affect the line height of paragraph with respect to density,\nshould implement this interface.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[chooseHeight](/reference/android/text/style/LineHeightSpan.WithDensity#chooseHeight(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20android.graphics.Paint.FontMetricsInt,%20android.text.TextPaint))`(`[CharSequence](/reference/java/lang/CharSequence)` text, int start, int end, int spanstartv, int lineHeight, `[Paint.FontMetricsInt](/reference/android/graphics/Paint.FontMetricsInt)` fm, `[TextPaint](/reference/android/text/TextPaint)` paint) ` Classes that implement this should define how the height is being calculated. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[android.text.style.LineHeightSpan](/reference/android/text/style/LineHeightSpan)` ` |------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[chooseHeight](/reference/android/text/style/LineHeightSpan#chooseHeight(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20android.graphics.Paint.FontMetricsInt))`(`[CharSequence](/reference/java/lang/CharSequence)` text, int start, int end, int spanstartv, int lineHeight, `[Paint.FontMetricsInt](/reference/android/graphics/Paint.FontMetricsInt)` fm) ` Classes that implement this should define how the height is being calculated. | ||\n\nPublic methods\n--------------\n\n### chooseHeight\n\nAdded in [API level 5](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void chooseHeight (CharSequence text, \n int start, \n int end, \n int spanstartv, \n int lineHeight, \n Paint.FontMetricsInt fm, \n TextPaint paint)\n```\n\nClasses that implement this should define how the height is being calculated.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|-------------------------------------|\n| `text` | `CharSequence`: the text \u003cbr /\u003e |\n| `start` | `int`: the start of the line \u003cbr /\u003e |\n| `end` | `int`: the end of the line \u003cbr /\u003e |\n| `spanstartv` | `int`: the start of the span \u003cbr /\u003e |\n| `lineHeight` | `int`: the line height \u003cbr /\u003e |\n| `fm` | `Paint.FontMetricsInt` \u003cbr /\u003e |\n| `paint` | `TextPaint`: the paint \u003cbr /\u003e |"]]