You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ma...@apache.org on 2013/12/09 01:20:59 UTC

git commit: [flex-sdk] [refs/heads/develop] - FIX FLEX-33860 IOS7 - fix os-version X.Y not computed correctly - fix removing gap when switching to full screen.

Updated Branches:
  refs/heads/develop cfc9b1d1a -> 27be89a05


FIX FLEX-33860 IOS7
- fix os-version X.Y not computed correctly
- fix removing gap when switching to full screen.


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

Branch: refs/heads/develop
Commit: 27be89a0537d1e47cbe923be578ed9f318449b04
Parents: cfc9b1d
Author: mamsellem <ma...@systar.com>
Authored: Mon Dec 9 01:09:41 2013 +0100
Committer: mamsellem <ma...@systar.com>
Committed: Mon Dec 9 01:09:41 2013 +0100

----------------------------------------------------------------------
 .../framework/src/mx/utils/MediaQueryParser.as  | 17 ++++++++++-
 .../spark/src/spark/components/Application.as   | 31 ++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/27be89a0/frameworks/projects/framework/src/mx/utils/MediaQueryParser.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/utils/MediaQueryParser.as b/frameworks/projects/framework/src/mx/utils/MediaQueryParser.as
index 4e54140..9308e69 100644
--- a/frameworks/projects/framework/src/mx/utils/MediaQueryParser.as
+++ b/frameworks/projects/framework/src/mx/utils/MediaQueryParser.as
@@ -428,7 +428,22 @@ public class MediaQueryParser
         else {
             osMatch = os.match(/[A-Za-z\s]+([\d\.]+)/);
         }
-       return osMatch ? Number(osMatch [1]) : 0.0;
+       return osMatch ? convertVersionStringToNumber(osMatch [1]) : 0.0;
+    }
+
+    /** @private  converts string version such as "X" or "X.Y" or "X.Y.Z" into a number.
+     * minor version parts are normalized to 100  so that eg. X.1 < X.10
+     * so "7.1" return 7.01 and "7.12" return 7.12
+  */
+    private function convertVersionStringToNumber(versionString: String): Number {
+        var versionParts: Array = versionString.split(".");
+        var version: Number = 0;
+        var scale: Number = 1;
+        for each (var part: String in versionParts) {
+            version += Number(part) * scale;
+            scale /= 100;
+        }
+        return version;
     }
 
     // the type of the media

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/27be89a0/frameworks/projects/spark/src/spark/components/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/Application.as b/frameworks/projects/spark/src/spark/components/Application.as
index 80e1348..68048fa 100644
--- a/frameworks/projects/spark/src/spark/components/Application.as
+++ b/frameworks/projects/spark/src/spark/components/Application.as
@@ -22,9 +22,11 @@ package spark.components
 
 import flash.display.DisplayObject;
 import flash.display.InteractiveObject;
+import flash.display.StageDisplayState;
 import flash.events.ContextMenuEvent;
 import flash.events.Event;
 import flash.events.EventDispatcher;
+import flash.events.FullScreenEvent;
 import flash.events.SoftKeyboardEvent;
 import flash.events.UncaughtErrorEvent;
 import flash.external.ExternalInterface;
@@ -1364,6 +1366,7 @@ public class Application extends SkinnableContainer
         {
             sm.stage.addEventListener("orientationChanging", stage_orientationChangingHandler);
             sm.stage.addEventListener("orientationChange", stage_orientationChange);
+            sm.stage.addEventListener(FullScreenEvent.FULL_SCREEN, stage_fullScreenHandler)  ;
         }
         
         _url = LoaderUtil.normalizeURL(sm.loaderInfo);
@@ -1479,6 +1482,34 @@ public class Application extends SkinnableContainer
         explicitSizingForOrientation = false;
     }
 
+    /** @private previous value of osStatusBarHeight on iOS when switch to full screen
+     *
+     */
+    protected var savedOsStatusBarHeight: Number = 0;
+
+    /**
+     *  @private
+     *  Handler to temporarily remove osStatusBarHeight is stage is set to full screen
+     *  only of iOS devices
+     */
+    protected function stage_fullScreenHandler(event: FullScreenEvent): void {
+
+        if (stage.displayState  == StageDisplayState.FULL_SCREEN ||  stage.displayState == StageDisplayState.FULL_SCREEN_INTERACTIVE) {
+            var statusBarHeight : Number = getStyle("osStatusBarHeight");
+            if (statusBarHeight > 0) {
+                savedOsStatusBarHeight = statusBarHeight;
+                setStyle("osStatusBarHeight", 0) ;
+            }
+        }
+        else
+        {
+              if (savedOsStatusBarHeight > 0)    {
+                  setStyle("osStatusBarHeight", savedOsStatusBarHeight);
+                  savedOsStatusBarHeight = 0;
+              }
+        }
+    }
+
     /**
      *  @private 
      *  Update the screen size cache with the new values. The previous values are