Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
New Developer
Posts: 55
Registered: ‎11-10-2009
My Device: Not Specified

Best way to handle re-orientation

I noticed in Burrito you can select to support auto orientation:

 

            // support autoOrients
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;

 

So in order to change from landscape to portrait, I'm guessing you would listen for an event indicating the orientation has changed.....and then do you clear the display and re-draw it? Not being able to rotate the simulator, I don't know what would happen to my display when it happens. I am not using containers, just x and y coordinates. If I used containers, would that change how I need to handle rotation of the PlayBook?

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Best way to handle re-orientation

Very good question.  The simulator does not support re-orientation yet, but listening for the change is a start.  Right now, the mode of development is based on coordinates and not on a layout manager.  In theory, if your coordinate base, you could keep two sets of coordinates based on the orientation of the device and use the Tweener to move the controls from one place to another.  A layout manager where controls are based on percentWidth and percentHeight (which is not a part of the BB framework), the layout manager would take care of most of this.  However, depending on your application.  A control that might be in one location (e.g. top right), when re-oriented, but be better to be in a different relative location (e.g. bottom right).  So layout manager might not help in those situations.  I am planning for this capability to be a little bumpy when it becomes available unless we get some support to do this easily from the SDK.

Developer
Posts: 192
Registered: ‎09-23-2009
My Device: 9860/PlayBook/Dev Alpha
My Carrier: Plus GSM

Re: Best way to handle re-orientation

I suspect that orientation change will be served, by some event in main sprite, in reaction of this we will have to relayout controls, or use setSize function on main container object.

 

We have to wait for SDK support here, we are talking about next summer sunny days.

Found my post helpfull? Like it! It solves your trouble? Help others and accept it as solution. Search before asking.
My apps: Secret Cod3s | Should my tablet be banned?
--
Jakub Nietrzeba
PGS Software S.A.
Your reliable partner in Poland - IT Outsourcing - BlackBerry, iPhone, Web and Standalone applications