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

```
class Builder
```

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

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

## Summary

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

|                                                                                                                                                                                                                                                                                                            Public methods                                                                                                                                                                                                                                                                                                             ||
|-----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RemoveSpaceGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/RemoveSpaceGesture)                  | [build](https://developer.android.com/reference/kotlin/android/view/inputmethod/RemoveSpaceGesture.Builder#build())`()` <br />                                                                                                                                                                                                                                                                                                                                                                     |
| [RemoveSpaceGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/RemoveSpaceGesture.Builder#) | [setFallbackText](https://developer.android.com/reference/kotlin/android/view/inputmethod/RemoveSpaceGesture.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 whitespace beneath the gesture line.                                                                                                               |
| [RemoveSpaceGesture.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/RemoveSpaceGesture.Builder#) | [setPoints](https://developer.android.com/reference/kotlin/android/view/inputmethod/RemoveSpaceGesture.Builder#setPoints(android.graphics.PointF,%20android.graphics.PointF))`(`startPoint:` `[PointF](https://developer.android.com/reference/kotlin/android/graphics/PointF.html#)`, `endPoint:` `[PointF](https://developer.android.com/reference/kotlin/android/graphics/PointF.html#)`)` Sets the start and end points in screen coordinates of the line to apply the remove space operation. |

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

|                                                                                                                                                                                                  Return                                                                                                                                                                                                  ||
|------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RemoveSpaceGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/RemoveSpaceGesture) | [RemoveSpaceGesture](https://developer.android.com/reference/kotlin/android/view/inputmethod/RemoveSpaceGesture) using parameters in this [Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/RemoveSpaceGesture.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?): RemoveSpaceGesture.Builder
```

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

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

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

### setPoints

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

```
fun setPoints(
    startPoint: PointF, 
    endPoint: PointF
): RemoveSpaceGesture.Builder
```

Sets the start and end points in screen coordinates of the line to apply the remove space operation. All whitespace characters touched by the line joining the points will be deleted.

The operation will only be performed on a single line of text. If the start and end points are on different lines of text, the line will be adjusted to cover only the first line of text containing one of the points.

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

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