Class FadeTransition

  • All Implemented Interfaces:
    Transition

    public class FadeTransition
    extends Object
    implements Transition
    A transition that fades the incoming content in over the outgoing one.

    The incoming content's opacity is interpolated linearly from fully transparent to fully opaque over the configured duration, cross-dissolving from the outgoing content.

    Since:
    0.2.0
    • Constructor Detail

      • FadeTransition

        public FadeTransition()
        Creates a fade with the default duration.
      • FadeTransition

        public FadeTransition​(int duration)
        Creates a fade with the given duration.
        Parameters:
        duration - the fade duration, in milliseconds; must be strictly positive.
        Throws:
        IllegalArgumentException - if the given duration is not strictly positive.
    • Method Detail

      • run

        public void run​(TransitionContext context,
                        TransitionListener listener)
        Description copied from interface: Transition
        Animates the page change described by the given context.

        Called on the MicroUI thread once per navigation. The implementation must call TransitionListener.onTransitionEnd() exactly once when the animation is finished.

        Specified by:
        run in interface Transition
        Parameters:
        context - the stage exposing the contents, the content area size, and the animation primitives.
        listener - the listener to notify once, when the transition finishes.