Added in API level 24

StrokeDescription


class StrokeDescription
kotlin.Any
   ↳ android.accessibilityservice.GestureDescription.StrokeDescription

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

Summary

Public constructors
StrokeDescription(path: Path, startTime: Long, duration: Long)

StrokeDescription(path: Path, startTime: Long, duration: Long, willContinue: Boolean)

Public methods
open GestureDescription.StrokeDescription!
continueStroke(path: Path!, startTime: Long, duration: Long, willContinue: Boolean)

Create a new stroke that will continue this one.

open Long

Get the stroke's duration

open Path!

Retrieve a copy of the path for this stroke

open Long

Get the stroke's start time

open Boolean

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

Public constructors

StrokeDescription

Added in API level 24
StrokeDescription(
    path: Path,
    startTime: Long,
    duration: Long)
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.
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
duration Long: The duration, in milliseconds, the stroke takes to traverse the path. Must be positive. Value is 0 or greater

StrokeDescription

Added in API level 26
StrokeDescription(
    path: Path,
    startTime: Long,
    duration: Long,
    willContinue: Boolean)
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.
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
duration Long: The duration, in milliseconds, the stroke takes to traverse the path. Must be positive. Value is 0 or greater
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
open fun continueStroke(
    path: Path!,
    startTime: Long,
    duration: Long,
    willContinue: Boolean
): GestureDescription.StrokeDescription!

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.
Return
GestureDescription.StrokeDescription!

getDuration

Added in API level 24
open fun getDuration(): Long

Get the stroke's duration

Return
Long the duration for this stroke

getPath

Added in API level 24
open fun getPath(): Path!

Retrieve a copy of the path for this stroke

Return
Path! A copy of the path

getStartTime

Added in API level 24
open fun getStartTime(): Long

Get the stroke's start time

Return
Long the start time for this stroke.

willContinue

Added in API level 26
open fun willContinue(): Boolean

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

Return
Boolean true if the stroke is to be continued.