Orientation Support Mobile

Ralph DiMola rdimolad at evergreeninfo.net
Mon Sep 8 01:39:06 EDT 2014


Mobile Orientation change cookbook:
1. Device is flipped. 
2. The resizestack message is sent before the card is rendered (orientationchanged message is sent after).
2. In the resizestack handler reposition your controls. 
3. During this message no screen updates are done. 
4. The user will see the screen flip with the previous layout. 
5. When the resizestack message completes the new layout is rendered. 
6. Pass the resizestack message after repositioning your controls or strange things will occur.

This works equally well with both Android and iOS. 

Now I don't know how this works if you're changing cards as I reposition controls on the same card. I would guess opening a new card in the resizestack message will yield similar results.  I will try it when I get back.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net




<div>-------- Original message --------</div><div>From: Mike Kerner <MikeKerner at roadrunner.com> </div><div>Date:09/07/2014  20:38  (GMT-08:00) </div><div>To: How to use LiveCode <use-livecode at lists.runrev.com> </div><div>Subject: Re: Orientation Support Mobile </div><div>
</div>Well, for starters:
1) You can't seem to force LC to render a card in one orientation or the
other and then understand what you're forcing it to do.  There doesn't seem
to be a command to do it.  MobileSetAllowedOrientations doesn't help.  So
if you support P and L, but certain cards are one way and certain the
other, and the app opens in the one you didn't want, you have an issue.
Let's say you do mobileSetAllowedOrientations to portrait, and you flip
the device sideways.  When you open the app, the app will render in
portrait, but it will think that its width and height are for landscape,
which makes rendering a bit challenging.
2) How do you lay out your cards for P and L?  You could have custom
properties, (do it the old MG way, before MG stopped supporting rotating),
but that creates a layout issue, in that you have to build the properties
for as many objects as you have on a card, and then deal with rearranging
the layout when the orientation changes.
3) If you try to overcome #2 with a substack for P and a substack for L,
then you have an event issue, because going from card 1 of substack P to
card 2 of substack L isn't going to send a closeCard event to card 1 of
substack P, which means that if you were using closeCard to dispose of your
native controls...you have to do something else, and the transition isn't
smooth.
4) There are issues with getting LC to render objects consistently when
switching orientations, which I would imagine is why John stopped
supporting orientation switching in MG.  Sometimes, when you rotate the
device, not everything goes where one might hope it would.  I still haven't
gotten to the bottom of that one.



On Sun, Sep 7, 2014 at 10:04 PM, Colin Holgate <coiin at verizon.net> wrote:

> I have used landscape and portrait in the same app outside of LiveCode,
> and certainly ran into issues. I think that in LiveCode you would want to
> enable all orientations, then listen for the orientationChanged message.
> Then, in theory, you could react accordingly.
>
> Can you go into more detail about issues you’ve hit?
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


More information about the use-livecode mailing list