Last Updated: February 25, 2016
·
957
· ilyax

Screen Animation with BlackBerry

static TransitionContext transitionContextIn;
static TransitionContext transitionContextOut;
static UiEngineInstance engine = Ui.getUiEngineInstance();

public static void Slide(Screen screen){

transitionContextIn = new TransitionContext(TransitionContext.TRANSITIONSLIDE);
transitionContextIn.setIntAttribute(TransitionContext.ATTR
DURATION, 1000);
transitionContextIn.setIntAttribute(TransitionContext.ATTRDIRECTION, TransitionContext.DIRECTIONUP);

transitionContextOut = new TransitionContext(TransitionContext.TRANSITIONSLIDE);
transitionContextOut.setIntAttribute(TransitionContext.ATTR
DURATION, 1000);
transitionContextOut.setIntAttribute(TransitionContext.ATTRDIRECTION, TransitionContext.DIRECTIONDOWN);
transitionContextOut.setIntAttribute(TransitionContext.ATTRKIND, TransitionContext.KINDOUT);

engine.setTransition(null, screen, UiEngineInstance.TRIGGERPUSH, transitionContextIn);
engine.setTransition(screen, null, UiEngineInstance.TRIGGER
POP, transitionContextOut);
}

Picture