blackberry / WebWorks

BlackBerry WebWorks for Smartphones is a platform for building deeply integrated web applications for BlackBerry smartphones
http://developer.blackberry.com/html5
268 stars 51 forks source link

Bug: <rim:orientation> causing apps to orient sideways #93

Closed jcarty closed 12 years ago

jcarty commented 12 years ago

Hey guys,

When using rim:orientation 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.

:)

jcarty commented 12 years ago

Forgot to mention that this was tested on a 9790 running 7.0.0.344 using WebWorks 2.3.

kwallis commented 12 years ago

Thanks Jerome. We'll try to fix for the next release. At this point, we won't be able to support a new tag though.

----- Original Message ----- From: Jerome Carty [mailto:reply@reply.github.com] Sent: Tuesday, January 31, 2012 05:47 PM To: Ken Wallis Subject: [WebWorks] Bug: rim:orientation causing apps to orient sideways (#93)

Hey guys,

When using rim:orientation 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.

:)


Reply to this email directly or view it on GitHub: https://github.com/blackberry/WebWorks/issues/93


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

kwallis commented 12 years ago

Included in 2.3.1 release