Most visited

Recently visited

Added in API level 21

PathMotion

public abstract class PathMotion
extends Object

java.lang.Object
   ↳ android.transition.PathMotion
Known Direct Subclasses


这个基类可以被扩展来提供沿着转换路径的运动。

诸如ChangeBoundsChangeBounds移动视图,通常位于开始位置和结束位置之间的直线路径中。 希望让这些运动以曲线形式移动的应用程序可以通过扩展PathMotion并实现getPath(float, float, float, float)来改变View在二维中的内插getPath(float, float, float, float)

这可以在XML中用作转换中的元素。

 <changeBounds>
     <pathMotion class="my.app.transition.MyPathMotion"/>
 </changeBounds>
 
 

Summary

Public constructors

PathMotion()
PathMotion(Context context, AttributeSet attrs)

Public methods

abstract Path getPath(float startX, float startY, float endX, float endY)

提供一个在两点之间插入的路径 (startX, startY)(endX, endY)

Inherited methods

From class java.lang.Object

Public constructors

PathMotion

Added in API level 21
PathMotion ()

PathMotion

Added in API level 21
PathMotion (Context context, 
                AttributeSet attrs)

Parameters
context Context
attrs AttributeSet

Public methods

getPath

Added in API level 21
Path getPath (float startX, 
                float startY, 
                float endX, 
                float endY)

提供一个在两点之间插入的路径(startX, startY)(endX, endY) 这允许沿着两个维度进行受控弯曲运动。

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.
Returns
Path A Path along which the points should be interpolated. The returned Path must start at point (startX, startY), typically using moveTo(float, float) and end at (endX, endY).

Hooray!