PatternPathMotion
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.
<changeBounds> <patternPathMotion android:patternPathData="M0 0 L0 100 L100 100"/> </changeBounds>
Summary
Public constructors |
|---|
|
Constructs a PatternPathMotion with a straight-line pattern. |
PatternPathMotion(patternPath: Path)Creates a PatternPathMotion with the Path defining a pattern of motion between two coordinates. |
PatternPathMotion(context: Context, attrs: AttributeSet) |
Public functions |
|
|---|---|
Path |
Provide a Path to interpolate between two points |
Path |
Returns the Path defining a pattern of motion between two coordinates. |
Unit |
setPatternPath(patternPath: Path)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 functions
getPath
fun getPath(startX: Float, startY: Float, endX: Float, endY: Float): Path
Provide a Path to interpolate between two points (startX, startY) and (endX, endY). This allows controlled curved motion along two dimensions.
getPatternPath
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.
| Returns | |
|---|---|
Path |
the Path defining a pattern of motion between two coordinates. |
setPatternPath
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. |