The Developer Preview for Android 11 is now available; test it out and share your feedback.

AnchorInfo

@Immutable data class AnchorInfo
kotlin.Any
   ↳ androidx.ui.core.selection.Selection.AnchorInfo

Contains information about an anchor (start/end) of selection.

Summary

Public constructors

<init>(coordinates: PxPosition, direction: TextDirection, offset: Int, layoutCoordinates: LayoutCoordinates?)

Contains information about an anchor (start/end) of selection.

Properties

PxPosition

The coordinates of the graphical position for selection character offset.

TextDirection

Text direction of the character in selection edge.

LayoutCoordinates?

The layout coordinates of the child which contains the whole selection.

Int

Character offset for the selection edge.

Public constructors

<init>

AnchorInfo(
    coordinates: PxPosition,
    direction: TextDirection,
    offset: Int,
    layoutCoordinates: LayoutCoordinates?)

Contains information about an anchor (start/end) of selection.

Properties

coordinates

val coordinates: PxPosition

The coordinates of the graphical position for selection character offset.

This graphical position is the point at the left bottom corner for LTR character, or right bottom corner for RTL character.

This coordinates is in child composable coordinates system.

direction

val direction: TextDirection

Text direction of the character in selection edge.

layoutCoordinates

val layoutCoordinates: LayoutCoordinates?

The layout coordinates of the child which contains the whole selection. If the child does not contain the end of the selection, this should be null.

offset

val offset: Int

Character offset for the selection edge. This offset is within individual child text composable.