Stay organized with collections
Save and categorize content based on your preferences.
Layout.TextInclusionStrategy
public
static
interface
Layout.TextInclusionStrategy
android.text.Layout.TextInclusionStrategy
|
Strategy for determining whether a text segment is inside a rectangle area.
Summary
Public methods
isSegmentInside
public abstract boolean isSegmentInside (RectF segmentBounds,
RectF area)
Returns true if this TextInclusionStrategy
considers the segment with bounds
segmentBounds
to be inside area
.
The segment is a range of text which does not cross line boundaries or directional run
boundaries. The horizontal bounds of the segment are the start bound of the first
character to the end bound of the last character. The vertical bounds match the line
bounds (getLineTop(line)
and getLineBottom(line, false)
).
Parameters |
segmentBounds |
RectF : This value cannot be null . |
area |
RectF : This value cannot be null . |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Layout.TextInclusionStrategy\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nLayout.TextInclusionStrategy\n============================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/text/Layout.TextInclusionStrategy \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nLayout.TextInclusionStrategy\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------|\n| android.text.Layout.TextInclusionStrategy |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nStrategy for determining whether a text segment is inside a rectangle area. \n**See also:**\n\n- [Layout.getRangeForRect(RectF, SegmentFinder, TextInclusionStrategy)](/reference/android/text/Layout#getRangeForRect(android.graphics.RectF,%20android.text.SegmentFinder,%20android.text.Layout.TextInclusionStrategy))\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[isSegmentInside](/reference/android/text/Layout.TextInclusionStrategy#isSegmentInside(android.graphics.RectF,%20android.graphics.RectF))`(`[RectF](/reference/android/graphics/RectF)` segmentBounds, `[RectF](/reference/android/graphics/RectF)` area) ` Returns true if this [TextInclusionStrategy](/reference/android/text/Layout.TextInclusionStrategy) considers the segment with bounds `segmentBounds` to be inside `area`. |\n\nPublic methods\n--------------\n\n### isSegmentInside\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean isSegmentInside (RectF segmentBounds, \n RectF area)\n```\n\nReturns true if this [TextInclusionStrategy](/reference/android/text/Layout.TextInclusionStrategy) considers the segment with bounds\n`segmentBounds` to be inside `area`.\n\nThe segment is a range of text which does not cross line boundaries or directional run\nboundaries. The horizontal bounds of the segment are the start bound of the first\ncharacter to the end bound of the last character. The vertical bounds match the line\nbounds (`getLineTop(line)` and `getLineBottom(line, false)`).\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------------|----------------------------------------------|\n| `segmentBounds` | `RectF`: This value cannot be `null`. \u003cbr /\u003e |\n| `area` | `RectF`: This value cannot be `null`. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |"]]