public class ArcMotion extends PathMotion
When the two points are near horizontal or vertical, the curve of the motion will be
small as the center of the circle will be far from both points. To force curvature of
the path, setMinimumHorizontalAngle(float)
and
setMinimumVerticalAngle(float)
may be used to set the minimum angle of the
arc between two points.
This may be used in XML as an element inside a transition.
<changeBounds>
<arcMotion android:minimumHorizontalAngle="15"
android:minimumVerticalAngle="0"
android:maximumAngle="90"/>
</changeBounds>
Constructor and Description |
---|
ArcMotion() |
ArcMotion(Context context,
AttributeSet attrs) |
Modifier and Type | Method and Description |
---|---|
float |
getMaximumAngle()
Returns the maximum arc along the circle between two points.
|
float |
getMinimumHorizontalAngle()
Returns the minimum arc along the circle between two points aligned near horizontally.
|
float |
getMinimumVerticalAngle()
Returns the minimum arc along the circle between two points aligned near vertically.
|
Path |
getPath(float startX,
float startY,
float endX,
float endY)
Provide a Path to interpolate between two points
(startX, startY) and
(endX, endY) . |
void |
setMaximumAngle(float angleInDegrees)
Sets the maximum arc along the circle between two points.
|
void |
setMinimumHorizontalAngle(float angleInDegrees)
Sets the minimum arc along the circle between two points aligned near horizontally.
|
void |
setMinimumVerticalAngle(float angleInDegrees)
Sets the minimum arc along the circle between two points aligned near vertically.
|
public ArcMotion()
public ArcMotion(Context context, AttributeSet attrs)
public void setMinimumHorizontalAngle(float angleInDegrees)
The default value is 0.
angleInDegrees
- The minimum angle of the arc on a circle describing the Path
between two nearly horizontally-separated points.public float getMinimumHorizontalAngle()
The default value is 0.
public void setMinimumVerticalAngle(float angleInDegrees)
The default value is 0.
angleInDegrees
- The minimum angle of the arc on a circle describing the Path
between two nearly vertically-separated points.public float getMinimumVerticalAngle()
The default value is 0.
public void setMaximumAngle(float angleInDegrees)
The default value is 70 degrees.
angleInDegrees
- The maximum angle of the arc on a circle describing the Path
between the start and end points.public float getMaximumAngle()
The default value is 70 degrees.
public Path getPath(float startX, float startY, float endX, float endY)
PathMotion
(startX, startY)
and
(endX, endY)
. This allows controlled curved motion along two dimensions.getPath
in class PathMotion
startX
- The x coordinate of the starting point.startY
- The y coordinate of the starting point.endX
- The x coordinate of the ending point.endY
- The y coordinate of the ending point.(startX, startY)
, typically using
Path.moveTo(float, float)
and end at (endX, endY)
.