Skip to content

Most visited

Recently visited

navigation

GestureDescription.StrokeDescription

public static class GestureDescription.StrokeDescription
extends Object

java.lang.Object
   ↳ android.accessibilityservice.GestureDescription.StrokeDescription


Immutable description of stroke that can be part of a gesture.

Summary

Public constructors

GestureDescription.StrokeDescription(Path path, long startTime, long duration)
GestureDescription.StrokeDescription(Path path, long startTime, long duration, boolean willContinue)

Public methods

GestureDescription.StrokeDescription continueStroke(Path path, long startTime, long duration, boolean willContinue)

Create a new stroke that will continue this one.

long getDuration()

Get the stroke's duration

Path getPath()

Retrieve a copy of the path for this stroke

long getStartTime()

Get the stroke's start time

boolean willContinue()

Check if this stroke is marked to continue in the next gesture.

Inherited methods

From class java.lang.Object

Public constructors

GestureDescription.StrokeDescription

added in API level 24
GestureDescription.StrokeDescription (Path path, 
                long startTime, 
                long duration)

Parameters
path Path: The path to follow. Must have exactly one contour. The bounds of the path must not be negative. The path must not be empty. If the path has zero length (for example, a single moveTo()), the stroke is a touch that doesn't move.

This value must never be null.

startTime long: The time, in milliseconds, from the time the gesture starts to the time the stroke should start. Must not be negative.

duration long: The duration, in milliseconds, the stroke takes to traverse the path. Must be positive.

GestureDescription.StrokeDescription

added in API level 26
GestureDescription.StrokeDescription (Path path, 
                long startTime, 
                long duration, 
                boolean willContinue)

Parameters
path Path: The path to follow. Must have exactly one contour. The bounds of the path must not be negative. The path must not be empty. If the path has zero length (for example, a single moveTo()), the stroke is a touch that doesn't move.

This value must never be null.

startTime long: The time, in milliseconds, from the time the gesture starts to the time the stroke should start. Must not be negative.

duration long: The duration, in milliseconds, the stroke takes to traverse the path. Must be positive.

willContinue boolean: true if this stroke will be continued by one in the next gesture false otherwise. Continued strokes keep their pointers down when the gesture completes.

Public methods

continueStroke

added in API level 26
GestureDescription.StrokeDescription continueStroke (Path path, 
                long startTime, 
                long duration, 
                boolean willContinue)

Create a new stroke that will continue this one. This is only possible if this stroke will continue.

Parameters
path Path: The path for the stroke that continues this one. The starting point of this path must match the ending point of the stroke it continues.

startTime long: The time, in milliseconds, from the time the gesture starts to the time this stroke should start. Must not be negative. This time is from the start of the new gesture, not the one being continued.

duration long: The duration for the new stroke. Must not be negative.

willContinue boolean: true if this stroke will be continued by one in the next gesture false otherwise.

Returns
GestureDescription.StrokeDescription

getDuration

added in API level 24
long getDuration ()

Get the stroke's duration

Returns
long the duration for this stroke

getPath

added in API level 24
Path getPath ()

Retrieve a copy of the path for this stroke

Returns
Path A copy of the path

getStartTime

added in API level 24
long getStartTime ()

Get the stroke's start time

Returns
long the start time for this stroke.

willContinue

added in API level 26
boolean willContinue ()

Check if this stroke is marked to continue in the next gesture.

Returns
boolean true if the stroke is to be continued.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)