flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mamsel...@apache.org
Subject [2/2] git commit: [flex-sdk] [refs/heads/develop] - FIX FLEX-33860 IOS7 Status bar height
Date Sun, 01 Dec 2013 16:33:54 GMT
FIX FLEX-33860 IOS7 Status bar height


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

Branch: refs/heads/develop
Commit: 66b54261119233abaae5fc0f38bbd0615f2bc617
Parents: e82b450
Author: mamsellem <maurice.amsellem@systar.com>
Authored: Sun Dec 1 17:30:05 2013 +0100
Committer: mamsellem <maurice.amsellem@systar.com>
Committed: Sun Dec 1 17:30:05 2013 +0100

----------------------------------------------------------------------
 frameworks/projects/mobiletheme/defaults.css    | 43 ++++++++++++++++++++
 .../TabbedViewNavigatorApplicationSkin.as       |  7 ++--
 .../mobile/ViewNavigatorApplicationSkin.as      |  7 ++--
 .../spark/src/spark/components/Application.as   | 12 ++++++
 .../src/spark/skins/spark/ApplicationSkin.mxml  | 29 +++++++++----
 5 files changed, 83 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/66b54261/frameworks/projects/mobiletheme/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobiletheme/defaults.css b/frameworks/projects/mobiletheme/defaults.css
index caf628d..66f7fb7 100644
--- a/frameworks/projects/mobiletheme/defaults.css
+++ b/frameworks/projects/mobiletheme/defaults.css
@@ -928,4 +928,47 @@ global
         leading: 4.5;
         paddingRight: 3;
     }
+}
+
+/* ios 7 status bar
+ requires new os-version selector (cf FLEX-FLEX-33949)
+ */
+
+@media (application-dpi: 120) AND (os-platform:"IOS") AND (min-os-version: 7)
+{
+    Application
+    {
+        osStatusBarHeight: 15;
+    }
+}
+
+@media (application-dpi: 160) AND (os-platform:"IOS") AND (min-os-version: 7)
+{
+    Application {
+         osStatusBarHeight: 20;
+    }
+}
+
+@media (application-dpi: 240) AND (os-platform:"IOS") AND (min-os-version: 7)
+{
+    Application
+    {
+        osStatusBarHeight: 30;
+    }
+}
+
+@media (application-dpi: 320) AND (os-platform:"IOS") AND (min-os-version: 7)
+{
+    Application
+    {
+        osStatusBarHeight: 40;
+    }
+}
+
+@media (application-dpi: 480) AND (os-platform:"IOS") AND (min-os-version: 7)
+{
+    Application
+    {
+        osStatusBarHeight: 60;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/66b54261/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as
b/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as
index adab892..1a972fd 100644
--- a/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as
+++ b/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as
@@ -129,9 +129,10 @@ public class TabbedViewNavigatorApplicationSkin extends MobileSkin
     override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
     {
         super.layoutContents(unscaledWidth, unscaledHeight);
-        
-        tabbedNavigator.setLayoutBoundsSize(unscaledWidth, unscaledHeight);
-        tabbedNavigator.setLayoutBoundsPosition(0, 0);
+        var osStatusBarHeight: Number = Number(getStyle("osStatusBarHeight"));
+        if (isNaN(osStatusBarHeight)) osStatusBarHeight = 0;
+        tabbedNavigator.setLayoutBoundsSize(unscaledWidth, unscaledHeight - osStatusBarHeight);
+        tabbedNavigator.setLayoutBoundsPosition(0, osStatusBarHeight);
     }
 }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/66b54261/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as
b/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as
index 0f412be..29f9089 100644
--- a/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as
+++ b/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as
@@ -124,9 +124,10 @@ public class ViewNavigatorApplicationSkin extends MobileSkin
     override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
     {
         super.layoutContents(unscaledWidth, unscaledHeight);
-        
-        navigator.setLayoutBoundsSize(unscaledWidth, unscaledHeight);
-        navigator.setLayoutBoundsPosition(0, 0);
+        var osStatusBarHeight: Number = Number(getStyle("osStatusBarHeight"));
+        if (isNaN(osStatusBarHeight)) osStatusBarHeight = 0;
+        navigator.setLayoutBoundsSize(unscaledWidth, unscaledHeight - osStatusBarHeight);
+        navigator.setLayoutBoundsPosition(0, osStatusBarHeight);
     }
 }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/66b54261/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 d9a0f72..80e1348 100644
--- a/frameworks/projects/spark/src/spark/components/Application.as
+++ b/frameworks/projects/spark/src/spark/components/Application.as
@@ -116,6 +116,18 @@ use namespace mx_internal;
  */
 [Style(name="backgroundColor", type="uint", format="Color", inherit="no")]
 
+
+/**
+ * Height in pixels left for os top status bar display.
+ * <p>Status bar height is set by default to 20 pixels (at 160 DPI) for iOS7, on the
following default skins: </p>
+ * <ul>
+ *     <li>>skins.spark.ApplicationSkin</li>
+ *     <li>spark.skins.mobile.TabbedViewNavigatorApplicationSkin</li>
+ *     <li>spark.skins.mobile.ViewNavigatorApplicationSkin</li>
+ *   </ul>
+ */
+[Style(name="osStatusBarHeight", type="Number", format="Length", inherit="no", theme="mobile")]
+
 //--------------------------------------
 //  Excluded APIs
 //--------------------------------------

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/66b54261/frameworks/projects/spark/src/spark/skins/spark/ApplicationSkin.mxml
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/skins/spark/ApplicationSkin.mxml b/frameworks/projects/spark/src/spark/skins/spark/ApplicationSkin.mxml
index 81c0bda..9dd416a 100644
--- a/frameworks/projects/spark/src/spark/skins/spark/ApplicationSkin.mxml
+++ b/frameworks/projects/spark/src/spark/skins/spark/ApplicationSkin.mxml
@@ -42,16 +42,27 @@
     
     <fx:Script fb:purpose="styling">
         <![CDATA[
-            /**
-             *  @private
-             */
-            override protected function updateDisplayList(unscaledWidth:Number, 
-                unscaledHeight:Number) : void
+        override public function styleChanged(styleProp: String): void
+        {
+            super.styleChanged(styleProp);
+            var allStyles: Boolean = (styleProp == null || styleProp == "styleName");
+
+            if (allStyles || styleProp == "osStatusBarHeight")
             {
-                bgRectFill.color = getStyle('backgroundColor');
-                bgRectFill.alpha = getStyle('backgroundAlpha');
-                super.updateDisplayList(unscaledWidth, unscaledHeight);
+                var osStatusBarHeight: Number = Number(getStyle("osStatusBarHeight"));
+                containerGrp.top = isNaN(osStatusBarHeight) ? 0 : osStatusBarHeight;
             }
+        }
+
+        /**
+         *  @private
+         */
+        override protected function updateDisplayList(unscaledWidth: Number, unscaledHeight:
Number): void
+        {
+            bgRectFill.color = getStyle('backgroundColor');
+            bgRectFill.alpha = getStyle('backgroundAlpha');
+            super.updateDisplayList(unscaledWidth, unscaledHeight);
+        }
         ]]>
     </fx:Script>
     
@@ -74,7 +85,7 @@
         </s:fill>
     </s:Rect>
         
-    <s:Group left="0" right="0" top="0" bottom="0">
+    <s:Group left="0" right="0" top="0" bottom="0" id="containerGrp">
         <s:layout>
             <s:VerticalLayout gap="0" horizontalAlign="justify" />
         </s:layout>


Mime
View raw message