cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject android commit: CB-10837 Support platform-specific orientation on Android
Date Mon, 21 Mar 2016 15:33:00 GMT
Repository: cordova-android
Updated Branches:
  refs/heads/master bc9e895e2 -> 69a2a5b55


CB-10837 Support platform-specific orientation on Android

Remove processing of "orientation" preference and let
user to specify any platform-specific value for Android

 This closes #281


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/69a2a5b5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/69a2a5b5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/69a2a5b5

Branch: refs/heads/master
Commit: 69a2a5b551e50bb2707cdbd7b0b768735f9f9a62
Parents: bc9e895
Author: Vladimir Kotikov <v-vlkoti@microsoft.com>
Authored: Fri Mar 18 15:07:16 2016 +0300
Committer: Vladimir Kotikov <v-vlkoti@microsoft.com>
Committed: Mon Mar 21 18:30:20 2016 +0300

----------------------------------------------------------------------
 bin/templates/cordova/lib/prepare.js | 35 +------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/69a2a5b5/bin/templates/cordova/lib/prepare.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/prepare.js b/bin/templates/cordova/lib/prepare.js
index 474ffd6..6e050c5 100644
--- a/bin/templates/cordova/lib/prepare.js
+++ b/bin/templates/cordova/lib/prepare.js
@@ -131,7 +131,7 @@ function updateProjectAccordingTo(platformConfig, locations) {
     var orig_pkg = manifest.getPackageId();
 
     manifest.getActivity()
-        .setOrientation(findOrientationValue(platformConfig))
+        .setOrientation(platformConfig.getPreference('orientation'))
         .setLaunchMode(findAndroidLaunchModePreference(platformConfig));
 
     manifest.setVersionName(platformConfig.version())
@@ -344,36 +344,3 @@ function findAndroidLaunchModePreference(platformConfig) {
 
     return launchMode;
 }
-
-/**
- * Queries ConfigParser object for the orientation <preference> value. Warns if
- *   global preference value is not supported by platform.
- *
- * @param  {Object} platformConfig    ConfigParser object
- *
- * @return {String}           Global/platform-specific orientation in lower-case
- *   (or empty string if both are undefined).
- */
-function findOrientationValue(platformConfig) {
-
-    var ORIENTATION_DEFAULT = 'default';
-
-    var orientation = platformConfig.getPreference('orientation');
-    if (!orientation) {
-        return ORIENTATION_DEFAULT;
-    }
-
-    var GLOBAL_ORIENTATIONS = ['default', 'portrait','landscape'];
-    function isSupported(orientation) {
-        return GLOBAL_ORIENTATIONS.indexOf(orientation.toLowerCase()) >= 0;
-    }
-
-    // Check if the given global orientation is supported
-    if (orientation && isSupported(orientation)) {
-        return orientation;
-    }
-
-    events.emit('warn', 'Unsupported global orientation: ' + orientation +
-        '. Defaulting to value: ' + ORIENTATION_DEFAULT);
-    return ORIENTATION_DEFAULT;
-}


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


Mime
View raw message