# InsertModeGesture.Builder

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/inputmethod/InsertModeGesture.Builder "View this page in Java")  

```
class Builder
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                           ||
| ↳ | [android.view.inputmethod.InsertModeGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#) |

Builder for[InsertModeGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture). This class is not designed to be thread-safe.

## Summary

|                                                         Public constructors                                                          ||
|-----------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#Builder())`()` <br /> |

|                                                                                                                                                                                                                                                                                              Public methods                                                                                                                                                                                                                                                                                              ||
|---------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [InsertModeGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture)                  | [build](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#build())`()` Returns[InsertModeGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture)using parameters in this[InsertModeGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#).                                                                    |
| [InsertModeGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#) | [setCancellationSignal](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#setCancellationSignal(android.os.CancellationSignal))`(`cancellationSignal:` `[CancellationSignal](https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#)`)` Sets the[CancellationSignal](https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#)used to cancel the ongoing gesture. |
| [InsertModeGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#) | [setFallbackText](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#setFallbackText(kotlin.String))`(`fallbackText:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Set fallback text that will be committed at current cursor position if there is no applicable text beneath the area of gesture.                                                                              |
| [InsertModeGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#) | [setInsertionPoint](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#setInsertionPoint(android.graphics.PointF))`(`point:` `[PointF](https://developer.android.com/reference/kotlin/android/graphics/PointF.html#)`)` Sets the insertion point (in screen coordinates) where space will be created for additional text to be inserted.                                                                                 |

## Public constructors

### Builder

```
Builder()
```

## Public methods

### build

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun build(): InsertModeGesture
```

Returns[InsertModeGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture)using parameters in this[InsertModeGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#).

|                                                                   Return                                                                    ||
|----------------------------------------------------------------------------------------------------------------|-----------------------------|
| [InsertModeGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture) | This value cannot be`null`. |

|                                          Exceptions                                           ||
|--------------------------------------|---------------------------------------------------------|
| `java.lang.IllegalArgumentException` | if one or more positional parameters are not specified. |

### setCancellationSignal

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setCancellationSignal(cancellationSignal: CancellationSignal): InsertModeGesture.Builder
```

Sets the[CancellationSignal](https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#)used to cancel the ongoing gesture.

|                                                                                           Parameters                                                                                            ||
|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cancellationSignal` | [CancellationSignal](https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#):signal to cancel an ongoing gesture. This value cannot be`null`. |

|                                                                            Return                                                                            ||
|---------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [InsertModeGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#) | This value cannot be`null`. |

### setFallbackText

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setFallbackText(fallbackText: String?): InsertModeGesture.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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?:text to set |

|                                                                            Return                                                                            ||
|---------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [InsertModeGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#) | This value cannot be`null`. |

### setInsertionPoint

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setInsertionPoint(point: PointF): InsertModeGesture.Builder
```

Sets the insertion point (in screen coordinates) where space will be created for additional text to be inserted.

|                                                         Parameters                                                          ||
|---------|--------------------------------------------------------------------------------------------------------------------|
| `point` | [PointF](https://developer.android.com/reference/kotlin/android/graphics/PointF.html#):This value cannot be`null`. |

|                                                                            Return                                                                            ||
|---------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [InsertModeGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/InsertModeGesture.Builder#) | This value cannot be`null`. |