Package net.rim.device.api.ui

Examples of net.rim.device.api.ui.TransitionContext


            _selectedIndex);
       
        final UiApplication uiApp = UiApplication.getUiApplication();
       
        // Now create the zooming transition effect to make the spinner appear
        TransitionContext transition = new TransitionContext(TransitionContext.TRANSITION_ZOOM);
        transition.setIntAttribute(TransitionContext.ATTR_DURATION, 250);
        transition.setIntAttribute(TransitionContext.ATTR_KIND, TransitionContext.KIND_IN);
       
        UiEngineInstance engine = uiApp.getUiEngineInstance();
        engine.setTransition(null, customSpinnerPopup, UiEngineInstance.TRIGGER_PUSH, transition);

        transition = new TransitionContext(TransitionContext.TRANSITION_ZOOM);
        transition.setIntAttribute(TransitionContext.ATTR_DURATION, 250);
        transition.setIntAttribute(TransitionContext.ATTR_KIND, TransitionContext.KIND_OUT);
        engine.setTransition(customSpinnerPopup, null, UiEngineInstance.TRIGGER_POP, transition);
     
        // Push the screen to the foreground
        uiApp.pushModalScreen(customSpinnerPopup);
        Object[] result = new Object[1];
View Full Code Here


    }

    private void setTransition() {
        if( _widgetConfigImpl.getTransitionType() != TransitionConstants.TRANSITION_NONE ) {

            TransitionContext transitionContext = null;

            switch( _widgetConfigImpl.getTransitionType() ) {
                case TransitionConstants.TRANSITION_SLIDEPUSH: {
                    transitionContext = new TransitionContext( TransitionContext.TRANSITION_SLIDE );
                    transitionContext.setIntAttribute( TransitionContext.ATTR_KIND, TransitionContext.KIND_IN );
                    transitionContext.setIntAttribute( TransitionContext.ATTR_STYLE, TransitionContext.STYLE_PUSH );
                    break;
                }
                case TransitionConstants.TRANSITION_SLIDEOVER: {
                    transitionContext = new TransitionContext( TransitionContext.TRANSITION_SLIDE );
                    transitionContext.setIntAttribute( TransitionContext.ATTR_KIND, TransitionContext.KIND_IN );
                    transitionContext.setIntAttribute( TransitionContext.ATTR_STYLE, TransitionContext.STYLE_OVER );
                    break;
                }
                case TransitionConstants.TRANSITION_FADEIN: {
                    transitionContext = new TransitionContext( TransitionContext.TRANSITION_FADE );
                    transitionContext.setIntAttribute( TransitionContext.ATTR_KIND, TransitionContext.KIND_IN );
                    break;
                }
                case TransitionConstants.TRANSITION_FADEOUT: {
                    transitionContext = new TransitionContext( TransitionContext.TRANSITION_FADE );
                    transitionContext.setIntAttribute( TransitionContext.ATTR_KIND, TransitionContext.KIND_OUT );
                    break;
                }
                case TransitionConstants.TRANSITION_WIPEIN: {
                    transitionContext = new TransitionContext( TransitionContext.TRANSITION_WIPE );
                    transitionContext.setIntAttribute( TransitionContext.ATTR_KIND, TransitionContext.KIND_IN );
                    break;
                }
                case TransitionConstants.TRANSITION_WIPEOUT: {
                    transitionContext = new TransitionContext( TransitionContext.TRANSITION_WIPE );
                    transitionContext.setIntAttribute( TransitionContext.ATTR_KIND, TransitionContext.KIND_OUT );
                    break;
                }
                case TransitionConstants.TRANSITION_ZOOMIN: {
                    transitionContext = new TransitionContext( TransitionContext.TRANSITION_ZOOM );
                    transitionContext.setIntAttribute( TransitionContext.ATTR_KIND, TransitionContext.KIND_IN );
                    break;
                }
                case TransitionConstants.TRANSITION_ZOOMOUT: {
                    transitionContext = new TransitionContext( TransitionContext.TRANSITION_ZOOM );
                    transitionContext.setIntAttribute( TransitionContext.ATTR_KIND, TransitionContext.KIND_OUT );
                    break;
                }
            }

            if( transitionContext != null ) {
                transitionContext.setIntAttribute( TransitionContext.ATTR_DURATION, _widgetConfigImpl.getTransitionDuration() );
                transitionContext.setIntAttribute( TransitionContext.ATTR_DIRECTION, _widgetConfigImpl.getTransitionDirection() );

                UiEngineInstance engine = Ui.getUiEngineInstance();
                engine
                        .setTransition( _screenBrowserField, _screenLoadingScreen, UiEngineInstance.TRIGGER_PUSH,
                                transitionContext );
View Full Code Here

         * @param type
         *            Represents the type of screen transitions to execute
         */
        void push(final int type) {
            TransitionScreen screen = null;
            TransitionContext transitionContextIn;
            TransitionContext transitionContextOut;
            final UiEngineInstance engine = Ui.getUiEngineInstance();
            switch (type) {
            case SLIDE:
                screen = new TransitionScreen("Slider", Color.BEIGE);

                transitionContextIn =
                        new TransitionContext(
                                TransitionContext.TRANSITION_SLIDE);
                transitionContextIn.setIntAttribute(
                        TransitionContext.ATTR_DURATION, 1000);
                transitionContextIn.setIntAttribute(
                        TransitionContext.ATTR_DIRECTION,
                        TransitionContext.DIRECTION_UP);

                transitionContextOut =
                        new TransitionContext(
                                TransitionContext.TRANSITION_SLIDE);
                transitionContextOut.setIntAttribute(
                        TransitionContext.ATTR_DURATION, 1000);
                transitionContextOut.setIntAttribute(
                        TransitionContext.ATTR_DIRECTION,
                        TransitionContext.DIRECTION_DOWN);
                transitionContextOut
                        .setIntAttribute(TransitionContext.ATTR_KIND,
                                TransitionContext.KIND_OUT);

                engine.setTransition(null, screen,
                        UiEngineInstance.TRIGGER_PUSH, transitionContextIn);
                engine.setTransition(screen, null,
                        UiEngineInstance.TRIGGER_POP, transitionContextOut);
                break;
            case FADE:
                screen = new TransitionScreen("Fade", Color.TEAL);

                transitionContextIn =
                        new TransitionContext(TransitionContext.TRANSITION_FADE);
                transitionContextIn.setIntAttribute(
                        TransitionContext.ATTR_DURATION, 1000);

                transitionContextOut =
                        new TransitionContext(TransitionContext.TRANSITION_FADE);
                transitionContextOut.setIntAttribute(
                        TransitionContext.ATTR_DURATION, 1000);
                transitionContextOut
                        .setIntAttribute(TransitionContext.ATTR_KIND,
                                TransitionContext.KIND_OUT);

                engine.setTransition(null, screen,
                        UiEngineInstance.TRIGGER_PUSH, transitionContextIn);
                engine.setTransition(screen, null,
                        UiEngineInstance.TRIGGER_POP, transitionContextOut);
                break;
            case WIPE:
                screen = new TransitionScreen("Wipe", Color.LIGHTBLUE);

                transitionContextIn =
                        new TransitionContext(TransitionContext.TRANSITION_WIPE);
                transitionContextIn.setIntAttribute(
                        TransitionContext.ATTR_DURATION, 1000);
                transitionContextIn.setIntAttribute(
                        TransitionContext.ATTR_DIRECTION,
                        TransitionContext.DIRECTION_LEFT);

                transitionContextOut =
                        new TransitionContext(TransitionContext.TRANSITION_WIPE);
                transitionContextOut.setIntAttribute(
                        TransitionContext.ATTR_DURATION, 1000);
                transitionContextOut.setIntAttribute(
                        TransitionContext.ATTR_DIRECTION,
                        TransitionContext.DIRECTION_RIGHT);
                transitionContextOut
                        .setIntAttribute(TransitionContext.ATTR_KIND,
                                TransitionContext.KIND_OUT);

                engine.setTransition(null, screen,
                        UiEngineInstance.TRIGGER_PUSH, transitionContextIn);
                engine.setTransition(screen, null,
                        UiEngineInstance.TRIGGER_POP, transitionContextOut);
                break;
            case ZOOM:
                screen = new TransitionScreen("Zoom", Color.LIGHTGREEN);

                transitionContextIn =
                        new TransitionContext(TransitionContext.TRANSITION_ZOOM);
                transitionContextIn.setIntAttribute(
                        TransitionContext.ATTR_DURATION, 1000);

                transitionContextOut =
                        new TransitionContext(TransitionContext.TRANSITION_ZOOM);
                transitionContextOut.setIntAttribute(
                        TransitionContext.ATTR_DURATION, 1000);
                transitionContextOut
                        .setIntAttribute(TransitionContext.ATTR_KIND,
                                TransitionContext.KIND_OUT);

                engine.setTransition(null, screen,
                        UiEngineInstance.TRIGGER_PUSH, transitionContextIn);
View Full Code Here

        final LabelField type =
                new LabelField("Barcode Type: "
                        + result.getBarcodeFormat().toString());
        type.setPadding(4, 4, 4, 4);

        final TransitionContext context =
                new TransitionContext(TransitionContext.TRANSITION_SLIDE);
        context.setIntAttribute(TransitionContext.ATTR_DIRECTION,
                TransitionContext.KIND_OUT);

        Ui.getUiEngineInstance().setTransition(null, resultsScreen,
                UiEngineInstance.TRIGGER_PUSH, context);
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.TransitionContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.