Window Covers

The cover namespace provides the ability to modify the application's window cover which is displayed when the application is in thumbnail mode.

Device showing window covers.

Learning Resources:

Sample - Using Window Covers Sample that demonstrates how to use the BlackBerry Window Covers API [BlackBerry on GitHub].

Supported Platform(s)

- BlackBerry 10
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
resetCover           Y 
setContent           Y 
setTransition           Y 
updateCover           Y 
coverSize           Y 
labels           Y 
showBadges           Y 
TYPE_IMAGE           Y 
TYPE_SNAPSHOT           Y 
TRANSITION_FADE           Y 
TRANSITION_NONE           Y 
TRANSITION_SLIDE           Y 
TRANSITION_DEFAULT           Y 
entercover           Y 
exitcover           Y 

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

You must declare the feature element(s) below in your configuration document:

Feature IDBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
<feature id="blackberry.ui.cover" />           Y 

Permission Elements (PlayBook and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Functions


Events

void entercover
void exitcover


Constants

Functions

void resetCover ()


resets the window cover to default behavior: scaled snapshot on entering window cover


Supported Platforms
 - BlackBerry 10


Code Example:
<script type="text/javascript">

blackberry.ui.cover.resetCover();

</script>

void setContent (type : String, options : Object)


sets content for application's window cover. See constants.


Supported Platforms
 - BlackBerry 10


Parameters
type type of content to be displayed
options contains relevant information based on type

path: path to image to display for window cover, necessary for image mode
x: starting x for cover snapshot, necessary for snapshot mode
y: starting y for cover snapshot, necessary for snapshot mode
width: snapshot width, necessary for snapshot mode
height: snapshot height, necessary for snapshot mode

void setTransition (transition : String)


Sets the application's window cover transition. The default transition is TRANSITION_SLIDE.


Supported Platforms
 - BlackBerry 10


Parameters
transition See constants

Code Example:
<script type="text/javascript">

blackberry.ui.cover.setTransition(blackberry.ui.cover.TRANSITION_FADE);

</script>

void updateCover ()


updates the application's window cover


Supported Platforms
 - BlackBerry 10


Code Example:
<script type="text/javascript">

blackberry.ui.cover.updateCover();

</script>

Events

void entercover ()


The entercover event is triggered whenever the the application displays the window cover in thumbnail mode.


Supported Platforms
 - BlackBerry 10


Code Example:
<script type="text/javascript">

function onEnterCover() {
  blackberry.ui.cover.updateCover();
}

blackberry.event.addEventListener("entercover", onEnterCover);

</script>

void exitcover ()


The exitcover event is triggered whenever the the application removes the window cover exiting thumbnail mode.


Supported Platforms
 - BlackBerry 10


Code Example:
<script type="text/javascript">

function onExitCover() {
  console.log("app is exiting cover mode");
}

blackberry.event.addEventListener("exitcover", onExitCover);

</script>

Properties

Object coverSize


The application's cover dimensions, contains a width and height (in pixels)


Supported Platforms
 - BlackBerry 10

blackberry.ui.cover.CoverLabel[] labels


list of labels to be displayed on the window cover


Supported Platforms
 - BlackBerry 10

Boolean showBadges


Should the window cover show notification badges. The default value is true.


Supported Platforms
 - BlackBerry 10

Constants

String TYPE_IMAGE


Specifies image mode


Supported Platforms
 - BlackBerry 10

String TYPE_SNAPSHOT


Specifies snapshot mode


Supported Platforms
 - BlackBerry 10

String TRANSITION_FADE


Specifies fade window cover transition


Supported Platforms
 - BlackBerry 10

String TRANSITION_NONE



Supported Platforms
 - BlackBerry 10

String TRANSITION_SLIDE


Specifies slide window cover transition


Supported Platforms
 - BlackBerry 10

String TRANSITION_DEFAULT


Specifies default window cover transition


Supported Platforms
 - BlackBerry 10

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Feb 11 2013 14:51:05 GMT-0500 (EST)