Stay organized with collections
Save and categorize content based on your preferences.
PatternPathMotion
open class PatternPathMotion : PathMotion
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.
<code><changeBounds>
<patternPathMotion android:patternPathData="M0 0 L0 100 L100 100"/>
</changeBounds></code>
Summary
Public constructors |
Constructs a PatternPathMotion with a straight-line pattern.
|
|
Creates a PatternPathMotion with the Path defining a pattern of motion between two coordinates.
|
Public methods |
open Path! |
|
open Path! |
Returns the Path defining a pattern of motion between two coordinates.
|
open Unit |
Sets the Path defining a pattern of motion between two coordinates.
|
Public constructors
PatternPathMotion
PatternPathMotion()
Constructs a PatternPathMotion with a straight-line pattern.
PatternPathMotion
PatternPathMotion(patternPath: Path!)
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.
Parameters |
patternPath |
Path!: A Path to be used as a pattern for two-dimensional motion. |
Public methods
getPath
open fun getPath(
startX: Float,
startY: Float,
endX: Float,
endY: Float
): Path!
Parameters |
startX |
Float: The x coordinate of the starting point. |
startY |
Float: The y coordinate of the starting point. |
endX |
Float: The x coordinate of the ending point. |
endY |
Float: The y coordinate of the ending point. |
getPatternPath
open fun getPatternPath(): Path!
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.
Return |
Path! |
the Path defining a pattern of motion between two coordinates. |
setPatternPath
open fun setPatternPath(patternPath: Path!): Unit
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.
Parameters |
patternPath |
Path!: A Path to be used as a pattern for two-dimensional motion. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# PatternPathMotion\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPatternPathMotion\n=================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/transition/PatternPathMotion \"View this page in Java\") \n\n```\nopen class PatternPathMotion : PathMotion\n```\n\n|---|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [android.transition.PathMotion](/reference/kotlin/android/transition/PathMotion) ||\n| | ↳ | [android.transition.PatternPathMotion](#) |\n\nA 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.\n\nThis may be used in XML as an element inside a transition. \n\n```kotlin\n\u003ccode\u003e<changeBounds>\n <patternPathMotion android:patternPathData=\"M0 0 L0 100 L100 100\"/>\n </changeBounds>\u003c/code\u003e\n```\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [PatternPathMotion](#PatternPathMotion())`()` Constructs a PatternPathMotion with a straight-line pattern. |\n| [PatternPathMotion](#PatternPathMotion(android.content.Context,%20android.util.AttributeSet))`(`context:` `[Context](../content/Context.html#)!`, `attrs:` `[AttributeSet](../util/AttributeSet.html#)!`)` \u003cbr /\u003e |\n| [PatternPathMotion](#PatternPathMotion(android.graphics.Path))`(`patternPath:` `[Path](../graphics/Path.html#)!`)` Creates a PatternPathMotion with the Path defining a pattern of motion between two coordinates. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Path](../graphics/Path.html#)! | [getPath](#getPath(kotlin.Float,%20kotlin.Float,%20kotlin.Float,%20kotlin.Float))`(`startX:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `startY:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `endX:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `endY:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` \u003cbr /\u003e |\n| open [Path](../graphics/Path.html#)! | [getPatternPath](#getPatternPath())`()` Returns the Path defining a pattern of motion between two coordinates. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [setPatternPath](#setPatternPath(android.graphics.Path))`(`patternPath:` `[Path](../graphics/Path.html#)!`)` Sets the Path defining a pattern of motion between two coordinates. |\n\nPublic constructors\n-------------------\n\n### PatternPathMotion\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nPatternPathMotion()\n```\n\nConstructs a PatternPathMotion with a straight-line pattern. \n\n### PatternPathMotion\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nPatternPathMotion(\n context: Context!, \n attrs: AttributeSet!)\n``` \n\n### PatternPathMotion\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nPatternPathMotion(patternPath: Path!)\n```\n\nCreates 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.\n\n| Parameters ||\n|---------------|---------------------------------------------------------------------------------------------|\n| `patternPath` | [Path](../graphics/Path.html#)!: A Path to be used as a pattern for two-dimensional motion. |\n\nPublic methods\n--------------\n\n### getPath\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getPath(\n startX: Float, \n startY: Float, \n endX: Float, \n endY: Float\n): Path!\n```\n\n| Parameters ||\n|----------|-------------------------------------------------------------------------------------------------------------------------|\n| `startX` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html): The x coordinate of the starting point. |\n| `startY` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html): The y coordinate of the starting point. |\n| `endX` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html): The x coordinate of the ending point. |\n| `endY` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html): The y coordinate of the ending point. |\n\n| Return ||\n|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Path](../graphics/Path.html#)! | A Path along which the points should be interpolated. The returned Path must start at point `(startX, startY)`, typically using [android.graphics.Path#moveTo(float, float)](../graphics/Path.html#moveTo(kotlin.Float,%20kotlin.Float)) and end at `(endX, endY)`. |\n\n### getPatternPath\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getPatternPath(): Path!\n```\n\nReturns 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.\n\n| Return ||\n|---------------------------------|----------------------------------------------------------------|\n| [Path](../graphics/Path.html#)! | the Path defining a pattern of motion between two coordinates. |\n\n### setPatternPath\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setPatternPath(patternPath: Path!): Unit\n```\n\nSets 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.\n\n| Parameters ||\n|---------------|---------------------------------------------------------------------------------------------|\n| `patternPath` | [Path](../graphics/Path.html#)!: A Path to be used as a pattern for two-dimensional motion. |"]]