Skip to main content
TrackerAnimation defines how an animation should be applied to a tracker, including priority, conditions, and lifecycle callbacks.

Package

Type Parameters

  • T - The type of tracker this animation applies to

Record Components

Since: 2.2.0

Static Methods

builder(String)

Creates a new builder for a TrackerAnimation. Parameters:
  • name - The name of the animation
Returns: A new builder instance Since: 2.2.0

Instance Methods

compareTo(TrackerAnimation)

Compares animations by priority (higher first), then by name alphabetically. Implements Comparable<TrackerAnimation<T>>.

Builder Class

The TrackerAnimation.Builder provides a fluent API for constructing tracker animations.

Builder Methods

type(Class)

Changes the target tracker type for this builder. Parameters:
  • newTargetClass - The new target class
Returns: A new builder for the specified type Since: 2.2.0

priority(int)

Sets the priority of the animation. Higher values take precedence. Parameters:
  • priority - The priority value
Returns: This builder Since: 2.2.0

check(Predicate)

Sets the condition that must be met for the animation to play. Parameters:
  • applyCondition - The condition predicate
Returns: This builder Since: 2.2.0

modifier(Function)

Sets the function that provides an AnimationModifier. Parameters:
  • modifierBuilder - Function providing the modifier
Returns: This builder Since: 2.2.0

onRemove(Consumer)

Sets the task to run when the animation is removed. Parameters:
  • removeTask - The removal task
Returns: This builder Since: 2.2.0

onSuccess(Consumer)

Sets the task to run when the animation starts successfully. Parameters:
  • successTask - The success task
Returns: This builder Since: 2.2.0

onFallback(Consumer)

Sets the task to run when the animation fails to start. Parameters:
  • fallbackTask - The fallback task
Returns: This builder Since: 2.2.0

build()

Builds the TrackerAnimation instance. Returns: The constructed animation Since: 2.2.0

Usage Examples

Basic Tracker Animation

Animation with Modifier

Animation with Lifecycle Hooks

Conditional Animation

Type-Specific Animation

Priority-Based Animation System

Animation with Dynamic Speed

Cleanup on Animation End

State-Based Animation

Animation Override System

See Also