blackberry/WebWorks — Issue #93: Bug: <rim:orientation> causing apps to orient sideways
Author: jcarty
Created: 2012-01-31 22:47:13+00:00
State: open

Hey guys,

When using on smartphones, the application orients on the screen sideways (as if its locked to portrait). After examining the code, it seems to be rotating to portrait if that is what's specified in the config.xml.

https://github.com/blackberry/WebWorks/blob/master/framework/src/blackberry/web/widget/Widget.java#L61

What I propose is that you support both orientation and direction.

http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/system/Display.html

Display.ORIENTATION_PORTRAIT, where the vertical resolution is larger than the horizontal resolution;
Display.ORIENTATION_LANDSCAPE, where the horizontal resolution is larger than the vertical resolution; and
Display.ORIENTATION_SQUARE, where both vertical and horizontal resolution are equal.

Display.DIRECTION_NORTH is when the top of the drawable area is the screen side closest to the BlackBerry logo;
Display.DIRECTION_WEST is when the top of the drawable area is to the left of the logo;
Display.DIRECTION_EAST is when the top of the drawable area is to the right of the logo;

If you choose not to support orientation and direction, setting DIRECTION_NORTH, instead of DIRECTION_PORTRAIT, should fix the problem. Most developers would expect an app locked in portrait to behave like DIRECTION_NORTH regardless of terminology. Landscape would behave the same on both portrait and landscape-oriented devices so two-birds, one stone.

:)