Click here to Skip to main content
13,151,807 members (59,606 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

12.3K views
1 bookmarked
Posted 15 Feb 2012

iPhone Slide Effect in BlackBerry

, 18 Feb 2012
Rate this:
Please Sign up or sign in to vote.

Introduction


This article introduces the famous iPhone Master/Details Screens slide effect, to be applied in BlackBerry platform.

Using the Code


Our first screen "FirstScreen.java" (Master) only contains clickable fields (i.e. ButtonFields) that will push the details screen.

In the "SecondScreen.java" (Details), we should register in the constructor of the screen; how the screen will be pushed and pop: and defining the Transition Type, Speed (Duration), and Direction:


//Entering Transition
TransitionContext transition = new TransitionContext(TransitionContext.TRANSITION_SLIDE);
transition.setIntAttribute(TransitionContext.ATTR_DURATION, 500);
transition.setIntAttribute(TransitionContext.ATTR_DIRECTION,TransitionContext.DIRECTION_LEFT);
transition.setIntAttribute(TransitionContext.ATTR_STYLE,TransitionContext.STYLE_OVER);
 
UiEngineInstance engine = Ui.getUiEngineInstance();
engine.setTransition(null, this, UiEngineInstance.TRIGGER_PUSH,transition);
 
// Leaving Transition
transition = new TransitionContext(TransitionContext.TRANSITION_SLIDE);
transition.setIntAttribute(TransitionContext.ATTR_DURATION, 500);
transition.setIntAttribute(TransitionContext.ATTR_DIRECTION,TransitionContext.DIRECTION_RIGHT);
transition.setIntAttribute(TransitionContext.ATTR_STYLE,TransitionContext.STYLE_PUSH);
        
engine.setTransition(this, null, UiEngineInstance.TRIGGER_POP,transition);

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Antoun Gorgy
Software Developer
Egypt Egypt
- BSc Computer Engineering
Ain Shams University - Faculty of Engineering

You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170924.2 | Last Updated 18 Feb 2012
Article Copyright 2012 by Antoun Gorgy
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid