public class ActionSet extends ActionBase
动画组,动画组里可以包含很多子动画(ActionBase)
动画组根据编排规则,有两种模式Dependent及Independent
Dependent模式 : 所有的子Action都在当前ActionSet的startTime ~ duration下运行,子Action的startTime都是以ActionSet的startTime开始的
该模式下,所有的子动画的startTime均会被强制设置成0,只有startOffset及duration起作用,
且子动画的开始时间为animationSet.startTime + startOffset, 子动画的duration不会超过ActionSet的duration
例子:
ActionSet |------------------------------------|
Action1 |--------|
Action2 |---------------------------|
当ActionSet挪动时,Action1,Action2也会跟随移动,如下
ActionSet |---------------------------------|
Action1 |--------|
Action2 |------------------------|
Independent模式 : 该模式下,所有的子动画的时间轴是独立纯在的,和ActionSet无关,
如果ActionSet的时间轴没有设置的情况下, 则它的时间轴是所有子节点的并集,此时,ActionSet的时间轴并无实际作用,规则如下
ActionSet.startTime = min(childActions.startTime)
ActionSet.duration = min(childActions.duration),
如果ActionSet的时间轴有设置的情况下,则底下的所有的子节点的时间轴以ActionSet的为准,即
如果ActionSet设置过startTime,childActions.startTime = ActionSet.startTime
如果ActionSet设置过duration,childActions.duration = ActionSet.duration
例子:
ActionSet未设置过startTime,duration
ActionSet |-----------------------| 无实际含义及作用
Action1 |--------|
Action2 |------------------------|
ActionSet设置过startTime,duration
ActionSet |-----------------------|
Action1 |-----------------------|
Action2 |-----------------------|
| Modifier and Type | Class and Description |
|---|---|
static class |
ActionSet.AnimationMode |
ActionBase.Interpolator, ActionBase.PartParam, ActionBase.RepeatMode, ActionBase.Scope, ActionBase.TypemAnimationConfig, mDuration, mFillAfter, mFillBefore, mId, mInterpolatorType, mIsStream, mPartParam, mRepeatCount, mRepeatMode, mScope, mStartOffset, mTargetId, mTimelineIn, mTimelineOut, mType| Constructor and Description |
|---|
ActionSet() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAction(ActionBase aActionBase) |
void |
setAnimationConfig(java.lang.String animationConfig)
自定义动画的配置脚本,开发者可以自行配置每种动画在每一个时间刻度的具体动画值,以实现各种各样的变换速度
配置脚本的格式是采用键值对,是以分号";"为间隔的键值对列表,键就是时间刻度,值则分单值和双值,比如旋转角度这种只需要描述角度值,
则使用单值,而像位移、缩放这种,需要x,y的值,则使用双值,双值的两个值之间用逗号","间隔,键和值之间以冒号":"间隔。
举例:旋转角度变化的"0.0:0.123;0.1:0.245;0.3:0.798"。
位移变化的"0.0:0.234,1.47;0.1:2.3,4.565;0.2:3.45,6.78"
|
void |
setMode(ActionSet.AnimationMode aMode) |
equals, getAnimationConfig, getDuration, getDuration, getId, getResId, getStartTime, getStartTime, getTargetId, getTimelineIn, getTimelineOut, getType, isStream, setDuration, setDuration, setFillAfter, setFillBefore, setId, setInterpolatorType, setIsStream, setPartParam, setRepeatCount, setRepeatMode, setResId, setScope, setStartOffset, setStartTime, setStartTime, setTargetId, setTimelineIn, setTimelineOut, setTypepublic void addAction(ActionBase aActionBase)
public void setMode(ActionSet.AnimationMode aMode)
public void setAnimationConfig(java.lang.String animationConfig)
ActionBase自定义动画的配置脚本,开发者可以自行配置每种动画在每一个时间刻度的具体动画值,以实现各种各样的变换速度 配置脚本的格式是采用键值对,是以分号";"为间隔的键值对列表,键就是时间刻度,值则分单值和双值,比如旋转角度这种只需要描述角度值, 则使用单值,而像位移、缩放这种,需要x,y的值,则使用双值,双值的两个值之间用逗号","间隔,键和值之间以冒号":"间隔。 举例:旋转角度变化的"0.0:0.123;0.1:0.245;0.3:0.798"。 位移变化的"0.0:0.234,1.47;0.1:2.3,4.565;0.2:3.45,6.78"
setAnimationConfig in class ActionBaseanimationConfig - 配置脚本