You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by bi...@apache.org on 2014/10/04 00:18:29 UTC

git commit: [flex-sdk] [refs/heads/iso7skins] - Add IOSPlatFormVersionOveride so that we can simulate IOS7 in the AIR simulator. To use this, add -includes=mx.utils.IOSPlatformVersionOverride to your mobile project's Flex Compiler arguments.

Repository: flex-sdk
Updated Branches:
  refs/heads/iso7skins c588633a9 -> 33ba189ee


Add IOSPlatFormVersionOveride so that we can simulate IOS7 in the AIR simulator.  To use this, add  -includes=mx.utils.IOSPlatformVersionOverride to your mobile project's Flex Compiler arguments.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/33ba189e
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/33ba189e
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/33ba189e

Branch: refs/heads/iso7skins
Commit: 33ba189ee87f0050831af8ff61b9f38100828178
Parents: c588633
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Fri Oct 3 15:17:54 2014 -0700
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Fri Oct 3 15:17:54 2014 -0700

----------------------------------------------------------------------
 .gitignore                                      |  1 +
 .../projects/framework/src/FrameworkClasses.as  |  1 +
 .../src/mx/utils/IOSPlatformVersionOverride.as  | 42 ++++++++++++++++++++
 .../projects/framework/src/mx/utils/Platform.as | 17 ++++++--
 4 files changed, 58 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/33ba189e/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 0eccc82..bdec6d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -137,3 +137,4 @@ air-sdk-description.xml
 samples/descriptor-sample.xml
 include/FlashRuntimeExtensions.h
 
+/frameworks/projects/mobiletheme/src/spark/skins/ios7/visualcomps/*.ai

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/33ba189e/frameworks/projects/framework/src/FrameworkClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/FrameworkClasses.as b/frameworks/projects/framework/src/FrameworkClasses.as
index cb2a093..51e1c64 100644
--- a/frameworks/projects/framework/src/FrameworkClasses.as
+++ b/frameworks/projects/framework/src/FrameworkClasses.as
@@ -164,6 +164,7 @@ internal class FrameworkClasses
 	import mx.utils.DisplayUtil; DisplayUtil;
     import mx.utils.GetTimerUtil; GetTimerUtil;
     import mx.utils.HSBColor; HSBColor;
+	import mx.utils.IOSPlatformVersionOverride; IOSPlatformVersionOverride;
     import mx.utils.LinkedList; LinkedList;
 	import mx.utils.LinkedListNode; LinkedListNode;
 	import mx.utils.OnDemandEventDispatcher; OnDemandEventDispatcher;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/33ba189e/frameworks/projects/framework/src/mx/utils/IOSPlatformVersionOverride.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/utils/IOSPlatformVersionOverride.as b/frameworks/projects/framework/src/mx/utils/IOSPlatformVersionOverride.as
new file mode 100644
index 0000000..b1cf61e
--- /dev/null
+++ b/frameworks/projects/framework/src/mx/utils/IOSPlatformVersionOverride.as
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.utils
+{
+	import flash.display.DisplayObject;
+	import flash.system.Capabilities;
+	
+	import mx.core.mx_internal;
+
+	[Mixin]
+	public class IOSPlatformVersionOverride
+	{
+		public static function init(root:DisplayObject):void
+		{
+			var c:Class = Capabilities;
+			//Set this override value on if we are 
+			// a. on the AIR Simulator
+			// b. simulating iOS
+			if(c.version.indexOf("IOS") > -1 && c.manufacturer != "Adobe iOS")
+			{
+				Platform.mx_internal::iosVersionOverride =  "7.0";
+			}
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/33ba189e/frameworks/projects/framework/src/mx/utils/Platform.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/utils/Platform.as b/frameworks/projects/framework/src/mx/utils/Platform.as
index 6c40408..222425c 100644
--- a/frameworks/projects/framework/src/mx/utils/Platform.as
+++ b/frameworks/projects/framework/src/mx/utils/Platform.as
@@ -51,11 +51,18 @@ public class Platform
 	protected static var _isBrowser:Boolean;
 	protected static var _isAir:Boolean;
     private static var _osVersion: String = null;
+
 	/**
-	 * This value is set from AndroidVersionMediaQueryParserOverride
+	 * This value is set from AndroidPlatformVersionOverride
 	 * 
 	 */
 	mx_internal static var androidVersionOverride:String;
+
+	/**
+	 * This value is set from IOSPlatformVersionOverride
+	 * 
+	 */
+	mx_internal static var iosVersionOverride:String;
 	
 	/**
 	 *  Returns true if the application is running on IOS.
@@ -235,14 +242,18 @@ public class Platform
     {
         //We needed to compute _osVersion later than getPlatforms, because it relies on resources that  ready later
         if (_osVersion == null){
-			if(mx_internal::androidVersionOverride == null)
+			if(mx_internal::androidVersionOverride == null && mx_internal::iosVersionOverride == null)
 			{
 				_osVersion = computeOSVersionString();	
 			}
-			else
+			else if(mx_internal::androidVersionOverride != null)
 			{
 				_osVersion = mx_internal::androidVersionOverride; 
 			}
+			else if(mx_internal::iosVersionOverride != null)
+			{
+				_osVersion = mx_internal::iosVersionOverride; 
+			}
         }
         return _osVersion;
     }