Skip to content

Most visited

Recently visited

navigation
Added in API level 4

GestureStroke

public class GestureStroke
extends Object

java.lang.Object
   ↳ android.gesture.GestureStroke


A gesture stroke started on a touch down and ended on a touch up. A stroke consists of a sequence of timed points. One or multiple strokes form a gesture.

Summary

Fields

public final RectF boundingBox

public final float length

public final float[] points

Public constructors

GestureStroke(ArrayList<GesturePoint> points)

A constructor that constructs a gesture stroke from a list of gesture points.

Public methods

void clearPath()

Invalidates the cached path that is used to render the stroke.

Object clone()

Creates and returns a copy of this Object.

OrientedBoundingBox computeOrientedBoundingBox()

Computes an oriented bounding box of the stroke.

Path getPath()
Path toPath(float width, float height, int numSample)

Converts the stroke to a Path of a given number of points.

Inherited methods

From class java.lang.Object

Fields

boundingBox

Added in API level 4
RectF boundingBox

length

Added in API level 4
float length

points

Added in API level 4
float[] points

Public constructors

GestureStroke

Added in API level 4
GestureStroke (ArrayList<GesturePoint> points)

A constructor that constructs a gesture stroke from a list of gesture points.

Public methods

clearPath

Added in API level 4
void clearPath ()

Invalidates the cached path that is used to render the stroke.

clone

Added in API level 4
Object clone ()

Creates and returns a copy of this Object. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.

Returns
Object a copy of this object.

computeOrientedBoundingBox

Added in API level 4
OrientedBoundingBox computeOrientedBoundingBox ()

Computes an oriented bounding box of the stroke.

Returns
OrientedBoundingBox OrientedBoundingBox

getPath

Added in API level 4
Path getPath ()

Returns
Path

toPath

Added in API level 4
Path toPath (float width, 
                float height, 
                int numSample)

Converts the stroke to a Path of a given number of points.

Parameters
width float: the width of the bounding box of the target path
height float: the height of the bounding box of the target path
numSample int: the number of points needed
Returns
Path the path
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

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.