But then, how do you know the difference between these two states for
iOS, e.g. iPad:
    1) UIInterfaceOrientationPortrait
    2) UIInterfaceOrientationPortraitUpsideDown

And how about devices with a square display, where the width and
height cannot be deduced from a numerical value? Like future devices
running Android...

:-)

On Mon, Jul 12, 2010 at 8:04 PM, P T Withington <[email protected]> wrote:
> I agree with what you are saying, but I am pointing out that the LZX event
> should be based on the display dimensions, not a device sensor. That way,
> even in a browser, I can have the benefit of landscape or portrait
> orientations.
> Another way of looking at it is that a mobile device kernel should
> virtualize changing the orientation of the device as a change in the screen
> dimensions (just as if I had resized a browser window).
>
> On Jul 12, 2010, at 10:26, Quirino Zagarese <[email protected]>
> wrote:
>
> I guess the point is runtime rotation of the device.
> If I rotate my device I would like to have some kind of event or callback in
> order to
> reorganize the UI. Of course I can benefit of constraints, but I need to
> know first the device
> has actually been rotated. If I had to build an Android LZX app,
> I would put a main view in the canvas that rotates accordingly to underlying
> device rotation
> events. Inside it I would use constraints to automatically re-dispose
> components.
> For this purpose, Laszlo is simply great!
>
> Quirino
>
>
> 2010/7/12 P T Withington <[email protected]>
>>
>> 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.
>>
>>
>> _______________________________________________
>> Mobile mailing list
>> [email protected]
>> http://www.openlaszlo.org/mailman/listinfo/mobile
>
>
>
> --
> Quirino Zagarese
>
> PhD Student - Engineering Department - Università degli Studi del Sannio
>
> Italian OpenLaszlo Community  - www.laszloitalia.org
>
> EU4RIA: Laszlo+Java, easily - eu4ria.googlecode.com
>

Reply via email to