Sorry about the red box, but we really need you to update your browser. Read this excellent article if you're wondering why we are no longer supporting this browser version. Go to Browse Happy for browser suggestions and how to update.

Screen transitions sample app

The screen transitions sample application demonstrates how to create custom transitions between two screens using the TransitionContext class.

The sample application demonstrates the following animations for transitioning between screens:

  • slide
  • fade
  • wipe
  • zoom

File name

Description

ScreenTransitionsDemo.java

This file contains the following items:

  • the entry point for the sample application
  • the ScreenTransitionsDemo() constructor, which creates and displays the ScreenTransitionsDemoScreen
  • the startOrStopThread() method that pauses or resumes the screen transitions thread
  • the ScreenTransitionsDemoScreen inner class that determines whether the user clicked the trackball or touched the screen and then invokes the startOrStopThread() method
  • the TransitionThread inner class that presents a sequence of different screen transitions

TransitionScreen.java

This file contains the TransitionScreen constructor that creates a screen to display before the screen transition occurs.

This sample features the following classes:

net.rim.device.api.ui.TransitionContext

This class provides methods for specifying the type and attributes for each screen transition.

The sample application displays a sequence of screens using the following transitions:

Transition type Description
fade

This transition displays or removes a screen by fading the screen in or out, respectively. The fading in effect occurs by varying the opacity level of the first screen from 0% to 100%. The second screen fades out by varying the opacity level from 100% to 0%.

slide

This transition displays or removes a screen by sliding the screen on or off the display of the BlackBerry device. You can specify the direction in which the screen enters or leaves the display, as well as the style of the outgoing screen. The outgoing screen can be pushed off the display or an incoming screen can slide over the outgoing screen.

wipe

This transition displays or removes a screen by wiping the screen on or off the display. You can specify the direction in which the screen enters or leaves the display.

zoom

This transition displays or removes a screen by zooming in or out.

Install the sample app

Visit www.blackberry.com/go/screentransitionssample to download the sample application.

Extract the screentransitionsdemo.zip file.

On the taskbar, click Start > Programs > Research In Motion > BlackBerry JDE 5.0 > JDE.

Open the workspace that you want to add the sample application to.

In the workspace tree, right-click the project that you want to add the sample application to.

Click Add project to <workspace folder>.

In the Add project to <workspace> dialog box, navigate to the folder where you extracted the sample application.

Click the ScreenTransitionsDemo.jdp file.

Click Open.

The sample app is also available in github.

Run the sample app

In the workspace where you added the screentransitionsdemo project, right-click screentransitionsdemo.

Click Build project.

On the taskbar, click Start > Applications > Research in Motion > BlackBerry JDE 5.0 > Device Simulator.

On the Home screen of the BlackBerry Smartphone Simulator, click the Downloads folder.

Click the Screen Transitions Demo icon.