@Immutable @Utility public final class TimingTrigger extends java.lang.Object
Animator
can be set to start when
another ends using this trigger. For example, to have anim2 start
when anim1 ends, one might write the following:
Trigger trigger = TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP);The returned trigger object can be safely ignored if the code never needs to disarm the trigger.
TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP);
Modifier and Type | Method and Description |
---|---|
static Trigger |
addTrigger(Animator source,
Animator target,
TimingTriggerEvent event)
Creates a non-auto-reversing timing trigger and adds it as a target to the
source animation.
|
static Trigger |
addTrigger(Animator source,
Animator target,
TimingTriggerEvent event,
boolean autoReverse)
Creates a timing trigger and adds it as a target to the source animation.
|
public static Trigger addTrigger(Animator source, Animator target, TimingTriggerEvent event)
Animator
can be set to start
when another ends using this trigger. For example, to have anim2
start when anim1 ends, one might write the following:
Trigger trigger = TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP);The returned trigger object can be safely ignored if the code never needs to disarm the trigger.
TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP);
source
- the animation that will be listened to for events to start the
target animation.target
- the animation that will start when the event occurs.event
- the TimingTriggerEvent
on source that will cause
target to start.java.lang.IllegalArgumentException
- if any of the parameters is null
.public static Trigger addTrigger(Animator source, Animator target, TimingTriggerEvent event, boolean autoReverse)
Animator
can be set to start when another ends and
visa versa using this trigger. For example, to have anim2 start
when anim1 ends and visa versa, have anim2 stop when
anim1 starts, one might write the following:
Trigger trigger = TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP, true);The returned trigger object can be safely ignored if the code never needs to disarm the trigger.
TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP, true);
source
- the animation that will be listened to for events to start the
target animation.target
- the animation that will start when the event occurs.event
- the TimingTriggerEvent
on source that will cause
target to start.autoReverse
- true
if the animation should be reversed on opposite
trigger events, false
otherwise.java.lang.IllegalArgumentException
- if any of the parameters is null
.