Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for InsertGesture
. This class is not designed to be thread-safe.
Summary
Public constructors
Public methods
build
fun build(): InsertGesture
Exceptions |
java.lang.IllegalArgumentException |
if one or more positional parameters are not specified. |
setFallbackText
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 |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# InsertGesture.Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/inputmethod/InsertGesture.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|-----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.view.inputmethod.InsertGesture.Builder](#) |\n\nBuilder for [InsertGesture](/reference/kotlin/android/view/inputmethod/InsertGesture). This class is not designed to be thread-safe.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|---------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [InsertGesture](/reference/kotlin/android/view/inputmethod/InsertGesture) | [build](#build())`()` \u003cbr /\u003e |\n| [InsertGesture.Builder](#) | [setFallbackText](#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. |\n| [InsertGesture.Builder](#) | [setInsertionPoint](#setInsertionPoint(android.graphics.PointF))`(`point:` `[PointF](../../graphics/PointF.html#)`)` Sets the insertion point (in screen coordinates) where [setTextToInsert(java.lang.String)](#setTextToInsert(kotlin.String)) should be inserted. |\n| [InsertGesture.Builder](#) | [setTextToInsert](#setTextToInsert(kotlin.String))`(`text:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Set the text that will be inserted at [setInsertionPoint(android.graphics.PointF)](#setInsertionPoint(android.graphics.PointF)). |\n\nPublic constructors\n-------------------\n\n### Builder\n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): InsertGesture\n```\n\n| Return ||\n|---------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [InsertGesture](/reference/kotlin/android/view/inputmethod/InsertGesture) | [InsertGesture](/reference/kotlin/android/view/inputmethod/InsertGesture) using parameters in this [InsertGesture.Builder](#). This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|---------------------------------------------------------|\n| `java.lang.IllegalArgumentException` | if one or more positional parameters are not specified. |\n\n### setFallbackText\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setFallbackText(fallbackText: String?): InsertGesture.Builder\n```\n\nSet fallback text that will be committed at current cursor position if there is no applicable text beneath the area of gesture.\n\n| Parameters ||\n|----------------|------------------------------------------------------------------------------------------------|\n| `fallbackText` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: text to set |\n\n| Return ||\n|----------------------------|------------------------------|\n| [InsertGesture.Builder](#) | This value cannot be `null`. |\n\n### setInsertionPoint\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setInsertionPoint(point: PointF): InsertGesture.Builder\n```\n\nSets the insertion point (in screen coordinates) where [setTextToInsert(java.lang.String)](#setTextToInsert(kotlin.String)) should be inserted.\n\n| Parameters ||\n|---------|---------------------------------------------------------------------|\n| `point` | [PointF](../../graphics/PointF.html#): This value cannot be `null`. |\n\n| Return ||\n|----------------------------|------------------------------|\n| [InsertGesture.Builder](#) | This value cannot be `null`. |\n\n### setTextToInsert\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setTextToInsert(text: String): InsertGesture.Builder\n```\n\nSet the text that will be inserted at [setInsertionPoint(android.graphics.PointF)](#setInsertionPoint(android.graphics.PointF)). When set with an empty string, cursor will be moved to [getInsertionPoint()](/reference/kotlin/android/view/inputmethod/InsertGesture#getInsertionPoint()) and no text would be inserted.\n\n| Parameters ||\n|--------|----------------------------------------------------------------------------------------------------------------|\n| `text` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |\n\n| Return ||\n|----------------------------|------------------------------|\n| [InsertGesture.Builder](#) | This value cannot be `null`. |"]]