Added in API level 34

PreviewableHandwritingGesture


abstract class PreviewableHandwritingGesture : HandwritingGesture
DeleteGesture

A sub-class of HandwritingGesture for deleting an area of text using single rectangle.

DeleteRangeGesture

A subclass of HandwritingGesture for deleting a range of text by defining start and end rectangles.

SelectGesture

A sub-class of HandwritingGesture for selecting an area of text using single rectangle.

SelectRangeGesture

A subclass of HandwritingGesture for selecting a range of text by defining start and end rectangles.

A HandwritingGesture that can be previewed. Note: An editor might only implement a subset of gesture previews and declares the supported ones via EditorInfo.getSupportedHandwritingGesturePreviews.

Summary

Inherited constants
Int GRANULARITY_CHARACTER

Operate on text per character basis. i.e. each character is selected based on its intersection with selection rectangle.

Strategy of operating at a granular level is maintained in the UI toolkit. A character/word/line is included if its center is within the gesture rectangle. e.g. if a selection RectF with GRANULARITY_CHARACTER includes width-wise center of the character, it should be selected. Similarly, text in a line should be included in the operation if rectangle includes line height center.

Int GRANULARITY_WORD

Operate text per word basis. e.g. if selection includes width-wise center of the word, whole word is selected.

Strategy of operating at a granular level is maintained in the UI toolkit. A character/word/line is included if its center is within the gesture rectangle. e.g. if a selection RectF with GRANULARITY_WORD includes width-wise center of the word, it should be selected. Similarly, text in a line should be included in the operation if rectangle includes line height center.

Refer to https://www.unicode.org/reports/tr29/#Word_Boundaries for more detail on how word breaks are decided.

Inherited functions
String? getFallbackText()

The fallback text that will be committed at current cursor position if there is no applicable text beneath the area of gesture. For example, select can fail if gesture is drawn over area that has no text beneath. example 2: join can fail if the gesture is drawn over text but there is no whitespace.