Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription#pubctors) \| [Methods](https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription#inhmethods)

# GestureDescription.StrokeDescription

*** ** * ** ***


`
public
static


class
GestureDescription.StrokeDescription
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.accessibilityservice.GestureDescription.StrokeDescription |

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription#StrokeDescription(android.graphics.Path,%20long,%20long)(https://developer.android.com/reference/android/graphics/Path path, long startTime, long duration) ` |
| ` https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription#StrokeDescription(android.graphics.Path,%20long,%20long,%20boolean)(https://developer.android.com/reference/android/graphics/Path path, long startTime, long duration, boolean willContinue) ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription` | ` https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription#continueStroke(android.graphics.Path,%20long,%20long,%20boolean)(https://developer.android.com/reference/android/graphics/Path path, long startTime, long duration, boolean willContinue) ` Create a new stroke that will continue this one. |
| ` long` | ` https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription#getDuration()() ` Get the stroke's duration |
| ` https://developer.android.com/reference/android/graphics/Path` | ` https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription#getPath()() ` Retrieve a copy of the path for this stroke |
| ` long` | ` https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription#getStartTime()() ` Get the stroke's start time |
| ` boolean` | ` https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription#willContinue()() ` Check if this stroke is marked to continue in the next gesture. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### StrokeDescription

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

```
public StrokeDescription (Path path, 
                long startTime, 
                long duration)
```

<br />

<br />

| 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 cannot be `null`. <br /> |
| `startTime` | `long`: The time, in milliseconds, from the time the gesture starts to the time the stroke should start. Must not be negative. Value is 0 or greater <br /> |
| `duration` | `long`: The duration, in milliseconds, the stroke takes to traverse the path. Must be positive. Value is 0 or greater <br /> |

### StrokeDescription

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

```
public StrokeDescription (Path path, 
                long startTime, 
                long duration, 
                boolean willContinue)
```

<br />

<br />

| 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 cannot be `null`. <br /> |
| `startTime` | `long`: The time, in milliseconds, from the time the gesture starts to the time the stroke should start. Must not be negative. Value is 0 or greater <br /> |
| `duration` | `long`: The duration, in milliseconds, the stroke takes to traverse the path. Must be positive. Value is 0 or greater <br /> |
| `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. <br /> |

## Public methods

### continueStroke

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

```
public 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.

<br />

| 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. <br /> |
| `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. <br /> |
| `duration` | `long`: The duration for the new stroke. Must not be negative. <br /> |
| `willContinue` | `boolean`: `true` if this stroke will be continued by one in the next gesture `false` otherwise. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/accessibilityservice/GestureDescription.StrokeDescription` | <br /> |

### getDuration

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

```
public long getDuration ()
```

Get the stroke's duration

<br />

| Returns ||
|---|---|
| `long` | the duration for this stroke <br /> |

### getPath

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

```
public Path getPath ()
```

Retrieve a copy of the path for this stroke

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Path` | A copy of the path <br /> |

### getStartTime

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

```
public long getStartTime ()
```

Get the stroke's start time

<br />

| Returns ||
|---|---|
| `long` | the start time for this stroke. <br /> |

### willContinue

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

```
public boolean willContinue ()
```

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

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the stroke is to be continued. <br /> |