Picture scroll field sample app
The picture scroll field sample application demonstrates how to create and customize a row of images that BlackBerry device users can scroll through on their screens. You can specify different highlight styles and turn the center lens on and off to demonstrate different configurations of a PictureScrollField object. If you click an image, the sample application displays a simple message.
This file defines the PictureScrollFieldDemo class.
The PictureScrollFieldDemo class extends the UiApplication class to support a UI and contains the following constructor and methods:
This file defines the PictureScrollFieldDemoScreen class.
The PictureScrollFieldDemoScreen class extends the MainScreen class to support screen characteristics that are common to standard BlackBerry device applications, implements the FieldChangeListener interface to support the handling of field change events, and contains the following constructor and methods:
This sample features the following classes:
This class represents a row of images that a BlackBerry device user can browse and click by scrolling side to side. This class provides methods and fields that you can use to define the physical appearance of a PictureScrollField object. You define the content and highlight style of a PictureScrollField object in two of its nested classes, ScrollEntry and HighlightStyle.
The sample application demonstrates how this class uses the ScrollEntry and HighlightStyle nested classes, and how to define the border, background, label visibility, and center lens for the PictureScrollField object.
This class specifies the behaviour of the highlight effect that occurs when a BlackBerry device user focuses on an image in a PictureScrollField object. You define the highlight style by specifying one of the fields that are provided with the class.
In the sample application, you can choose from several highlight styles.
This class represents the individual image entries in a PictureScrollField object. You can specify the images as well as the text for the labels and callouts that appear when a BlackBerry device user focuses on an image.
The sample application creates an array of scroll entries and passes it to a PictureScrollField object.
Install the sample app
Visit www.blackberry.com/go/picturescrollfieldsample to download the sample application.
Extract the picturescrollfielddemo.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 directory>.
In the Add project to <workspace> dialog box, navigate to the folder where you extracted the sample application.
Click the PictureScrollFieldDemo.jdp file.
The sample app is also available in github.
Run the sample app
In the workspace where you added the picturescrollfielddemo project, right-click picturescrollfield.
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 PictureScrollFieldDemo icon.