Highlighted

Android app won't go upside-down unless aspectRatio is set to portrait

Community Beginner ,
Mar 05, 2014

Copy link to clipboard

Copied

My -app.xml file is a simple,

<?xml version="1.0" encoding="utf-8" standalone="no"?>

<application xmlns="http://ns.adobe.com/air/application/4.0">

    <id>com.sixminute.plaintester</id>

    <filename>OtherTester</filename>

    <name>OtherTester</name>

    <versionNumber>0.0.0</versionNumber>

    <initialWindow>

        <content>[This value will be overwritten by Flash Builder in the output app.xml]</content>

        <!--

            <aspectRatio>portrait</aspectRatio>

         -->

        <renderMode>direct</renderMode>

        <autoOrients>true</autoOrients>

        <fullScreen>true</fullScreen>

        <visible>true</visible>

    </initialWindow>

    <android>

        <manifestAdditions><![CDATA[

            <manifest android:installLocation="auto">

                <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />

                <uses-permission android:name="android.permission.INTERNET"/>

            </manifest>

        ]]></manifestAdditions>

    </android>

    <iPhone>

        <InfoAdditions><![CDATA[

        ]]></InfoAdditions>

        <requestedDisplayResolution>high</requestedDisplayResolution>

    </iPhone>

</application>

And the entry point file, is just

package

{

    import flash.display.Sprite;

    import flash.display.StageAlign;

    import flash.display.StageScaleMode;

    import flash.text.TextField;

    public class OtherTester extends Sprite

    {

        public function OtherTester()

        {

            super();

            stage.align = StageAlign.TOP_LEFT;

            stage.scaleMode = StageScaleMode.NO_SCALE;

            var tx:TextField = new TextField();

            tx.text = 'hello world';

            tx.x = tx.y = 10;

            addChild(tx);

            trace(stage.supportedOrientations.join(', '));

        }

    }

}

the trace statement prints the full,

  default, rotatedLeft, rotatedRight, upsideDown

But no matter how I turn, I only get default (upright portrait), rotatedLeft and rotatedRight, never upsideDown.

I'm using AIR 4.0, and currently testing on a Nexus 5.

TOPICS
Performance issues

Views

365

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Android app won't go upside-down unless aspectRatio is set to portrait

Community Beginner ,
Mar 05, 2014

Copy link to clipboard

Copied

My -app.xml file is a simple,

<?xml version="1.0" encoding="utf-8" standalone="no"?>

<application xmlns="http://ns.adobe.com/air/application/4.0">

    <id>com.sixminute.plaintester</id>

    <filename>OtherTester</filename>

    <name>OtherTester</name>

    <versionNumber>0.0.0</versionNumber>

    <initialWindow>

        <content>[This value will be overwritten by Flash Builder in the output app.xml]</content>

        <!--

            <aspectRatio>portrait</aspectRatio>

         -->

        <renderMode>direct</renderMode>

        <autoOrients>true</autoOrients>

        <fullScreen>true</fullScreen>

        <visible>true</visible>

    </initialWindow>

    <android>

        <manifestAdditions><![CDATA[

            <manifest android:installLocation="auto">

                <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />

                <uses-permission android:name="android.permission.INTERNET"/>

            </manifest>

        ]]></manifestAdditions>

    </android>

    <iPhone>

        <InfoAdditions><![CDATA[

        ]]></InfoAdditions>

        <requestedDisplayResolution>high</requestedDisplayResolution>

    </iPhone>

</application>

And the entry point file, is just

package

{

    import flash.display.Sprite;

    import flash.display.StageAlign;

    import flash.display.StageScaleMode;

    import flash.text.TextField;

    public class OtherTester extends Sprite

    {

        public function OtherTester()

        {

            super();

            stage.align = StageAlign.TOP_LEFT;

            stage.scaleMode = StageScaleMode.NO_SCALE;

            var tx:TextField = new TextField();

            tx.text = 'hello world';

            tx.x = tx.y = 10;

            addChild(tx);

            trace(stage.supportedOrientations.join(', '));

        }

    }

}

the trace statement prints the full,

  default, rotatedLeft, rotatedRight, upsideDown

But no matter how I turn, I only get default (upright portrait), rotatedLeft and rotatedRight, never upsideDown.

I'm using AIR 4.0, and currently testing on a Nexus 5.

TOPICS
Performance issues

Views

366

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 05, 2014 0
Community Beginner ,
Mar 05, 2014

Copy link to clipboard

Copied

If I manually handle it with,

stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onReorientation);
...
protected function onReorientation(event:StageOrientationEvent):void
{
     if(event.afterOrientation != stage.orientation)

     {

           stage.setOrientation(event.afterOrientation);

     }

}

everything works as expected.  When you go upside down, event.afterOrientation is upside down, but stage.orientation is still whatever it was before.  Obviously this is a bug, no?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 05, 2014 0