[
https://issues.apache.org/jira/browse/CB-8043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14234896#comment-14234896
]
ASF GitHub Bot commented on CB-8043:
------------------------------------
GitHub user MMrko opened a pull request:
https://github.com/apache/cordova-lib/pull/128
CB-8043 CB-6462 CB-6105 Refactor orientation preference support
Fixes [CB-8043](https://issues.apache.org/jira/browse/CB-8043),
[CB-6462](https://issues.apache.org/jira/browse/CB-6462) and
[CB-6105](https://issues.apache.org/jira/browse/CB-6105). Touches
[CB-6182](https://issues.apache.org/jira/browse/CB-6182).
Adds support for the global & platform-specific orientation preference
(iOS, WP8 and Firefox). Android and Amazon Fire OS already had this
functionality. Additionally, platform-specific orientation preference now
accepts user-defined values (e.g. `reverseLandscape` for Android or
`UIInterfaceOrientationPortraitUpsideDown` for iOS). If need be I'd be happy to
update the
[docs](http://cordova.apache.org/docs/en/4.0.0/config_ref_index.md.html).
Both iOS and WP8 APIs allow the developer to define an initial orientation
as well as a set of supported orientations. For now, the platform-specific
parsers for iOS and WP8 keep it simple and don't support defining the supported
orientations (see
[ios_parser.js](/MMrko/cordova-lib/tree/fix-orientation-pref/cordova-lib/src/cordova/metadata/ios_parser.js#L78-L102)
&
[wp8_parser.js](/MMrko/cordova-lib/tree/fix-orientation-pref/cordova-lib/src/cordova/metadata/wp8_parser.js#L62-L84)).
As a future improvement the orientation preference could/should offer such
granularity. Meanwhile, developers can resort to a custom approach in their
builds.
To help keep the code maintainable I added a
[cordova-lib/src/configparser/supportedPreferences.json](/MMrko/cordova-lib/tree/fix-orientation-pref/cordova-lib/src/configparser/supportedPreferences.json)
that lists the supported preferences and their values for each platform.
Maintainer input would be appreciated on this since I wonder if the approach I
took here is OK. Nevertheless, a central config for preferences seems necessary.
Tested on OS X Mavericks & Windows 8 running VS 2013.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/MMrko/cordova-lib fix-orientation-pref
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-lib/pull/128.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #128
----
commit 3ab3c824fe2b67fede6bf75fa1731599152f3090
Author: Marko Raatikka <[email protected]>
Date: 2014-12-02T23:04:59Z
CB-8043 CB-6462 CB-6105 Refactor orientation preference support (adds iOS,
WP8 & Firefox OS)
----
> Orientation preference's value set to anything but "landscape" or "portrait"
> doesn't work.
> ------------------------------------------------------------------------------------------
>
> Key: CB-8043
> URL: https://issues.apache.org/jira/browse/CB-8043
> Project: Apache Cordova
> Issue Type: Improvement
> Components: Android
> Reporter: Rémi Couturier
>
> cordova-cli: 4.1.2
> cordova-android: 3.6.4
> mac: osx yosemite
> In config.xml, setting the orientation preference's value to anything but
> "landscape" or "portrait" doesn't work. Complete list of possible value:
> http://developer.android.com/guide/topics/manifest/activity-element.html#screen
> For example when setting the value to "userLandscape" and building the app
> (cordova build android), I'm getting this message: "Unknown value for
> orientation preference: userLandscape".
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]