# Layout.TextInclusionStrategy

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

# Layout.TextInclusionStrategy

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/text/Layout.TextInclusionStrategy "View this page in Kotlin")\|Java

`
public
static


interface
Layout.TextInclusionStrategy
`  
`


`

|-------------------------------------------|
| android.text.Layout.TextInclusionStrategy |

<br />

*** ** * ** ***

Strategy for determining whether a text segment is inside a rectangle area.  
**See also:**

- [Layout.getRangeForRect(RectF, SegmentFinder, TextInclusionStrategy)](https://developer.android.com/reference/android/text/Layout#getRangeForRect(android.graphics.RectF,%20android.text.SegmentFinder,%20android.text.Layout.TextInclusionStrategy))

## Summary

|                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                              ||
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean` | ` `[isSegmentInside](https://developer.android.com/reference/android/text/Layout.TextInclusionStrategy#isSegmentInside(android.graphics.RectF,%20android.graphics.RectF))`(`[RectF](https://developer.android.com/reference/android/graphics/RectF)` segmentBounds, `[RectF](https://developer.android.com/reference/android/graphics/RectF)` area) ` Returns true if this[TextInclusionStrategy](https://developer.android.com/reference/android/text/Layout.TextInclusionStrategy)considers the segment with bounds`segmentBounds`to be inside`area`. |

## Public methods

### isSegmentInside

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract boolean isSegmentInside (RectF segmentBounds, 
                RectF area)
```

Returns true if this[TextInclusionStrategy](https://developer.android.com/reference/android/text/Layout.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)`).

<br />

|                          Parameters                          ||
|-----------------|---------------------------------------------|
| `segmentBounds` | `RectF`: This value cannot be`null`. <br /> |
| `area`          | `RectF`: This value cannot be`null`. <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |