Added in API level 21

PatternPathMotion

open class PatternPathMotion : PathMotion
kotlin.Any
   ↳ android.transition.PathMotion
   ↳ android.transition.PatternPathMotion

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>&lt;changeBounds&gt;
      &lt;patternPathMotion android:patternPathData="M0 0 L0 100 L100 100"/&gt;
  &lt;/changeBounds&gt;</code>

Summary

Public constructors

Constructs a PatternPathMotion with a straight-line pattern.

PatternPathMotion(context: Context!, attrs: AttributeSet!)

PatternPathMotion(patternPath: Path!)

Creates a PatternPathMotion with the Path defining a pattern of motion between two coordinates.

Public methods
open Path!
getPath(startX: Float, startY: Float, endX: Float, endY: Float)

open Path!

Returns the Path defining a pattern of motion between two coordinates.

open Unit
setPatternPath(patternPath: Path!)

Sets the Path defining a pattern of motion between two coordinates.

Public constructors

PatternPathMotion

Added in API level 21
PatternPathMotion()

Constructs a PatternPathMotion with a straight-line pattern.

PatternPathMotion

Added in API level 21
PatternPathMotion(
    context: Context!,
    attrs: AttributeSet!)

PatternPathMotion

Added in API level 21
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

Added in API level 21
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.
Return
Path! 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) and end at (endX, endY).

getPatternPath

Added in API level 21
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

Added in API level 21
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.