Skip to content

Timeline

final class Timeline
Extends: BaseTween<Timeline>
Package: dev.joid.lib.animation.tween · Module: core · Source: Timeline.java

Plays tweens and other timelines one after the other or all together, as one tween.

Timeline.sequence() plays its children in order; Timeline.parallel() plays them together and lasts as long as the longest. beginSequence() and beginParallel() open a nested block that end() closes.

A timeline takes its children before start(): after it, push(...), pushPause(...), begin...() and end() throw an IllegalStateException. At the start, a child that repeats forever throws an IllegalArgumentException and a block left open throws an IllegalStateException.

Animate values of your own chains two tweens in a sequence that plays back and forth forever.

ReturnsSignatureSummary
Timelinesequence() factoryCreates a timeline that plays its children one after the other.
Timelineparallel() factoryCreates a timeline that plays its children together.

ReturnsSignatureSummary
thispush(Tween tween) fluentAdds tween to the open block, then returns this timeline.
thispush(Timeline timeline) fluentAdds timeline to the open block, then returns this timeline.
thispushPause(float time) fluentAdds a wait of time ms to the open block, then returns this timeline.
thisbeginSequence() fluentOpens a nested block whose children play one after the other, then returns this timeline.
thisbeginParallel() fluentOpens a nested block whose children play together, then returns this timeline.
thisend() fluentCloses the last block opened, then returns this timeline.
List<BaseTween<?>>getChildren()Returns the children of the top level, read-only; a nested block is one child.
Inherited from BaseTween (25)

getFullDuration · isFinished · getDelay · isYoyo · getRepeatCount · getDuration · getRepeatDelay · getStep · isPaused · getCurrentTime · isStarted · isInitialized · getUserData · start · build · kill · pause · resume · delay · repeat · repeatYoyo · userData · forceToStart · forceToEnd · update

Inherited from BaseTween (8)

onStart · onIterationStart · onIterationEnd · onComplete · onReverseStart · onReverseIterationStart · onReverseIterationEnd · onReverseComplete

Timeline sequence() factory

Creates a timeline that plays its children one after the other.

Timeline parallel() factory

Creates a timeline that plays its children together.

this push(Tween tween) fluent

Adds tween to the open block, then returns this timeline.

this push(Timeline timeline) fluent

Throws:

  • IllegalArgumentException: The pushed timeline still has an open beginSequence() or beginParallel(), close each one with end() before pushing it

Adds timeline to the open block, then returns this timeline. Throws an IllegalArgumentException when timeline still has a block open.

this pushPause(float time) fluent

Adds a wait of time ms to the open block, then returns this timeline.

this beginSequence() fluent

Opens a nested block whose children play one after the other, then returns this timeline.

this beginParallel() fluent

Opens a nested block whose children play together, then returns this timeline.

this end() fluent

Throws:

  • IllegalStateException: The timeline has no open beginSequence() or beginParallel() to close, remove this end()

Closes the last block opened, then returns this timeline. Throws an IllegalStateException when no block is open.

List<BaseTween<?>> getChildren()

Returns the children of the top level, read-only; a nested block is one child.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page