cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Vertucio (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-12790) iOS: locking to landscape-(primary|secondary) inconsistent with screen.orientation.type
Date Thu, 11 May 2017 15:30:04 GMT

     [ https://issues.apache.org/jira/browse/CB-12790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jason Vertucio updated CB-12790:
--------------------------------
    Summary: iOS: locking to landscape-(primary|secondary) inconsistent with screen.orientation.type
 (was: Party time )

> iOS: locking to landscape-(primary|secondary) inconsistent with screen.orientation.type
> ---------------------------------------------------------------------------------------
>
>                 Key: CB-12790
>                 URL: https://issues.apache.org/jira/browse/CB-12790
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-screen-orientation
>            Reporter: Jason Vertucio
>         Attachments: cordova_info.txt, index.js, index.js
>
>
> For me, using cordova-plugin-screen-orientation@2.0.1, {{screen.orientation.lock('landscape')}}
works to lock the device into landscape mode. However, a new issue appears if I try to lock
to "landscape-primary" or "landscape-secondary."
> *Desired functionality:*
> # iOS device is initially locked in "portrait-primary" mode
> # User is required to turn device to landscape mode, so {{screen.orientation.lock('landscape');}}
is called
> # App should stick with orientation it went to, so if user turns phone upside down, it
doesn't flip orientation
> *To achieve this:*
> Using the _Hello Cordova_ app, I do the following to {{index.js}}
> {code}
>     // Add this to the receivedEvent() method
>         console.log('Received Event: ' + id);
>         window.addEventListener('orientationchange',app.orientationChanged);
>     // Then add this to index.js after receivedEvent() method
>     orientationChanged: function() {
>         console.log("Orientation changed to " + screen.orientation.type);
>         console.log("Locking orientation to " + screen.orientation.type);
>         screen.orientation.lock(screen.orientation.type);
>     }
> {code}
> *Actual functionality:*
> When the app is run, instead of locking to a landscape mode and staying in place, it
locks into landscape mode and then spins like it's _party time!_



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message