flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mamsel...@apache.org
Subject [06/15] git commit: [flex-sdk] [refs/heads/develop] - https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - fixed Bitmap scaling using BitmapImage instead of BitmapAsset - fixed last column width
Date Fri, 04 Oct 2013 23:03:12 GMT
https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- fixed Bitmap scaling using BitmapImage instead of BitmapAsset
- fixed last column width


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

Branch: refs/heads/develop
Commit: fe39973bd62f7ebac64a16de58f8070517bba877
Parents: b78de5c
Author: mamsellem <maurice.amsellem@systar.com>
Authored: Tue Oct 1 23:05:14 2013 +0200
Committer: mamsellem <maurice.amsellem@systar.com>
Committed: Tue Oct 1 23:05:14 2013 +0200

----------------------------------------------------------------------
 .../projects/experimental_mobile/defaults.css   |  38 +++-
 .../src/ExperimentalMobileClasses.as            |   6 +-
 .../src/spark/components/MobileGrid.as          |  34 ++--
 .../itemRenderers/IItemPartRendererBase.as      |   5 +-
 .../itemRenderers/IItemTextPartRenderer.as      |   4 -
 .../itemRenderers/ItemBitmapPartRenderer.as     |  54 ++----
 .../itemRenderers/ItemTextPartRenderer.as       |  10 ++
 .../supportClasses/IPartRendererDescriptor.as   |  34 ----
 .../supportClasses/ListMultiPartColumnLayout.as |  97 +++++++++++
 .../ListMultiPartItemRendererBase.as            | 172 +++++++++++++++++--
 .../supportClasses/ListMultiPartLayoutBase.as   |   9 +-
 .../supportClasses/ListMultiPartTabbedLayout.as |  82 ---------
 .../supportClasses/MobileGridColumn.as          |   6 +-
 .../supportClasses/MobileGridHeader.as          |  15 +-
 .../supportClasses/MobileGridRowRenderer.as     |   2 +-
 .../PartRendererDescriptorBase.as               |  69 ++++----
 .../src/spark/events/MobileGridHeaderEvent.as   |   2 +-
 .../src/spark/skins/MobileGridSkin.as           |   3 +-
 .../src/spark/utils/DensityUtil2.as             |  38 +---
 .../src/spark/utils/MultiDPIBitmapSourceExt.as  |  23 ++-
 .../src/spark/utils/UIComponentUtils.as         |  34 ----
 21 files changed, 433 insertions(+), 304 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/defaults.css b/frameworks/projects/experimental_mobile/defaults.css
index 236ea6f..aaf188b 100644
--- a/frameworks/projects/experimental_mobile/defaults.css
+++ b/frameworks/projects/experimental_mobile/defaults.css
@@ -26,7 +26,8 @@ MobileGrid
     contentBackgroundColor: #202020;
     alternatingItemColors: #202020, #2a2a2a;
     color: white;
-    selection-color: #00a2ff; /* blue  */
+     selection-color: #00a2ff; /* blue  */
+
 }
 
 supportClasses|MobileGridHeader
@@ -37,9 +38,10 @@ supportClasses|MobileGridHeader
     /*   color: #f0f0f0;  */
 }
 
-supportClasses|ItemRendererBase
+supportClasses|MobileGridRowRenderer
 {
     verticalAlign: "middle";
+    downColor: #000000;;
 }
 
 @media (application-dpi: 120)
@@ -60,7 +62,6 @@ supportClasses|ItemRendererBase
 
     supportClasses|ItemRendererBase
     {
-        color: #bae5ff;
         paddingBottom: 12;
         paddingLeft: 7;
         paddingRight: 7;
@@ -73,7 +74,7 @@ supportClasses|ItemRendererBase
 
     supportClasses|MobileGridHeader
     {
-        fontSize: 14;
+        fontSize: 18;
     }
 
     supportClasses|MobileGridRowRenderer
@@ -86,7 +87,6 @@ supportClasses|ItemRendererBase
 
     supportClasses|ItemRendererBase
     {
-        color: #acffb5;
         paddingBottom: 16;
         paddingLeft: 10;
         paddingRight: 10;
@@ -112,7 +112,6 @@ supportClasses|ItemRendererBase
 
     supportClasses|ItemRendererBase
     {
-        color: #fbffa0;
         paddingBottom: 24;
         paddingLeft: 14;
         paddingRight: 14;
@@ -130,7 +129,6 @@ supportClasses|ItemRendererBase
 
     supportClasses|MobileGridRowRenderer
     {
-        color: #ffc2aa;
         paddingTop: 2;
         paddingLeft: 20;
         paddingRight: 20;
@@ -146,4 +144,30 @@ supportClasses|ItemRendererBase
     }
 }
 
+@media (application-dpi: 480)
+{
+
+    supportClasses|MobileGridHeader
+    {
+        fontSize: 40;
+    }
+
+    supportClasses|MobileGridRowRenderer
+    {
+        paddingTop: 4;
+        paddingLeft: 28;
+        paddingRight: 28;
+        paddingBottom: 0;
+    }
+
+    supportClasses|ItemRendererBase
+    {
+        paddingBottom: 48;
+        paddingLeft: 28;
+        paddingRight: 28;
+        paddingTop: 48;
+    }
+}
+
+
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
index 215735f..b695712 100644
--- a/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
+++ b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
@@ -25,10 +25,10 @@ import spark.skins.MobileGridSkin;
 
 /*
  classes that won't be detected through dependencies
-* and classes that needs to be includes in ASDOC
-* */
+ * and classes that needs to be includes in ASDOC
+ * */
 
- internal class ExperimentalMobileClasses
+internal class ExperimentalMobileClasses
 {
 
     // mamsellem: for some reason, the import statements alone are not enough to have the classes included

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
index 618a1bc..4161580 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
@@ -27,10 +27,10 @@ import mx.core.ScrollPolicy;
 import mx.core.mx_internal;
 
 import spark.collections.Sort;
-import spark.components.supportClasses.IPartRendererDescriptor;
 import spark.components.supportClasses.MobileGridColumn;
 import spark.components.supportClasses.MobileGridHeader;
 import spark.components.supportClasses.MobileGridRowRenderer;
+import spark.components.supportClasses.PartRendererDescriptorBase;
 import spark.events.MobileGridHeaderEvent;
 import spark.layouts.VerticalLayout;
 import spark.layouts.supportClasses.LayoutBase;
@@ -58,7 +58,7 @@ use namespace  mx_internal;
 
 /**
  *  The MobileGrid displays a collection of items in a grid of rows and columns, with column headers, optimized for mobile devices.
- * <p> The MobileGrid component provides the following features:    </p>
+ *  The MobileGrid component provides the following features:
  *  <ul>
  *      <li> user can swipe through the rows in the datagrid. </li>
  *      <li> supports single selection of a row. </li>
@@ -69,18 +69,18 @@ use namespace  mx_internal;
  *
  * <p> It's important to understand that MobileGrid does not have all the capabilities and flexibility of it's desktop equivalent,
  * in order to ensure optimal display and scrolling performance on mobile devices. </p>
- * <p>Typically, the following features are not available in MobileGrid: </p>
+ * <p>Typically, the following features are not available in MobileGrid:
  * <ul>
  *     <li>the list of columns is static and cannot be changed at runtime</li>
  *     <li>multiple selection is not supported </li>
  *     <li>it's not possible to interactively reorder columns </li>
  *     <li>custom cell renderers must be designed with care, preferably in ActionScript, to ensure good display performance </li>
  *   </ul>
- *
- * <p>Internally,  MobileGrid inherits for Mobile spark.List component rather than any Grid or DataGrid, which means that all cell renderers in a single row are managed
- * by one single MobileGridRowRenderer that  delegates the individual  cell renderers to light-weight sub-renderers. </p>
+ *  </p>
+ * <p>Internally,  MobileGrid inherits for Mobile spark.List component rather than any Grid or DataGrid, which means that all cell renderers
+ * in a single row are managed   by one single MobileGridRowRenderer that  delegates the individual  cell renderers to light-weight sub-renderers. </p>
  * <p> You usually don't access this internal row renderer yourself, and will rather define the individual cell renderers.</p>
- * <p> This technique ensures optimal display and memory performance, which is critical for mobile devices,, at the price of less flexibility for cell renderers </p>
+ * <p> This technique ensures optimal display and memory performance, which is critical for mobile devices,, at the price of less flexibility for cell renderers. </p>
  *
  *  @see spark.components.supportClasses.MobileGridColumn
  *
@@ -94,7 +94,7 @@ public class MobileGrid extends List
     [SkinPart(required="true")]
     public var headerGroup:MobileGridHeader;
 
-    private var _columns: Array;
+    private var _columns:Array;
     private var _columnsChanged:Boolean = false;
     private var _sortableColumns:Boolean = true;
     private var lastSortIndex:int = -1;
@@ -174,7 +174,8 @@ public class MobileGrid extends List
     override protected function commitProperties():void
     {
         super.commitProperties();
-        if (_columnsChanged){
+        if (_columnsChanged)
+        {
             _columnsChanged = false;
             for (var i:int = 0; i < _columns.length; i++)
             {
@@ -195,12 +196,12 @@ public class MobileGrid extends List
         return l;
     }
 
-    protected function initDefaultItemRenderer(pcolumnDescriptors: Array):void
+    protected function initDefaultItemRenderer(pcolumnDescriptors:Array):void
     {
         var cf:ClassFactory;
         cf = new ClassFactory(MobileGridRowRenderer);
         cf.properties = {
-            partRendererDescriptors: Vector.<IPartRendererDescriptor>(pcolumnDescriptors)
+            partRendererDescriptors: Vector.<PartRendererDescriptorBase>(pcolumnDescriptors)
         };
         this.itemRenderer = cf;
     }
@@ -230,10 +231,10 @@ public class MobileGrid extends List
     private function headerGroup_sortChangeHandler(event:MobileGridHeaderEvent):void
     {
         var e:MobileGridHeaderEvent = MobileGridHeaderEvent(event.clone());
-        dispatchEvent( e)
+        dispatchEvent(e)
         if (!e.isDefaultPrevented())
         {
-                 sortByColumn(e.columnIndex);
+            sortByColumn(e.columnIndex);
         }
     }
 
@@ -243,7 +244,7 @@ public class MobileGrid extends List
         var collection:ICollectionView = dataProvider as ICollectionView;
         var c:MobileGridColumn = _columns[index];
         if (!c.sortable)
-            return ;
+            return;
         var desc:Boolean = c.sortDescending;
 
         // do the sort if we're allowed to
@@ -297,6 +298,11 @@ public class MobileGrid extends List
     }
 
 
+    override public function validateSize(recursive:Boolean = false):void
+    {
+        super.validateSize(recursive);
+    }
+
 
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
index 7194e75..ab802f3 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
@@ -34,6 +34,10 @@ public interface IItemPartRendererBase extends IDataRenderer
      */
     function set styleProvider(value:IStyleClient):void ;
 
+    function get canSetWidth():Boolean;
+
+    function get canSetHeight():Boolean;
+
     /**
      * @private
      */
@@ -50,6 +54,5 @@ public interface IItemPartRendererBase extends IDataRenderer
     function getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number;
 
 
-
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
index 69c3008..edcc0f9 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
@@ -19,10 +19,6 @@
 package spark.components.itemRenderers
 {
 
-import flash.display.DisplayObjectContainer;
-
-import mx.core.IDataRenderer;
-
 public interface IItemTextPartRenderer extends IItemPartRendererBase
 {
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
index b5e7abe..c95195b 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
@@ -19,15 +19,18 @@
 package spark.components.itemRenderers
 {
 
-import mx.core.BitmapAsset;
+import mx.core.mx_internal;
+import mx.graphics.BitmapFillMode;
 import mx.styles.IStyleClient;
 
-import spark.utils.MultiDPIBitmapSourceExt;
+import spark.primitives.BitmapImage;
+
+use namespace mx_internal;
 
 /** Default lightweight  class for rendering embedded Bitmaps  or Multi-DPI Bitmaps in a MobileGrid cell .
  * <p> You define the icon to be used in each cell by setting either iconField or iconFunction properties.  </p>
  *  */
-public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRendererBase
+public class ItemBitmapPartRenderer extends BitmapImage implements IItemPartRendererBase
 {
 
     private var _iconFunction:Function = null;
@@ -37,6 +40,7 @@ public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRend
     public function ItemBitmapPartRenderer()
     {
         super();
+        _fillMode = BitmapFillMode.REPEAT; // do not stretch
     }
 
     /**
@@ -69,12 +73,12 @@ public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRend
      *  <pre>iconFunction(item:Object):Object</pre>
      *
      *  <p>The <code>item</code> parameter is the data provider item for an entire row.</p>
-     *  <p> The function must return either an embedded bitmap's class, or a MultiBitmapSourceExt object .</p>
+     *  <p> The function must return either an embedded bitmap's class, or a MultiBitmapSource object .</p>
      *
      *  @default null
      *
      *  @see #iconLabel
-     *  @see  spark.utils.MultiDPIBitmapSourceExt
+     *  @see  spark.utils.MultiDPIBitmapSource
      *
      */
     public function get iconFunction():Function
@@ -89,26 +93,9 @@ public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRend
 
     public function set data(value:Object):void
     {
-        var iconClass:Class;
         _data = value;
         var iconSource:Object = _iconFunction != null ? _iconFunction(_data) : _data[_iconField];
-        if (iconSource is MultiDPIBitmapSourceExt)
-        {
-            iconClass = MultiDPIBitmapSourceExt(iconSource).getSource(NaN) as Class;
-        }
-        else
-        {
-            iconClass = iconSource as Class;
-        }
-        if (iconClass != null)
-        {
-            var icon:BitmapAsset = new iconClass();
-            this.bitmapData = icon.bitmapData;
-        }
-        else
-        {
-            this.bitmapData = null;
-        }
+        this.source = iconSource;
     }
 
     public function get data():Object
@@ -116,29 +103,26 @@ public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRend
         return _data;
     }
 
-    public function getPreferredBoundsWidth(postLayoutTransform:Boolean = true):Number
+    public function set styleProvider(value:IStyleClient):void
     {
-        return bitmapData.width;
+        // do nothing, this renderer does not manages styles for now.
     }
 
-    public function getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number
+    public function set cssStyleName(value:String):void
     {
-        return bitmapData.height;
-    }
 
-    override public function setActualSize(newWidth:Number, newHeight:Number):void
-    {
-        // do nothing, bitmap renderer don't stretch for now
     }
 
-    public function set styleProvider(value:IStyleClient):void
+    /* to avoid any scaling artifacts, we do not allow bitmap to be stretcghed */
+
+    public function get canSetWidth():Boolean
     {
-        // do nothing, this renderer does not manages styles for now.
+        return false;
     }
 
-    public function set cssStyleName(value:String):void
+    public function get canSetHeight():Boolean
     {
+        return false;
     }
-
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
index afb991e..ca3f542 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
@@ -91,6 +91,16 @@ public class ItemTextPartRenderer extends StyleableTextField implements IItemTex
     {
         _labelFunction = value;
     }
+
+    public function get canSetWidth():Boolean
+    {
+        return true;
+    }
+
+    public function get canSetHeight():Boolean
+    {
+        return false;
+    }
 }
 }
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as
deleted file mode 100644
index c81f9f6..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as
+++ /dev/null
@@ -1,34 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 spark.components.supportClasses
-{
-
-import mx.core.IFactory;
-
-import spark.components.itemRenderers.IItemPartRendererBase;
-
-public interface IPartRendererDescriptor
-{
-    function get scaledWidth():Number;
-
-    function get itemRenderer():IFactory;
-
-    function createPartRenderer():IItemPartRendererBase;
-}
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
new file mode 100644
index 0000000..44c2c46
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
@@ -0,0 +1,97 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+import mx.core.mx_internal;
+
+import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.utils.UIComponentUtils;
+
+use namespace  mx_internal;
+
+/** @private
+ *    this class is responsible for laying out grid cells in a given MobileGrid row.
+ *    It will make sure that cell content is aligned according to the column widths.
+ */
+public class ListMultiPartColumnLayout extends ListMultiPartLayoutBase
+{
+
+    public function ListMultiPartColumnLayout(target:ListMultiPartItemRendererBase)
+    {
+        super(target);
+    }
+
+    override public function measure():void
+    {
+        super.measure();
+        var totalWidth:Number = 0;
+        for each (var ld:PartRendererDescriptorBase in partRendererDescriptors)
+        {
+            totalWidth += ld.dpiScaledWidth;
+        }
+        target.measuredWidth = totalWidth;
+        target.measuredMinWidth = 50;
+    }
+
+    /* vertical align middle
+     * Layout algorithm:   give all columns the requested sizes, and the last column the remaining width  */
+    override public function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+
+        if (unscaledWidth == 0 && unscaledHeight == 0)
+            return;   // not ready
+        var cellPaddingLeft:Number = target.getStyle("paddingLeft");
+        var cellPaddingRight:Number = target.getStyle("paddingRight");
+        var paddingTop:Number = target.getStyle("paddingTop");
+        var paddingBottom:Number = target.getStyle("paddingBottom");
+        var cellHeight:Number = unscaledHeight - paddingTop - paddingBottom;
+
+        var desc:PartRendererDescriptorBase;
+        var dpr:IItemPartRendererBase;
+        var remainingWidth:Number = unscaledWidth;
+        var curX:Number = cellPaddingLeft;
+        var curY:Number = paddingTop;
+        var colWidth:Number;
+        var partWidth:Number;
+        var partHeight:Number;
+        var count:int = partRenderers.length - 1;
+        for (var i:int = 0; i <= count; i++)
+        {
+            dpr = partRenderers[i];
+            desc = partRendererDescriptors[i];
+            colWidth = desc.dpiScaledWidth;
+            if (dpr.canSetWidth)
+            {
+                // expand last column to fill width, unless it has explicity width
+                partWidth = Math.max(0, ( i == count && !desc.hasExplicitWidth) ? remainingWidth : colWidth - cellPaddingLeft - cellPaddingRight);
+            }
+            else
+            {
+                partWidth = dpr.getPreferredBoundsHeight();
+            }
+            partHeight = dpr.canSetHeight ? cellHeight : dpr.getPreferredBoundsHeight();
+            ;
+            setElementSize(dpr, partWidth, partHeight);
+            setElementPosition(dpr, curX, curY + UIComponentUtils.offsetForCenter(partHeight, cellHeight));
+            curX += colWidth;
+            remainingWidth -= colWidth;
+        }
+    }
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
index e53a968..8f07d5c 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
@@ -21,30 +21,44 @@ package spark.components.supportClasses
 import flash.display.DisplayObject;
 
 import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.core.DisplayObjectSharingMode;
+import spark.core.IGraphicElement;
+import spark.core.IGraphicElementContainer;
+import spark.core.ISharedDisplayObject;
 
 /**  @private
  *  This is the base class for multi-part renderers that manages a vector of part renderers.
  *  This class is responsible for creating and storing  the actual renderers from their descriptors
  *  the layout of the part renderers is delegated to a subclass of ListMultiPartLayoutBase;
  */
-public class ListMultiPartItemRendererBase extends ItemRendererBase
+public class ListMultiPartItemRendererBase extends ItemRendererBase implements IGraphicElementContainer, ISharedDisplayObject
 {
-    private var _partRendererDescriptors:Vector.<IPartRendererDescriptor>;
+    private var _partRendererDescriptors:Vector.<PartRendererDescriptorBase>;
     private var _partRenderers:Vector.<IItemPartRendererBase>;
+    private var _graphicElementPartRenderers:Vector.<IGraphicElement>;
     private var _partRenderersLayout:ListMultiPartLayoutBase;
 
+    /**
+     * Management of graphicElement part renderers  lifeCycle
+     */
+    private var _redrawRequested:Boolean = false;
+    private var graphicElementsNeedValidateProperties:Boolean = false;
+    private var graphicElementsNeedValidateSize:Boolean = false;
+
     public function ListMultiPartItemRendererBase()
     {
     }
 
-    /* set by DataGridMobile Factory */
-    public function set partRendererDescriptors(value:Vector.<IPartRendererDescriptor>):void
+    /** @private
+     * set in List itemRenderer Factory properties */
+    public function set partRendererDescriptors(value:Vector.<PartRendererDescriptorBase>):void
     {
         _partRendererDescriptors = value;
-        _partRenderers = new Vector.<IItemPartRendererBase>(_partRendererDescriptors.length);
+        _partRenderers = new Vector.<IItemPartRendererBase>(_partRendererDescriptors.length, true);
+        _graphicElementPartRenderers = new Vector.<IGraphicElement>();
     }
 
-    public function get partRendererDescriptors():Vector.<IPartRendererDescriptor>
+    public function get partRendererDescriptors():Vector.<PartRendererDescriptorBase>
     {
         return _partRendererDescriptors;
     }
@@ -64,11 +78,17 @@ public class ListMultiPartItemRendererBase extends ItemRendererBase
         return _partRenderers;
     }
 
+    public function get graphicElementPartRenderers():Vector.<IGraphicElement>
+    {
+        return _graphicElementPartRenderers;
+    }
+
     override protected function createChildren():void
     {
         super.createChildren();
-        var desc:IPartRendererDescriptor;
+        var desc:PartRendererDescriptorBase;
         var pr:IItemPartRendererBase;
+        var ge:IGraphicElement;
         for (var i:int = 0; i < _partRendererDescriptors.length; i++)
         {
             desc = _partRendererDescriptors[i];
@@ -76,13 +96,27 @@ public class ListMultiPartItemRendererBase extends ItemRendererBase
             if (pr != null)
             {
                 pr.styleProvider = this;
-                addChild(DisplayObject(pr));
+
+                if (pr is IGraphicElement)
+                {
+                    ge = IGraphicElement(pr);
+                    ge.parentChanged(this);
+                    if (ge.setSharedDisplayObject(this))
+                    {
+                        ge.displayObjectSharingMode = DisplayObjectSharingMode.USES_SHARED_OBJECT;
+                    }
+                    _graphicElementPartRenderers.push(ge);
+                }
+                else if (pr is DisplayObject)
+                {
+                    addChild(DisplayObject(pr));
+                }
                 _partRenderers[i] = pr;
             }
             else
             {
                 //TODO move to resource bundle
-                throw  new Error("MobileGridColumn item renderer must implement spark.components.itemRenderers.IItemPartRendererBase") ;
+                throw  new Error("MobileGridColumn item renderer must implement spark.components.itemRenderers.IItemPartRendererBase");
             }
         }
     }
@@ -93,9 +127,9 @@ public class ListMultiPartItemRendererBase extends ItemRendererBase
         _partRenderersLayout.measure();
     }
 
-   /** delegate children layout to its partRendererLayout
-    subclasses can override this method to layout chrome content
-    */
+    /** delegate children layout to its partRendererLayout
+     subclasses can override this method to layout chrome content
+     */
     override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
     {
         _partRenderersLayout.layoutContents(unscaledWidth, unscaledHeight);
@@ -112,6 +146,120 @@ public class ListMultiPartItemRendererBase extends ItemRendererBase
         invalidateSize();
     }
 
+    /*  graphic element sub renderers lifecycle management */
+
+    override protected function commitProperties():void
+    {
+        if (graphicElementsNeedValidateProperties)
+        {
+            graphicElementsNeedValidateProperties = false;
+            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
+            {
+                _graphicElementPartRenderers[i].validateProperties();
+            }
+        }
+        super.commitProperties();
+    }
+
+
+    override public function validateSize(recursive:Boolean = false):void
+    {
+        if (graphicElementsNeedValidateSize)
+        {
+            graphicElementsNeedValidateSize = false;
+            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
+            {
+                _graphicElementPartRenderers[i].validateSize();
+            }
+        }
+        super.validateSize(recursive);
+    }
+
+
+    /* copied from Group*/
+    override public function validateDisplayList():void
+    {
+        super.validateDisplayList();
+        if (_redrawRequested)
+        {
+            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
+            {
+                _graphicElementPartRenderers[i].validateDisplayList();
+            }
+        }
+    }
+
+    /* interfaces implementation, copied from spark.components.IconItemRender  */
+
+    /**
+     *  @inheritDoc
+     *
+     *  <p>We implement this as part of ISharedDisplayObject so the iconDisplay
+     *  can share our display object.</p>
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get redrawRequested():Boolean
+    {
+        return _redrawRequested;
+    }
+
+    /**
+     *  @private
+     */
+    public function set redrawRequested(value:Boolean):void
+    {
+        _redrawRequested = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  IGraphicElementContainer
+    //
+    // -------------------------------------------------------------------------
+
+    /**
+     * @private
+     *
+     *  Notify the host component that an element changed and needs to validate properties.
+     */
+    public function invalidateGraphicElementSharing(element:IGraphicElement):void
+    {
+        //do nothing because all has been done in createChildren and won't change
+    }
+
+    /**
+     * @private
+     *
+     *  Notify the host component that an element changed and needs to validate properties.
+     */
+    public function invalidateGraphicElementProperties(element:IGraphicElement):void
+    {
+        graphicElementsNeedValidateProperties = true;
+        invalidateProperties();
+    }
+
+    /**
+     * @private
+     */
+    public function invalidateGraphicElementSize(element:IGraphicElement):void
+    {
+        graphicElementsNeedValidateSize = true;
+        invalidateSize();
+    }
+
+    /**
+     * @private
+     *
+     */
+    public function invalidateGraphicElementDisplayList(element:IGraphicElement):void
+    {
+        if (element.displayObject is ISharedDisplayObject)
+            ISharedDisplayObject(element.displayObject).redrawRequested = true;
+        invalidateDisplayList();
+    }
 
 
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
index 0c8c5ff..21593b1 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
@@ -22,6 +22,7 @@ import mx.core.IFlexDisplayObject;
 import mx.core.ILayoutElement;
 
 import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.core.IGraphicElement;
 
 /** @private
  *   Abstract base class for laying out part renderers in a multi-part renderer.
@@ -41,11 +42,17 @@ public class ListMultiPartLayoutBase extends Object
         return _target;
     }
 
-    protected function get partRendererDescriptors():Vector.<IPartRendererDescriptor>
+    protected function get partRendererDescriptors():Vector.<PartRendererDescriptorBase>
     {
         return target.partRendererDescriptors;
     }
 
+    protected function get graphicElementPartRenderers():Vector.<IGraphicElement>
+    {
+        return target.graphicElementPartRenderers;
+    }
+
+
     protected function get partRenderers():Vector.<IItemPartRendererBase>
     {
         return target.partRenderers;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as
deleted file mode 100644
index f211a8c..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as
+++ /dev/null
@@ -1,82 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 spark.components.supportClasses
-{
-import spark.components.itemRenderers.IItemPartRendererBase;
-import spark.utils.UIComponentUtils;
-
-/** @private
- *    this class is reponsible for laying out grid cells in a given MobileGrid row.
- *    It will make sure that cell content is aligned according to the column widths.
- */
-public class ListMultiPartTabbedLayout extends ListMultiPartLayoutBase
-{
-
-    public function ListMultiPartTabbedLayout(target:ListMultiPartItemRendererBase)
-    {
-        super(target);
-    }
-
-    override public function measure():void
-    {
-        super.measure();
-        var totalWidth:Number = 0;
-        for each (var ld:IPartRendererDescriptor in partRendererDescriptors)
-        {
-            totalWidth += ld.scaledWidth;
-        }
-        target.measuredWidth = totalWidth;
-        target.measuredMinWidth = 50;
-    }
-
-    /* vertical align middle
-     * Layout algorithm:   give all columns the requested sizes, and the last column the remaining width  */
-    override public function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-
-        if (unscaledWidth == 0 && unscaledHeight == 0)
-            return;   // not ready
-        var cellPaddingLeft:Number = target.getStyle("paddingLeft");
-        var cellPaddingRight:Number = target.getStyle("paddingRight");
-        var paddingTop:Number = target.getStyle("paddingTop");
-        var paddingBottom:Number = target.getStyle("paddingBottom");
-        var cellHeight:Number = unscaledHeight - paddingTop - paddingBottom;
-
-        var desc:IPartRendererDescriptor;
-        var dpr:IItemPartRendererBase;
-        var remainingWidth:Number = unscaledWidth;
-        var curX:Number = cellPaddingLeft;
-        var curY:Number = paddingTop;
-        var partWidth:Number;
-        var partHeight:Number;
-        var count:int = partRenderers.length - 1;
-        for (var i:int = 0; i <= count; i++)
-        {
-            dpr = partRenderers[i];
-            desc = partRendererDescriptors[i];
-            partHeight = dpr.getPreferredBoundsHeight();
-            partWidth = Math.max(0, i == count ? remainingWidth : desc.scaledWidth - cellPaddingLeft - cellPaddingRight);
-            setElementSize(dpr, partWidth, partHeight);
-            setElementPosition(dpr, curX, curY + UIComponentUtils.offsetForCenter(partHeight, cellHeight));
-            curX += partWidth + cellPaddingRight + cellPaddingLeft;
-            remainingWidth -= desc.scaledWidth;
-        }
-    }
-}
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
index a404bb2..9c49428 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
@@ -48,13 +48,13 @@ public class MobileGridColumn extends PartRendererDescriptorBase
     private var _headerText:String = null;
     private var _headerStyleName:String;
     private var _sortDescending:Boolean;
-    private var _sortable: Boolean = true;
+    private var _sortable:Boolean = true;
 
     public function MobileGridColumn(target:IEventDispatcher = null)
     {
         super(target);
         labelFunction = null;
-        width = 100; // default width;
+        setWidth(100); // default width;
         itemRenderer = null; // will set default ;
     }
 
@@ -64,7 +64,7 @@ public class MobileGridColumn extends PartRendererDescriptorBase
      */
     public function get headerText():String
     {
-        return _headerText != null ? _headerText : dataField ;
+        return _headerText != null ? _headerText : dataField;
     }
 
     public function set headerText(value:String):void

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
index 1cdfbf6..f92075b 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
@@ -60,10 +60,10 @@ public class MobileGridHeader extends ButtonBar
     protected var ascIconCls:MultiDPIBitmapSource;
 
     private var _dataGrid:MobileGrid;
-    private var _columns: Array;
+    private var _columns:Array;
     private var _sortIndex:int = -1;
 
-      public function MobileGridHeader()
+    public function MobileGridHeader()
     {
         this.labelField = "headerText";
         this.iconFunction = getIconForButton;
@@ -103,8 +103,9 @@ public class MobileGridHeader extends ButtonBar
     {
         event.preventDefault();      // to clear selection
         var i:int = event.newIndex;
-        var c: MobileGridColumn = _columns[i];
-        if (_dataGrid.sortableColumns && c.sortable)   {
+        var c:MobileGridColumn = _columns[i];
+        if (_dataGrid.sortableColumns && c.sortable)
+        {
             var headerEvent:MobileGridHeaderEvent = new MobileGridHeaderEvent(MobileGridHeaderEvent.SORT_CHANGE, c.colNum, false, true);
             // HEADER_RELEASE event is cancelable
             dispatchEvent(headerEvent);
@@ -129,9 +130,9 @@ public class MobileGridHeader extends ButtonBar
         var button:UIComponent = UIComponent(event.renderer);
         var index:int = event.index;
         var col:MobileGridColumn = MobileGridColumn(_columns[index]);
-        // don't size the last button
-        if (index != dataProvider.length - 1)
-            button.explicitWidth = col.scaledWidth;
+        // expand the last button
+        if ((index != dataProvider.length - 1) || col.hasExplicitWidth)
+            button.explicitWidth = col.dpiScaledWidth;
         else
             button.percentWidth = 100;
     }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
index 0461d22..b2a8d3e 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
@@ -27,7 +27,7 @@ public class MobileGridRowRenderer extends ListMultiPartItemRendererBase
 {
     public function MobileGridRowRenderer()
     {
-        partRenderersLayout = new ListMultiPartTabbedLayout(this);
+        partRenderersLayout = new ListMultiPartColumnLayout(this);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
index 57a3cbb..23ce03e 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
@@ -34,23 +34,25 @@ import spark.utils.DensityUtil2;
 /**  This is the base class for GridColumn
  *
  */
-public class PartRendererDescriptorBase extends EventDispatcher implements IPartRendererDescriptor
+public class PartRendererDescriptorBase extends EventDispatcher
 {
 
     private var _colNum:int;
     private var _dataField:String;
     private var _width:Number;
-    private var _scaledWidth:Number;
+    private var _hasExplicitWidth:Boolean;
+    private var _dpiScaledWidth:Number;
     private var _itemRenderer:IFactory;
     private var _labelFunction:Function;
     private var _styleName:String;
     private var _textAlign:String;
 
+
     public function PartRendererDescriptorBase(target:IEventDispatcher = null)
     {
         super(target);
         _labelFunction = null;
-        width = 100; // default width;
+        setWidth(100); // default width;
         itemRenderer = null; // will set default ;
     }
 
@@ -103,44 +105,25 @@ public class PartRendererDescriptorBase extends EventDispatcher implements IPart
         _styleName = value;
     }
 
-    /** set the desired width of the column at the application's current DPI (or 160 if none)
-     * default value is 100
-     * the actual pixel width maybe higher if the runtimeDPI or application DPI  are different than 160
+    /** Set the desired width for this column.
+     * <p> Width value is expressed in current applicationDPI, or at 160 DPI  if applicationDPI is not set.</p>
+     * Default value is 100.
+     * Note that the last column will always expand
      *
      * @param value = desired width of the column at 160 DPI
      */
     public function set width(value:Number):void
     {
-        _width = value;
-        _scaledWidth = DensityUtil2.dpiScale(value, DPIClassification.DPI_160);
+        setWidth(value);
+        _hasExplicitWidth = true;
     }
 
-    /** set the desired width of the column at the application's current DPI (or 160 if none)
-     * default value is 100
-     * the actual pixel width maybe higher if the runtimeDPI or application DPI  are different than 160
-     *
-     * @param value = desired width of the column at 160 DPI
-     */
-    public function set widthAt160DPI(value:Number):void
+    protected function setWidth(value:Number):void
     {
         _width = value;
-        _scaledWidth = DensityUtil2.dpiScale(value, DPIClassification.DPI_160);
+        _dpiScaledWidth = DensityUtil2.dpiScale(value, DPIClassification.DPI_160);
     }
 
-    public function get scaledWidth():Number
-    {
-        return  _scaledWidth;
-    }
-
-    mx_internal function get colNum():int
-    {
-        return _colNum;
-    }
-
-    mx_internal function set colNum(value:int):void
-    {
-        _colNum = value;
-    }
 
     public function get itemRenderer():IFactory
     {
@@ -169,8 +152,10 @@ public class PartRendererDescriptorBase extends EventDispatcher implements IPart
         if (pr)
         {
             pr.cssStyleName = _styleName;
-            if (pr is IItemTextPartRenderer)  {
-                with( IItemTextPartRenderer(pr)){
+            if (pr is IItemTextPartRenderer)
+            {
+                with (IItemTextPartRenderer(pr))
+                {
                     labelField = _dataField;
                     labelFunction = _labelFunction;
                     textAlign = _textAlign;
@@ -180,5 +165,25 @@ public class PartRendererDescriptorBase extends EventDispatcher implements IPart
         return pr;
     }
 
+    mx_internal function get hasExplicitWidth():Boolean
+    {
+        return _hasExplicitWidth;
+    }
+
+    mx_internal function get dpiScaledWidth():Number
+    {
+        return  _dpiScaledWidth;
+    }
+
+    mx_internal function get colNum():int
+    {
+        return _colNum;
+    }
+
+    mx_internal function set colNum(value:int):void
+    {
+        _colNum = value;
+    }
+
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as b/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
index 06558b7..31e1462 100644
--- a/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
+++ b/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
@@ -22,7 +22,7 @@ import flash.events.Event;
 
 /**
  *  The MobileGridHeaderEvent class represents events that are dispatched when
-    the user clicks  on the header of a column in the DataGrid to sort it.
+ the user clicks  on the header of a column in the DataGrid to sort it.
  *
  *  @see spark.components.MobileGrid
  *

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
index 20c46a0..35353f8 100644
--- a/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
@@ -33,7 +33,6 @@ import spark.components.supportClasses.MobileGridHeader;
 import spark.layouts.HorizontalAlign;
 import spark.layouts.VerticalLayout;
 import spark.skins.mobile.supportClasses.MobileSkin;
-import spark.utils.MultiDPIBitmapSource;
 import spark.utils.MultiDPIBitmapSourceExt;
 
 use namespace mx_internal;
@@ -73,7 +72,7 @@ public class MobileGridSkin extends MobileSkin
                 minWidth = 100;
                 break;
         }
-        var headerShadowSrc:MultiDPIBitmapSource = new MultiDPIBitmapSourceExt();
+        var headerShadowSrc:MultiDPIBitmapSourceExt = new MultiDPIBitmapSourceExt();
         headerShadowSrc.source320dpi = headerShadowCls320;
         headerShadowSrc.source160dpi = headerShadowCls160;
         headerShadowCls = Class(headerShadowSrc.getSource(NaN));

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
index 8c76e73..7f447ad 100644
--- a/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
@@ -20,7 +20,6 @@ package spark.utils
 {
 
 import mx.core.FlexGlobals;
-import mx.core.mx_internal;
 import mx.managers.SystemManager;
 
 import spark.components.Application;
@@ -28,38 +27,16 @@ import spark.components.Application;
 public class DensityUtil2
 {
 
-    use namespace mx_internal;
-
     private static var _setApplicationDPI:Number = 0;
 
-    /**  Calculates a scale factor to be used when element authored for  <code>sourceDPI</code>
-     *   two algorithms: <br/>
-     *   Application.applicationDPI has been set, which means scaling factor  occurs already, so additional scaling is required, return 1
-     *  Application.applicationDPI has not been set, then return runTimeDPI / sourceDPI
-     *  examples:
-     *  runtimeDPI = 320 and sourceDPI = 160 and  applicationDPI not set  (ie=320) => 2
-     *  runtimeDPI = 160 and sourceDPI = 160 and applicationDPI not set (ie=160)  => 1
-     *  runtimeDPI = 160 and sourceDPI = 160 and applicationDPI = 160 => 1
-     *  runtimeDPI = 320 and sourceDPI = 160 and applicationDPI = 160 => 1 (scaling occurs)
+    /**  returns the actual  value for  a value authored for  <code>sourceDPI</code>, taking into account any dpi scaling.
+     *  <ul>
+     *      <li> If Application.applicationDPI has been set, which means dpi scaling factor is already applied, return the original value.</li>
+     *     <li> If Application.applicationDPI has not been set, then return scaled value runTimeDPI / sourceDPI   </li>
+     *  </li>
      * @param sourceDPI
-     * @return  scale factor
+     * @return  scaled value
      */
-
-    public static function getPostDPIScale(sourceDPI:Number):Number
-    {
-
-        var appDPI:Number = getSetApplicationDPI();
-        if (isNaN(appDPI))
-        {
-            // was not set,
-            var runDPI:Number = FlexGlobals.topLevelApplication.runtimeDPI;
-            return runDPI / sourceDPI;
-        }
-        else
-            return 1.0; //  already scaled
-    }
-
-
     public static function dpiScale(value:Number, sourceDPI:Number):Number
     {
         var appDPI:Number = getSetApplicationDPI();
@@ -70,9 +47,10 @@ public class DensityUtil2
         }
         else
             return value; //  already scaled
-
     }
 
+    /**
+     *  returns the applicationDPI that was explicitly set in top level application , or NaN if none */
     private static function getSetApplicationDPI():Number
     {
         if (_setApplicationDPI == 0)

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
index eb3ac03..ce17ffe 100644
--- a/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
@@ -24,10 +24,28 @@ import mx.utils.DensityUtil;
 public class MultiDPIBitmapSourceExt extends MultiDPIBitmapSource
 {
 
+    /**
+     *  Select one of the sourceXXXdpi properties based on the given DPI.  This
+     *  function handles the fallback to different sourceXXXdpi properties
+     *  if the given one is null.
+     *  The strategy is to try to choose the next highest
+     *  property if it is not null, then return a lower property if not null, then
+     *  just return null.
+     *  If desiredDPI is NaN or 0, return the sourceXXXdpi for the  runtime DPI .
+     *
+     *  @param The desired DPI.
+     *
+     *  @return One of the sourceXXXdpi properties based on the desired DPI.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Flex 4.5
+     */
 
     override public function getSource(desiredDPI:Number):Object
     {
-        if (isNaN(desiredDPI))
+        if (isNaN(desiredDPI) || (desiredDPI == 0))
         {
             var app:Object = FlexGlobals.topLevelApplication;
             var dpi:Number;
@@ -40,5 +58,8 @@ public class MultiDPIBitmapSourceExt extends MultiDPIBitmapSource
         else
             return super.getSource(desiredDPI);
     }
+
+    //TODO mamsellem move this code to parent class, updates any callers, and remove this class
+
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
index 0ecf82c..93f6f8e 100644
--- a/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
@@ -18,40 +18,12 @@
 ////////////////////////////////////////////////////////////////////////////////
 package spark.utils
 {
-import mx.collections.IList;
 import mx.core.IFlexDisplayObject;
 import mx.core.ILayoutElement;
-import mx.core.UIComponent;
-
-import spark.components.IItemRendererOwner;
 
 public class UIComponentUtils
 {
 
-    /* fast function based on char length and not on pixel length*/
-    public static function computeLongestItem(listComponent:IItemRendererOwner, dataProvider:IList, max:int = 10):Object
-    {
-        if (!dataProvider)
-        {
-            return null;
-        }
-        max = Math.min(max, dataProvider.length);
-        var maxLength:int = 0;
-        var longestItem:Object;
-        var item:Object;
-        var itemStringLength:int;
-        for (var i:int = 0; i < max; i++)
-        {
-            item = dataProvider.getItemAt(i);
-            itemStringLength = listComponent.itemToLabel(item).length;
-            if (itemStringLength >= maxLength)
-            {
-                maxLength = itemStringLength;
-                longestItem = item;
-            }
-        }
-        return longestItem;
-    }
 
     public static function itemToLabel(item:Object, labelField:String, labelFunction:Function, nullLabel:String = '-'):String
     {
@@ -69,12 +41,6 @@ public class UIComponentUtils
         }
     }
 
-    public static function clearBoundsSize(comp:UIComponent):void
-    {
-        comp.explicitWidth = NaN; // was set before
-        comp.explicitHeight = NaN;
-        comp.setLayoutBoundsSize(NaN, NaN);
-    }
 
     public static function setElementSize(element:Object, width:Number, height:Number):void
     {


Mime
View raw message