# JoinOrSplitGesture.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/JoinOrSplitGesture.Builder "View this page in Java")  

```
class Builder
```

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

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

## Summary

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

|                                                                                                                                                                                                                                                        Public methods                                                                                                                                                                                                                                                         ||
|-----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [JoinOrSplitGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/JoinOrSplitGesture)                  | [build](https://developer.android.com/reference/kotlin/android/view/inputmethod/JoinOrSplitGesture.Builder#build())`()` <br />                                                                                                                                                                                                                                                             |
| [JoinOrSplitGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/JoinOrSplitGesture.Builder#) | [setFallbackText](https://developer.android.com/reference/kotlin/android/view/inputmethod/JoinOrSplitGesture.Builder#setFallbackText(kotlin.String))`(`fallbackText:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Sets fallback text that will be committed at current cursor position if there is no applicable text beneath the gesture point. |
| [JoinOrSplitGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/JoinOrSplitGesture.Builder#) | [setJoinOrSplitPoint](https://developer.android.com/reference/kotlin/android/view/inputmethod/JoinOrSplitGesture.Builder#setJoinOrSplitPoint(android.graphics.PointF))`(`point:` `[PointF](https://developer.android.com/reference/kotlin/android/graphics/PointF.html#)`)` Sets the point to apply the join or split operation in screen coordinates.                                     |

## 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(): JoinOrSplitGesture
```

|                                                                                                                                                                                                Return                                                                                                                                                                                                 ||
|------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [JoinOrSplitGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/JoinOrSplitGesture) | [JoinOrSplitGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/JoinOrSplitGesture)using parameters in this[Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/JoinOrSplitGesture.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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setFallbackText(fallbackText: String?): JoinOrSplitGesture.Builder
```

Sets fallback text that will be committed at current cursor position if there is no applicable text beneath the gesture point.

|                                                         Parameters                                                         ||
|----------------|------------------------------------------------------------------------------------------------------------|
| `fallbackText` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?:This value may be`null`. |

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

### setJoinOrSplitPoint

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

```
fun setJoinOrSplitPoint(point: PointF): JoinOrSplitGesture.Builder
```

Sets the point to apply the join or split operation in screen coordinates.

If the text cursor position closest to the point is inside or on the boundary of whitespace, then the whitespace will be deleted, joining the text on either side of the whitespace. If there are multiple consecutive whitespace characters, then the entire whitespace block will be deleted.

Otherwise, if the text cursor position closest to the point is not touching whitespace, then a space will be inserted at that position.

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

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