flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bigosma...@apache.org
Subject [23/47] git commit: [flex-sdk] [refs/heads/develop] - Make SpinnerListSkin and SpinnerListContainerSkin work with all supported DPIs
Date Sun, 17 Aug 2014 08:24:22 GMT
Make SpinnerListSkin and SpinnerListContainerSkin work with all supported DPIs


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

Branch: refs/heads/develop
Commit: 56cbd2167c2a1c546d8ac69718e6afc810ecc191
Parents: 95c7ca6
Author: Om <bigosmallm@gmail.com>
Authored: Mon Jun 16 02:29:28 2014 -0700
Committer: Om <bigosmallm@gmail.com>
Committed: Mon Jun 16 02:29:28 2014 -0700

----------------------------------------------------------------------
 .../projects/mobiletheme/src/android4x.css      | 47 ++++++++++++++++++--
 .../skins/android4/SpinnerListContainerSkin.as  | 18 +++-----
 .../src/spark/skins/android4/SpinnerListSkin.as | 43 ++++++++++++++----
 .../SpinnerListContainerSelectionIndicator.fxg  |  6 +--
 .../assets/SpinnerListContainerShadow.fxg       |  4 +-
 5 files changed, 90 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/56cbd216/frameworks/projects/mobiletheme/src/android4x.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobiletheme/src/android4x.css b/frameworks/projects/mobiletheme/src/android4x.css
index 511511f..424b1d9 100644
--- a/frameworks/projects/mobiletheme/src/android4x.css
+++ b/frameworks/projects/mobiletheme/src/android4x.css
@@ -147,15 +147,14 @@ SpinnerList
 SpinnerListContainer
 {
 	skinClass: ClassReference("spark.skins.android4.SpinnerListContainerSkin");
-	backgroundAlpha: 0;
 }
 
 SpinnerListItemRenderer
 {
 	paddingTop : 18;
 	paddingBottom : 18;
-	paddingLeft : 16;
-	paddingRight : 16;
+	paddingLeft : 6;
+	paddingRight : 6;
 }
 
 TabbedViewNavigator #tabBar
@@ -201,6 +200,14 @@ ToggleSwitch
 		fontSize: 14;
 	}
 	
+	SpinnerListItemRenderer
+	{
+		paddingTop : 9;
+		paddingBottom : 9;
+		paddingLeft : 3;
+		paddingRight : 3;
+	}
+	
 	TabbedViewNavigator #tabBar
 	{
 		fontSize: 11;
@@ -228,6 +235,14 @@ ToggleSwitch
 		fontSize: 18;
 	}
 	
+	SpinnerListItemRenderer
+	{
+		paddingTop : 12;
+		paddingBottom : 12;
+		paddingLeft : 4;
+		paddingRight : 4;
+	}
+	
 	TabbedViewNavigator #tabBar
 	{
 		fontSize: 14;
@@ -245,6 +260,7 @@ ToggleSwitch
 	{
 		fontSize: 24;
 	}
+	
 }
 
 @media (application-dpi: 320)
@@ -267,6 +283,14 @@ ToggleSwitch
 		fontSize: 36;
 	}
 	
+	SpinnerListItemRenderer
+	{
+		paddingTop : 24;
+		paddingBottom : 24;
+		paddingLeft : 8;
+		paddingRight : 8;
+	}
+	
 	TabbedViewNavigator #tabBar
 	{
 		fontSize: 28;
@@ -294,6 +318,15 @@ ToggleSwitch
 		fontSize: 54;
 	}
 	
+	SpinnerListItemRenderer
+	{
+		paddingTop : 36;
+		paddingBottom : 36;
+		paddingLeft : 12;
+		paddingRight : 12;
+	}
+
+	
 	TabbedViewNavigator #tabBar
 	{
 		fontSize: 42;
@@ -320,6 +353,14 @@ ToggleSwitch
 		fontSize: 72;
 	}
 	
+	SpinnerListItemRenderer
+	{
+		paddingTop : 48;
+		paddingBottom : 48;
+		paddingLeft : 16;
+		paddingRight : 16;
+	}
+	
 	TabbedViewNavigator #tabBar
 	{
 		fontSize: 56;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/56cbd216/frameworks/projects/mobiletheme/src/spark/skins/android4/SpinnerListContainerSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobiletheme/src/spark/skins/android4/SpinnerListContainerSkin.as
b/frameworks/projects/mobiletheme/src/spark/skins/android4/SpinnerListContainerSkin.as
index f8b3779..dd5ff92 100644
--- a/frameworks/projects/mobiletheme/src/spark/skins/android4/SpinnerListContainerSkin.as
+++ b/frameworks/projects/mobiletheme/src/spark/skins/android4/SpinnerListContainerSkin.as
@@ -24,14 +24,13 @@ package spark.skins.android4
 	
 	import mx.core.DPIClassification;
 	import mx.core.mx_internal;
+	
 	import spark.components.Group;
 	import spark.components.SpinnerListContainer;
 	import spark.layouts.HorizontalLayout;
-	//import android skins
 	import spark.skins.android4.assets.SpinnerListContainerBackground;
 	import spark.skins.android4.assets.SpinnerListContainerSelectionIndicator;
-	import spark.skins.android4.assets.SpinnerListContainerShadow
-		
+	import spark.skins.android4.assets.SpinnerListContainerShadow;
 	import spark.skins.mobile.supportClasses.MobileSkin;
 
 	use namespace mx_internal;
@@ -66,46 +65,41 @@ package spark.skins.android4
 			borderClass = spark.skins.android4.assets.SpinnerListContainerBackground;
 			selectionIndicatorClass = spark.skins.android4.assets.SpinnerListContainerSelectionIndicator;
 			shadowClass = spark.skins.android4.assets.SpinnerListContainerShadow;
+			cornerRadius = 0;
 			switch (applicationDPI)
 			{
 				case DPIClassification.DPI_640:
 				{
-					cornerRadius = 0;
 					borderThickness = 3;
 					selectionIndicatorHeight = 182;
 					break;
 				}
 				case DPIClassification.DPI_480:
 				{
-					cornerRadius = 0;
 					borderThickness = 2;
 					selectionIndicatorHeight = 144;
 					break;
 				}
 				case DPIClassification.DPI_320:
 				{					
-					cornerRadius = 0;
 					borderThickness = 2;
 					selectionIndicatorHeight = 96;
 					break;
 				}
 				case DPIClassification.DPI_240:
 				{
-					cornerRadius = 0;
 					borderThickness = 1;
 					selectionIndicatorHeight = 72;
 					break;
 				}
 				case DPIClassification.DPI_120:
 				{
-					cornerRadius = 0;
 					borderThickness = 0;
-					selectionIndicatorHeight = 37;
+					selectionIndicatorHeight = 36;
 					break;
 				}
 				default: // default DPI_160
 				{
-					cornerRadius = 0;
 					borderThickness = 1;
 					selectionIndicatorHeight = 48;
 					
@@ -319,8 +313,8 @@ package spark.skins.android4
 			setElementSize(border, unscaledWidth - borderThickness * 2, unscaledHeight);
 			setElementPosition(border, borderThickness, 0);			
 			
-			setElementSize(shadow, unscaledWidth - borderThickness * 4, unscaledHeight - borderThickness
* 2);
-			setElementPosition(shadow, borderThickness * 2, borderThickness);
+			setElementSize(shadow, unscaledWidth - borderThickness * 4, measuredHeight - borderThickness
* 2);
+			setElementPosition(shadow, borderThickness * 2, unscaledHeight/2 - measuredHeight/2);
 		
 			// The SpinnerLists contain a left and right border. We don't want to show the leftmost

 			// SpinnerLists's left border nor the rightmost one's right border. 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/56cbd216/frameworks/projects/mobiletheme/src/spark/skins/android4/SpinnerListSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobiletheme/src/spark/skins/android4/SpinnerListSkin.as b/frameworks/projects/mobiletheme/src/spark/skins/android4/SpinnerListSkin.as
index 69e4b75..b86553f 100644
--- a/frameworks/projects/mobiletheme/src/spark/skins/android4/SpinnerListSkin.as
+++ b/frameworks/projects/mobiletheme/src/spark/skins/android4/SpinnerListSkin.as
@@ -22,17 +22,15 @@ package spark.skins.android4
 	
 	import mx.core.ClassFactory;
 	import mx.core.DPIClassification;
-	import mx.core.mx_internal;	
-
+	import mx.core.mx_internal;
+	
 	import spark.components.DataGroup;
 	import spark.components.Scroller;
+	import spark.components.SpinnerList;
+	import spark.components.SpinnerListItemRenderer;
 	import spark.layouts.VerticalSpinnerLayout;
-	import spark.skins.mobile.supportClasses.MobileSkin;
-	
 	import spark.skins.android4.assets.SpinnerListContainerSelectionIndicator;
-	
-	import spark.components.SpinnerList;
-	import spark.components.SpinnerListItemRenderer;	
+	import spark.skins.mobile.supportClasses.MobileSkin;	
 
 	
 	use namespace mx_internal;
@@ -59,23 +57,52 @@ package spark.skins.android4
 			super();
 			
 			selectionIndicatorClass = spark.skins.android4.assets.SpinnerListContainerSelectionIndicator;
+			borderThickness = 1;
 			switch (applicationDPI)
 			{
 				case DPIClassification.DPI_640:
+				{
+					selectionIndicatorHeight = 182;
+					minWidth = 64;
+					borderThickness = 3;
+					break;
+				}
 				case DPIClassification.DPI_480:
+				{
+					selectionIndicatorHeight = 144;
+					minWidth = 48;
+					borderThickness = 2;
+					break;
+				}
 				case DPIClassification.DPI_320:
 				{
+					selectionIndicatorHeight = 96;
+					minWidth = 32;
 					borderThickness = 2;
 					break;
 				}
+				case DPIClassification.DPI_240:
+				{
+					selectionIndicatorHeight = 72;
+					minWidth = 24;
+					borderThickness = 1;
+					break;
+				}
+				case DPIClassification.DPI_120:
+				{
+					selectionIndicatorHeight = 36;
+					minWidth = 12;
+					borderThickness = 0;
+					break;
+				}
 				default:
 				{
 					selectionIndicatorHeight = 48;
+					minWidth = 16;
 					borderThickness = 1;
 				}   
 			}
 			
-			minWidth = 16;
 		}
 		
 		//--------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/56cbd216/frameworks/projects/mobiletheme/src/spark/skins/android4/assets/SpinnerListContainerSelectionIndicator.fxg
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobiletheme/src/spark/skins/android4/assets/SpinnerListContainerSelectionIndicator.fxg
b/frameworks/projects/mobiletheme/src/spark/skins/android4/assets/SpinnerListContainerSelectionIndicator.fxg
index a8d8ae7..067afb1 100644
--- a/frameworks/projects/mobiletheme/src/spark/skins/android4/assets/SpinnerListContainerSelectionIndicator.fxg
+++ b/frameworks/projects/mobiletheme/src/spark/skins/android4/assets/SpinnerListContainerSelectionIndicator.fxg
@@ -22,7 +22,7 @@
 
 -->
 <Graphic version="2.0" xmlns="http://ns.adobe.com/fxg/2008" viewHeight="48" viewWidth="100"
-	scaleGridLeft="3" scaleGridTop="6" scaleGridRight="97" scaleGridBottom="41">
+	scaleGridLeft="3" scaleGridTop="5.5" scaleGridRight="97" scaleGridBottom="41">
 	<!-- Transparent rect used to center the bar -->
 	<Rect x="0" y="0" width="100" height="4">
 		<fill>
@@ -30,13 +30,13 @@
 		</fill>
 	</Rect>
 	<!-- Top highlight -->
-	<Rect x="5" y="5" width="70" height="1.5">
+	<Rect x="5" y="5" width="95" height="1.5">
     	<fill>
         	<SolidColor color="#33afdd"/>
         </fill>
 	</Rect>
 	<!-- Bottom highlight -->
-	<Rect x="5" y="42" width="70" height="1.5">
+	<Rect x="5" y="40" width="95" height="1.5">
     	<fill>
         	<SolidColor color="#33afdd"/>
         </fill>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/56cbd216/frameworks/projects/mobiletheme/src/spark/skins/android4/assets/SpinnerListContainerShadow.fxg
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobiletheme/src/spark/skins/android4/assets/SpinnerListContainerShadow.fxg
b/frameworks/projects/mobiletheme/src/spark/skins/android4/assets/SpinnerListContainerShadow.fxg
index 2f43622..41c1955 100644
--- a/frameworks/projects/mobiletheme/src/spark/skins/android4/assets/SpinnerListContainerShadow.fxg
+++ b/frameworks/projects/mobiletheme/src/spark/skins/android4/assets/SpinnerListContainerShadow.fxg
@@ -22,8 +22,8 @@
 
 -->
 <Graphic version="2.0" xmlns="http://ns.adobe.com/fxg/2008" viewHeight= "100" viewWidth=
"100"
-	scaleGridLeft="5" scaleGridTop="5" scaleGridRight="95" scaleGridBottom="95">
-	<Rect width="100" height="100" radiusX="5" radiusY="5">
+	scaleGridLeft="1" scaleGridTop="1" scaleGridRight="99" scaleGridBottom="99">
+	<Rect width="100" height="100">
 		<fill>
 	      <LinearGradient rotation="90">
 	        <GradientEntry ratio="0" color="#FFFFFF" alpha="1.0"/>


Mime
View raw message