Class

TextGranularity

Used by Paragraph.getRangeForRect.

Source set: Common
public class TextGranularity private constructor(private val value: Int)

Used by Paragraph.getRangeForRect. It specifies the minimal unit of the text ranges that is considered by the Paragraph.getRangeForRect.

Members

Companion

Source set: Common
public companion object

Properties

Character

Source set: Common
public val Character: TextGranularity

Character level granularity. The text string will be break into ranges each corresponding to a visual character. e.g. "Hi \uD83D\uDE00" will be break into: 'H', 'i', ' ', '\uD83D\uDE00' (grin face emoji).

Word

Source set: Common
public val Word: TextGranularity

Word level granularity. The text string will be break into ranges each corresponding to a word. e.g. "Hello world" wil be break into "Hello", "world" the space character is not considered as a word.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: