[mobile:Android] mobileSetAllowedOrientations gives error

Roger Eller roger.e.eller at sealedair.com
Sun Jun 5 18:00:58 EDT 2011


On Sun, Jun 5, 2011 at 1:53 PM, J. Landman Gay wrote:

> On 6/5/11 10:47 AM, Roger Eller wrote:
>
>  I am seeing some strange things.
>>
>> So, I have this in preOpenStack:
>>
>> if the environment is "mobile" then
>>      mobileSetAllowedOrientations "landscape right, portrait, portrait
>> upsidedown, landscape left"
>> end if
>>
>> I have discovered that ONLY the first orientation is honored.
>>
>
>  Remove the spaces before each comma. The engine is very literal about
> these. All (supported) orientations work for me.
>

That worked.  :-)

 Also, I want my  default orientation to be "landscape right", but it is
> always portrait.
>

 Yes, I see that too. I think initial orientation isn't supported yet, we
> aren't on par with iOS at this point.


Have you heard anything on how the iOS/Android alignment is coming along at
RunRev?

 I'm seeing that "portrait" and "portrait upside down" are interpreted as
> opposites of what they should be. When I have this script in my stack,
> holding the device in portrait orientation, the OS menubar is upside down
> at
> the bottom of the screen. Rotating the device 180, the menubar moves to the
> bottom again and is still upside down. Both lacdscape orientations are
> correct with the menubar at the top.  What's up with that?
>

My OS is too early to support all four orientations, but maybe if you fix
> the comma-space issue mobileSetAllowedOrientations it will fix itself?
>
>
No such luck.  Both portrait orientations and their menus are still opposite
of what they should be.  My Android version is 2.3.3 and the Kernel version
is 2.6.32.39, in-case that info is useful.

The release notes say: "Note: Due to a limitation in the OS, 'landscape
left' and 'portrait upside-down' orientations are only supported on Android
2.3 and later."

Well, the UPSIDE-DOWN is a unwanted feature!  Non-LC apps for Android appear
to know which way is up.


>
>
>> This script is allowing all 4 orientations to be used, but the portrait
>> orientations are still backwards.
>>
>> on orientationChanged
>>    put mobileDeviceOrientation() into tRot
>>    mobileSetAllowedOrientations (tRot)
>>    mobileUnlockOrientation
>>    resizeStack
>> end orientationChanged
>>
>
> OrientationChanged is sent before orientation actually happens, so tRot
> will be the same orientation that it was before. Resizestack is sent after a
> change in orientation, so you can probably remove the handler above and just
> catch the change in a resizestack handler. Resizestack will report the
> actual, new orientation.
>
>
> --
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
>

˜Roger



More information about the use-livecode mailing list