How to use AnimationListenerRegistry

AnimationListenerRegistry is a class that has been added to Widget library since version 2.2.0. It holds a list of listeners that are notified when animations start and stop.

These classes register animations in the AnimationListenerRegistry (in Widget 2.4.1):

Adding a listener to this registry may be useful:

  • to stop other animation that may slow down the animation,
  • to stop a computation that uses a lot the CPU,
  • to reduce the quality of a rendering (using nearest neighbour algorithm instead of bilinear interpolation for example),
  • etc.

TransitionContainer also provides a way to add an AnimationStepListener that will be notified for each step of the transition.

1 Like