Re: Orientation Changes causes Scaling/Stretching

@JRab - well I guess I now know why my splashscreen was never working .... Thanks for the help. Again lol

- If you like my response/post, or it helped you find an answer you were looking for, please provide a Kudo - white star to the bottom right of this post. - - Please use the search bar at the top, or check out the PlayBook FAQ's for help getting started - - Hockey DrillBook -

Re: Orientation Changes causes Scaling/Stretching

In case it helps, below is a shorter sample which works fine here, with this in my application.xml file:

<initialWindow>

....

<visible>true</visible>

<autoOrients>true</autoOrients>

</initialWindow>

Note a few other things that may be related. There are definitely bugs with the simulator, and even if you tried to read everything on the subject you may have missed some of them.

For one thing, of course the basic rotation is screwed up, and after doing the bottom-right swipe you then have to do a bottom-swipe as though minimizing your app, then click on it to restore it.

Furthermore, apps don't respond properly to the re-orientation if they are minimized when you do it. The only way it works for me here is to always bottom-right swipe with my app full-screen, then do the workaround above to restore it. Rotating back goes the same way...

The following puts a label in the upper right, which it updates as you re-orient. It also draws a green line from top-left to bottom-right corner (actually only up to 5 pixels in each direction away from the corners).

Re: Orientation Changes causes Scaling/Stretching

"Furthermore, apps don't respond properly to the re-orientation if they are minimized when you do it. The only way it works for me here is to always bottom-right swipe with my app full-screen, then do the workaround above to restore it. Rotating back goes the same way..."

I think this must be the problem, but i don;t know how to overcome it. I can't reorient the simulator unless i have already swiped up and opened the bottom application menu - which of course minimizes the app.

If the bottom menu is not open my simulator will not re-orient.

I wonder how RIM actually expects to have any apps at all for launch with the dev tools in this sad state. It's shameful, really.

Re: Orientation Changes causes Scaling/Stretching

That's quite odd... I haven't heard of anyone else with that problem yet.

For the record, what platform are you using? (OS and virtual machine program) I'm on Windows 7 with VMWare player v3.1.3.

A long shot (and you may have said already) but have you unzipped your .bar file to examine the actual files stored in it, rather than just assuming that the app.xml that you think is going in there is really going in there?

I haven't set up my portrait layout yet, but my app doesn't scale in strange ways when rotated (it did at one point...); it just shows a cut-off version of the landscape interface aligned to the top-left. I had the "sim won't rotate unless app is minimized" problem too at one point. I'm not sure what I did to fix it, if anything, but it doesn't do it anymore, or hasn't in a while.

Re: Orientation Changes causes Scaling/Stretching

As for the simulator, it is weird I agree. However, it works the same way for my Windows 7 workstation here (64 bit), my Windows XP workstation at work (32 bit), and on a colleagues Windows 7 machine at work (64 bit). So, I am not sure, but this appears to be at least a consistant bug if anything. I would guess that's also why i don't get re-orientation events either. *sigh*

For VMWare I am using whatever the latest player was on their site as of this past week.

For my initial setup I just followed the instructions given in the Getting Started guide step-by-step.

Downloaded VMWare Player, the AIR 2.5 SDK and Flash Builder 4.0.1 update, then installed the Playbook SDK and Simulator.

Re: Orientation Changes causes Scaling/Stretching

studiochris - I think the reason it seems to work for you now is the <autoOrients> parameter. Here is what happens on my system (winxp, VMware, both the sim and sdk are 0.9.2):

if <autoOrients> is false then:

- it DOES do the strange scaling when you change the sim orientation using the bottom right corner swipe moving up to the left

- you CANNOT change the sim's orientation when an app is running (ie when it is occupying the whole screen); in order to change the sim's orientation you have to swipe from the bottom up (the menu will appear and your app pauses) and then swipe from bottom right towards the middle (orientation will change) and then "click" on your app and it will maximize and continue to run

- the StageOrientationEvent.ORIENTATION_CHANGE event does NOT fire when you change the orientation of the sim

if <autoOrients> is true then:

- the strange scaling does NOT happen when you change the sim orientation; when minimized the app is displayed correctly and black bars occupy the unused space

- you CAN change the sim's orientation when an app is running (ie when it is occupying the whole screen). when the orientation changes the minimizes itself; to get it back to fullscreen you have to swipe from the bottom up and then click it as others have said; the good news is that when it is small it continues to run

- the StageOrientationEvent.ORIENTATION_CHANGE event DOES fire when you change the orientation of the sim

I am trying to simply have a box that fills the entire screen when the app is maximized no matter which orientation is used, and I cannot find a solution yet. If autoOrients is false then the StageOrientationEvent doesn't fire so I cannot detect when the shift has happened. If autoOrients is true then the event does fire but stage.stageWidth is always the same value no matter what the orientation is.

I hope someone can take the baton a bit further based on some of the above.

Re: Orientation Changes causes Scaling/Stretching

@JimmyO: I don't think this is true. It doesn't matter if I set autoOrients to true or false or even omit it, the simulator behaviour does not change for me.

@studiochris: I don't think thats supposed to be the way the stage works on re-orientation - at least, it's not how it works when you publish an AIR application for an Android phone. On Android when an orientation change occurs, you will get a Stage Event.RESIZE event firing, just like when you change the size of a DIV on an HTML page and the swf is set to fill that div 100%...

Re: Orientation Changes causes Scaling/Stretching

It will rotate on orientation change for you but the dimensions do not change because you haven't changed them.

This is wrong. Stage does resize when you do an orientation change.

In fact, the easiest most reliable way to size your application is to not even use the ORIENTATION events, simple set autoOrients to true, and listen for RESIZE on the stage, you'll always get the proper dimensions that your app needs to fill.

This also allows you to easily test on the desktop, by just dragging the corner of your test movie around and watching your app re-flow itself.