Added in API level 34

Builder


class Builder
kotlin.Any
   ↳ android.view.inputmethod.InsertGesture.Builder

Builder for InsertGesture. This class is not designed to be thread-safe.

Summary

Public constructors

Public methods
InsertGesture

InsertGesture.Builder
setFallbackText(fallbackText: String?)

Set fallback text that will be committed at current cursor position if there is no applicable text beneath the area of gesture.

InsertGesture.Builder

Sets the insertion point (in screen coordinates) where setTextToInsert(java.lang.String) should be inserted.

InsertGesture.Builder

Set the text that will be inserted at setInsertionPoint(android.graphics.PointF).

Public constructors

Builder

Builder()

Public methods

build

Added in API level 34
fun build(): InsertGesture
Return
InsertGesture InsertGesture using parameters in this InsertGesture.Builder. This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if one or more positional parameters are not specified.

setFallbackText

Added in API level 34
fun setFallbackText(fallbackText: String?): InsertGesture.Builder

Set fallback text that will be committed at current cursor position if there is no applicable text beneath the area of gesture.

Parameters
fallbackText String?: text to set
Return
InsertGesture.Builder This value cannot be null.

setInsertionPoint

Added in API level 34
fun setInsertionPoint(point: PointF): InsertGesture.Builder

Sets the insertion point (in screen coordinates) where setTextToInsert(java.lang.String) should be inserted.

Parameters
point PointF: This value cannot be null.
Return
InsertGesture.Builder This value cannot be null.

setTextToInsert

Added in API level 34
fun setTextToInsert(text: String): InsertGesture.Builder

Set the text that will be inserted at setInsertionPoint(android.graphics.PointF). When set with an empty string, cursor will be moved to getInsertionPoint() and no text would be inserted.

Parameters
text String: This value cannot be null.
Return
InsertGesture.Builder This value cannot be null.