Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for a GestureDescription
Summary
Public constructors
Public methods
setDisplayId
open fun setDisplayId(displayId: Int): GestureDescription.Builder
Sets the id of the display to dispatch gestures.
Parameters |
displayId |
Int: The logical display id |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# GestureDescription.Builder\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/accessibilityservice/GestureDescription.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.accessibilityservice.GestureDescription.Builder](#) |\n\nBuilder for a `GestureDescription`\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [GestureDescription.Builder](#)! | [addStroke](#addStroke(android.accessibilityservice.GestureDescription.StrokeDescription))`(`strokeDescription:` `[GestureDescription.StrokeDescription](/reference/kotlin/android/accessibilityservice/GestureDescription.StrokeDescription)`)` Adds a stroke to the gesture description. |\n| open [GestureDescription](/reference/kotlin/android/accessibilityservice/GestureDescription)! | [build](#build())`()` \u003cbr /\u003e |\n| open [GestureDescription.Builder](#) | [setDisplayId](#setDisplayId(kotlin.Int))`(`displayId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the id of the display to dispatch gestures. |\n\nPublic constructors\n-------------------\n\n### Builder\n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### addStroke\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun addStroke(strokeDescription: GestureDescription.StrokeDescription): GestureDescription.Builder!\n```\n\nAdds a stroke to the gesture description. Up to [GestureDescription.getMaxStrokeCount()](/reference/kotlin/android/accessibilityservice/GestureDescription#getMaxStrokeCount()) paths may be added to a gesture, and the total gesture duration (earliest path start time to latest path end time) may not exceed [GestureDescription.getMaxGestureDuration()](/reference/kotlin/android/accessibilityservice/GestureDescription#getMaxGestureDuration()).\n\n| Parameters ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `strokeDescription` | [GestureDescription.StrokeDescription](/reference/kotlin/android/accessibilityservice/GestureDescription.StrokeDescription): the stroke to add. This value cannot be `null`. |\n\n| Return ||\n|----------------------------------|------|\n| [GestureDescription.Builder](#)! | this |\n\n### build\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun build(): GestureDescription!\n``` \n\n### setDisplayId\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setDisplayId(displayId: Int): GestureDescription.Builder\n```\n\nSets the id of the display to dispatch gestures.\n\n| Parameters ||\n|-------------|----------------------------------------------------------------------------------------------------|\n| `displayId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The logical display id |\n\n| Return ||\n|---------------------------------|-----------------------------------|\n| [GestureDescription.Builder](#) | this This value cannot be `null`. |"]]