I think this is a place where OpenLaszlo could potentially really shine,
through the use of constraints. You don't _really_ need to know about screen
"orientation" since you should be able to deduce it from the canvas dimesions:
function screenOrientation () {
return canvas.width > canvas.height ? 'landscape' : 'portrait';
}
A careful OL app will use constraints to optimize itself to the canvas
dimensions and thus work in resizable browser windows, on platforms with
various screen dimensions, etc. If the app wants to present different layouts
based on landscape or portrait orientation, why should it base that on some
hardware device sensor? I should be able to resize my browser window and get
the same layout.
On 2010-07-12, at 08:19, Raju Bitter wrote:
> After my first weeks of testing OpenLaszlo+PhoneGap on Android I think
> one of the first improvement the LFC needs would be support for screen
> orientation. Probably
>
> a) a canvas attribute storing the orientation value
> For the iOS possible values are:
> 1) UIInterfaceOrientationPortrait
> 2) UIInterfaceOrientationPortraitUpsideDown
> 4) UIInterfaceOrientationLandscapeLeft
> 5) UIInterfaceOrientationLandscapeRight
>
> Android default modes are portrait and landscape.
>
> b) a canvas event in case the screen orientation changes
>
> http://jira.openlaszlo.org/jira/browse/LPP-9048
>
> For Android/PhoneGap we'd need to extend the DroidGap class to send an
> event into JavaScript/canvas in case of layout/orientation change, it
> doesn't seem to be supported through JavaScript, at least for 2.1.