Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [XML Attrs](https://developer.android.com/reference/android/transition/PatternPathMotion#lattrs) \| [Ctors](https://developer.android.com/reference/android/transition/PatternPathMotion#pubctors) \| [Methods](https://developer.android.com/reference/android/transition/PatternPathMotion#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/transition/PatternPathMotion#inhmethods)

# PatternPathMotion

*** ** * ** ***

` public class PatternPathMotion `   
` ` ` extends https://developer.android.com/reference/android/transition/PathMotion ` ` `

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.transition.PathMotion](https://developer.android.com/reference/android/transition/PathMotion) ||
|   | ↳ | android.transition.PatternPathMotion |

<br />

*** ** * ** ***

A PathMotion that takes a Path pattern and applies it to the separation between two points. The starting point of the Path will be moved to the origin and the end point will be scaled and rotated so that it matches with the target end point.

This may be used in XML as an element inside a transition.

    <changeBounds>
        <patternPathMotion android:patternPathData="M0 0 L0 100 L100 100"/>
    </changeBounds>

<br />

## Summary

| ### XML attributes ||
|---|---|
| [`android:patternPathData`](https://developer.android.com/reference/android/transition/PatternPathMotion#attr_android:patternPathData) | The path string describing the pattern to use for the PathPathMotion. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/transition/PatternPathMotion#PatternPathMotion()() ` Constructs a PatternPathMotion with a straight-line pattern. |
| ` https://developer.android.com/reference/android/transition/PatternPathMotion#PatternPathMotion(android.content.Context,%20android.util.AttributeSet)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/util/AttributeSet attrs) ` |
| ` https://developer.android.com/reference/android/transition/PatternPathMotion#PatternPathMotion(android.graphics.Path)(https://developer.android.com/reference/android/graphics/Path patternPath) ` Creates a PatternPathMotion with the Path defining a pattern of motion between two coordinates. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/graphics/Path` | ` https://developer.android.com/reference/android/transition/PatternPathMotion#getPath(float,%20float,%20float,%20float)(float startX, float startY, float endX, float endY) ` Provide a Path to interpolate between two points `(startX, startY)` and `(endX, endY)`. |
| ` https://developer.android.com/reference/android/graphics/Path` | ` https://developer.android.com/reference/android/transition/PatternPathMotion#getPatternPath()() ` Returns the Path defining a pattern of motion between two coordinates. |
| ` void` | ` https://developer.android.com/reference/android/transition/PatternPathMotion#setPatternPath(android.graphics.Path)(https://developer.android.com/reference/android/graphics/Path patternPath) ` Sets the Path defining a pattern of motion between two coordinates. |

### Inherited methods

From class ` https://developer.android.com/reference/android/transition/PathMotion ` ` abstract https://developer.android.com/reference/android/graphics/Path` ` https://developer.android.com/reference/android/transition/PathMotion#getPath(float,%20float,%20float,%20float)(float startX, float startY, float endX, float endY) `

Provide a Path to interpolate between two points `(startX, startY)` and `(endX, endY)`.
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*.

## XML attributes

### android:patternPathData

The path string describing the pattern to use for the PathPathMotion.

May be a string value, using '\\\\;' to escape characters such as '\\\\n' or '\\\\uxxxx' for a unicode character;

<br />

**Related methods:**

- `https://developer.android.com/reference/android/transition/PatternPathMotion#setPatternPath(android.graphics.Path)`

## Public constructors

### PatternPathMotion

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

```
public PatternPathMotion ()
```

Constructs a PatternPathMotion with a straight-line pattern.

<br />

### PatternPathMotion

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

```
public PatternPathMotion (Context context, 
                AttributeSet attrs)
```

<br />

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |
| `attrs` | `AttributeSet` <br /> |

### PatternPathMotion

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

```
public PatternPathMotion (Path patternPath)
```

Creates a PatternPathMotion with the Path defining a pattern of motion between two coordinates. The pattern will be translated, rotated, and scaled to fit between the start and end points. The pattern must not be empty and must have the end point differ from the start point.

<br />

| Parameters ||
|---|---|
| `patternPath` | `Path`: A Path to be used as a pattern for two-dimensional motion. <br /> |

## Public methods

### getPath

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

```
public Path getPath (float startX, 
                float startY, 
                float endX, 
                float endY)
```

Provide a Path to interpolate between two points `(startX, startY)` and `(endX, endY)`. This allows controlled curved motion along two dimensions.

<br />

| Parameters ||
|---|---|
| `startX` | `float`: The x coordinate of the starting point. <br /> |
| `startY` | `float`: The y coordinate of the starting point. <br /> |
| `endX` | `float`: The x coordinate of the ending point. <br /> |
| `endY` | `float`: The y coordinate of the ending point. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Path` | A Path along which the points should be interpolated. The returned Path must start at point `(startX, startY)`, typically using `https://developer.android.com/reference/android/graphics/Path#moveTo(float,%20float)` and end at `(endX, endY)`. <br /> |

### getPatternPath

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

```
public Path getPatternPath ()
```

Returns the Path defining a pattern of motion between two coordinates. The pattern will be translated, rotated, and scaled to fit between the start and end points. The pattern must not be empty and must have the end point differ from the start point.

<br />

**Related XML Attributes:**

- [android:patternPathData](https://developer.android.com/reference/android/transition/PatternPathMotion#attr_android:patternPathData)

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Path` | the Path defining a pattern of motion between two coordinates. <br /> |

### setPatternPath

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

```
public void setPatternPath (Path patternPath)
```

Sets the Path defining a pattern of motion between two coordinates. The pattern will be translated, rotated, and scaled to fit between the start and end points. The pattern must not be empty and must have the end point differ from the start point.

<br />

**Related XML Attributes:**

- [android:patternPathData](https://developer.android.com/reference/android/transition/PatternPathMotion#attr_android:patternPathData)

| Parameters ||
|---|---|
| `patternPath` | `Path`: A Path to be used as a pattern for two-dimensional motion. <br /> |