Package ej.navigation.transition
Class FadeTransition
- java.lang.Object
-
- ej.navigation.transition.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
-
-
Field Summary
-
Fields inherited from interface ej.navigation.transition.Transition
DEFAULT_DURATION_MILLIS, IMMEDIATE
-
-
Constructor Summary
Constructors Constructor Description FadeTransition()Creates a fade with the default duration.FadeTransition(int duration)Creates a fade with the given duration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun(TransitionContext context, TransitionListener listener)Animates the page change described by the given context.
-
-
-
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:TransitionAnimates 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:
runin interfaceTransition- 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.
-
-