Added in API level 34

TextInclusionStrategy


@FunctionalInterface interface TextInclusionStrategy
android.text.Layout.TextInclusionStrategy

Strategy for determining whether a text segment is inside a rectangle area.

Summary

Public methods
abstract Boolean
isSegmentInside(segmentBounds: RectF, area: RectF)

Returns true if this TextInclusionStrategy considers the segment with bounds segmentBounds to be inside area.

Public methods

isSegmentInside

Added in API level 34
abstract fun isSegmentInside(
    segmentBounds: RectF,
    area: RectF
): Boolean

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.