http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/HScrollBarSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/HScrollBarSkin.as b/tourdeflexmobile/src/spark/skins/android4/HScrollBarSkin.as deleted file mode 100644 index d2cb3dd..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/HScrollBarSkin.as +++ /dev/null @@ -1,205 +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.skins.android4 -{ - - import mx.core.DPIClassification; - import mx.core.mx_internal; - - import spark.components.Button; - import spark.components.HScrollBar; - import spark.skins.mobile.supportClasses.MobileSkin; - - use namespace mx_internal; - - /** - * ActionScript-based skin for HScrollBar components in mobile applications. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public class HScrollBarSkin extends MobileSkin - { - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public function HScrollBarSkin() - { - super(); - - minWidth = 20; - thumbSkinClass = HScrollBarThumbSkin; - var paddingBottom:int; - var paddingHorizontal:int; - - // Depending on density set our measured height - switch (applicationDPI) - { - case DPIClassification.DPI_640: - { - minHeight = 24; - paddingBottom = HScrollBarThumbSkin.PADDING_BOTTOM_640DPI; - paddingHorizontal = HScrollBarThumbSkin.PADDING_HORIZONTAL_640DPI; - break; - } - case DPIClassification.DPI_480: - { - minHeight = 18; - paddingBottom = HScrollBarThumbSkin.PADDING_BOTTOM_480DPI; - paddingHorizontal = HScrollBarThumbSkin.PADDING_HORIZONTAL_480DPI; - break; - } - case DPIClassification.DPI_320: - { - minHeight = 12; - paddingBottom = HScrollBarThumbSkin.PADDING_BOTTOM_320DPI; - paddingHorizontal = HScrollBarThumbSkin.PADDING_HORIZONTAL_320DPI; - break; - } - case DPIClassification.DPI_240: - { - minHeight = 9; - paddingBottom = HScrollBarThumbSkin.PADDING_BOTTOM_240DPI; - paddingHorizontal = HScrollBarThumbSkin.PADDING_HORIZONTAL_240DPI; - break; - } - case DPIClassification.DPI_120: - { - minHeight = 5; - paddingBottom = HScrollBarThumbSkin.PADDING_BOTTOM_120DPI; - paddingHorizontal = HScrollBarThumbSkin.PADDING_HORIZONTAL_120DPI; - break; - } - default: - { - // default DPI_160 - minHeight = 6; - paddingBottom = HScrollBarThumbSkin.PADDING_BOTTOM_DEFAULTDPI; - paddingHorizontal = HScrollBarThumbSkin.PADDING_HORIZONTAL_DEFAULTDPI; - break; - } - } - - // The minimum width is set such that, at it's smallest size, the thumb appears - // as wide as it is high. - minThumbWidth = (minHeight - paddingBottom) + (paddingHorizontal * 2); - } - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - */ - public var hostComponent:HScrollBar; - - /** - * Minimum width for the thumb - */ - protected var minThumbWidth:Number; - - /** - * Skin to use for the thumb Button skin part - */ - protected var thumbSkinClass:Class; - - //-------------------------------------------------------------------------- - // - // Skin parts - // - //-------------------------------------------------------------------------- - /** - * HScrollbar track skin part. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public var track:Button; - - /** - * HScrollbar thumb skin part. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public var thumb:Button; - - - //-------------------------------------------------------------------------- - // - // Overridden methods - // - //-------------------------------------------------------------------------- - /** - * @private - */ - override protected function createChildren():void - { - // Create our skin parts if necessary: track and thumb. - if (!track) - { - // We don't want a visible track so we set the skin to MobileSkin - track = new Button(); - track.setStyle("skinClass", spark.skins.mobile.supportClasses.MobileSkin); - track.width = minWidth; - track.height = minHeight; - addChild(track); - } - - if (!thumb) - { - thumb = new Button(); - thumb.minWidth = minThumbWidth; - thumb.setStyle("skinClass", thumbSkinClass); - thumb.width = minHeight; - thumb.height = minHeight; - addChild(thumb); - } - } - - /** - * @private - */ - override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void - { - super.layoutContents(unscaledWidth, unscaledHeight); - - setElementSize(track, unscaledWidth, unscaledHeight); - } - } -}
http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/HScrollBarThumbSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/HScrollBarThumbSkin.as b/tourdeflexmobile/src/spark/skins/android4/HScrollBarThumbSkin.as deleted file mode 100644 index 5c63d15..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/HScrollBarThumbSkin.as +++ /dev/null @@ -1,169 +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.skins.android4 -{ - - import flash.display.CapsStyle; - import flash.display.JointStyle; - import flash.display.LineScaleMode; - - import mx.core.DPIClassification; - import mx.core.mx_internal; - - import spark.components.Button; - import spark.skins.mobile.supportClasses.MobileSkin; - - use namespace mx_internal; - - /** - * ActionScript-based skin for the HScrollBar thumb skin part in mobile applications. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public class HScrollBarThumbSkin extends MobileSkin - { - //-------------------------------------------------------------------------- - // - // Class constants - // - //-------------------------------------------------------------------------- - - // These constants are also accessed from HScrollBarSkin - mx_internal static const PADDING_BOTTOM_640DPI:int = 10; - mx_internal static const PADDING_HORIZONTAL_640DPI:int = 8; - mx_internal static const PADDING_BOTTOM_480DPI:int = 8; - mx_internal static const PADDING_HORIZONTAL_480DPI:int = 6; - mx_internal static const PADDING_BOTTOM_320DPI:int = 5; - mx_internal static const PADDING_HORIZONTAL_320DPI:int = 4; - mx_internal static const PADDING_BOTTOM_240DPI:int = 4; - mx_internal static const PADDING_HORIZONTAL_240DPI:int = 3; - mx_internal static const PADDING_BOTTOM_120DPI:int = 2; - mx_internal static const PADDING_HORIZONTAL_120DPI:int = 2; - mx_internal static const PADDING_BOTTOM_DEFAULTDPI:int = 3; - mx_internal static const PADDING_HORIZONTAL_DEFAULTDPI:int = 2; - - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public function HScrollBarThumbSkin() - { - super(); - - // Depending on density set padding - switch (applicationDPI) - { - case DPIClassification.DPI_480: - { - paddingBottom = PADDING_BOTTOM_480DPI; - paddingHorizontal = PADDING_HORIZONTAL_480DPI; - break; - } - case DPIClassification.DPI_320: - { - paddingBottom = PADDING_BOTTOM_320DPI; - paddingHorizontal = PADDING_HORIZONTAL_320DPI; - break; - } - case DPIClassification.DPI_240: - { - paddingBottom = PADDING_BOTTOM_240DPI; - paddingHorizontal = PADDING_HORIZONTAL_240DPI; - break; - } - default: - { - paddingBottom = PADDING_BOTTOM_DEFAULTDPI; - paddingHorizontal = PADDING_HORIZONTAL_DEFAULTDPI; - break; - } - } - } - - //-------------------------------------------------------------------------- - // - // Properties - // - //-------------------------------------------------------------------------- - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - */ - public var hostComponent:Button; - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - /** - * Padding from bottom. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var paddingBottom:int; - - /** - * Horizontal padding from left and right. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var paddingHorizontal:int; - - - //-------------------------------------------------------------------------- - // - // Overridden methods - // - //-------------------------------------------------------------------------- - - /** - * @private - */ - override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void - { - super.drawBackground(unscaledWidth, unscaledHeight); - - var thumbHeight:Number = unscaledHeight - paddingBottom; - - graphics.beginFill(getStyle("thumbColor"), 1); - graphics.drawRect(paddingHorizontal + .5, 0.5, unscaledWidth - 2 * paddingHorizontal, thumbHeight); - - graphics.endFill(); - } - } -} http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/HSliderSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/HSliderSkin.as b/tourdeflexmobile/src/spark/skins/android4/HSliderSkin.as deleted file mode 100644 index f89d3b9..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/HSliderSkin.as +++ /dev/null @@ -1,293 +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.skins.android4 -{ - import flash.display.BlendMode; - import flash.display.DisplayObject; - import flash.events.Event; - - import mx.core.ClassFactory; - import mx.core.IFactory; - - import spark.components.Button; - import spark.components.HSlider; - import spark.skins.android4.assets.HSliderTrack_filled; - import spark.skins.mobile.supportClasses.HSliderDataTip; - import spark.skins.mobile.supportClasses.MobileSkin; - - /** - * Android 4.x specific ActionScript-based skin for HSlider controls in mobile applications. - * - * <p>The base Flex implementation creates an HSlider with fixed height - * and variable width with a fixed-size thumb. As the height of the - * HSlider component increases, the vertical dimensions of the visible HSlider remain - * the same, and the HSlider stays vertically centered.</p> - * - * <p>The thumb and track implementations can be customized by subclassing - * this skin class and overriding the thumbSkinClass, trackSkinClass, - * and/or dataTipClass variables as necessary.</p> - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public class HSliderSkin extends MobileSkin - { - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - * - */ - public function HSliderSkin() - { - super(); - - thumbSkinClass = spark.skins.android4.HSliderThumbSkin; - trackSkinClass = spark.skins.android4.HSliderTrackSkin; - filledTrackSkinClass = spark.skins.android4.assets.HSliderTrack_filled; - dataTipClass = spark.skins.mobile.supportClasses.HSliderDataTip; - - blendMode = BlendMode.LAYER; - } - - //-------------------------------------------------------------------------- - // - // Properties - // - //-------------------------------------------------------------------------- - - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - */ - private var _hostComponent:HSlider; - - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - */ - public function get hostComponent():HSlider - { - return _hostComponent; - } - - public function set hostComponent(value:HSlider):void - { - if (_hostComponent) - _hostComponent.removeEventListener(Event.CHANGE, thumbPositionChanged_handler); - _hostComponent = value; - if (_hostComponent) - _hostComponent.addEventListener(Event.CHANGE, thumbPositionChanged_handler); - } - - //-------------------------------------------------------------------------- - // - // Skin parts - // - //-------------------------------------------------------------------------- - - /** - * HSlider track skin part - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public var track:Button; - - /** - * HSlider track skin part that - * depicts area that is filled - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public var filledTrack:DisplayObject; - - /** - * HSlider thumb skin part - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public var thumb:Button; - - /** - * HSlider dataTip class factory - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public var dataTip:IFactory; - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - - /** - * Specifies the skin class that will be used for the HSlider thumb. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var thumbSkinClass:Class; - - /** - * Specifies the skin class that will be used for the HSlider track. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var trackSkinClass:Class; - /** - * Specifies the skin class that will be used for the HSlider track's - * filled area. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var filledTrackSkinClass:Class; - - /** - * Specifies the class that will be used for the HSlider datatip. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var dataTipClass:Class; - - //-------------------------------------------------------------------------- - // - // Overridden methods - // - //-------------------------------------------------------------------------- - - /** - * @private - */ - override protected function commitCurrentState():void - { - if (currentState == "disabled") - alpha = 0.5; - else if (currentState == "normal") - alpha = 1; - } - - /** - * @private - */ - override protected function createChildren():void - { - // Create our skin parts: track and thumb - track = new Button(); - track.setStyle("skinClass", trackSkinClass); - addChild(track); - - filledTrack = new filledTrackSkinClass(); - addChild(filledTrack); - - thumb = new Button(); - thumb.setStyle("skinClass", thumbSkinClass); - addChild(thumb); - - // Set up the class factory for the dataTip - dataTip = new ClassFactory(); - ClassFactory(dataTip).generator = dataTipClass; - } - - /** - * @private - * The HSliderSkin width will be no less than the width of the thumb skin. - * The HSliderSkin height will be no less than the greater of the heights of - * the thumb and track skins. - */ - override protected function measure():void - { - measuredWidth = track.getPreferredBoundsWidth(); - measuredHeight = Math.max(track.getPreferredBoundsHeight(), thumb.getPreferredBoundsHeight()); - - measuredMinHeight = Math.max(track.getPreferredBoundsHeight(), thumb.getPreferredBoundsHeight()); - measuredMinWidth = thumb.getPreferredBoundsWidth(); - } - - /** - * @private - */ - override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void - { - super.layoutContents(unscaledWidth, unscaledHeight); - - // minimum height is no smaller than the larger of the thumb or track - var calculatedSkinHeight:int = Math.max(Math.max(thumb.getPreferredBoundsHeight(), track.getPreferredBoundsHeight()), - unscaledHeight); - - // minimum width is no smaller than the thumb - var calculatedSkinWidth:int = Math.max(thumb.getPreferredBoundsWidth(), - unscaledWidth); - - // once we know the skin height, center the thumb and track - thumb.y = Math.max(Math.round((calculatedSkinHeight - thumb.getPreferredBoundsHeight()) / 2), 0); - var calculatedTrackY:int = Math.max(Math.round((calculatedSkinHeight - track.getPreferredBoundsHeight()) / 2), 0); - - // size and position - setElementSize(thumb, thumb.getPreferredBoundsWidth(), thumb.getPreferredBoundsHeight()); // thumb does NOT scale - setElementSize(track, calculatedSkinWidth, track.getPreferredBoundsHeight()); // note track is NOT scaled vertically - setElementPosition(track, 0, calculatedTrackY); - - //Set size and position of filled area based on thumb's current location - var filledTrackWidth:Number = thumb.getLayoutBoundsX(); - setElementSize(filledTrack, filledTrackWidth, track.getPreferredBoundsHeight()); // note track is NOT scaled vertically - setElementPosition(filledTrack, track.x + HSliderTrackSkin(track.skin).visibleTrackOffset , calculatedTrackY); - } - - private function thumbPositionChanged_handler(event:Event):void - { - //Just trigger a redraw so that the filled area of the track updates itself - invalidateDisplayList(); - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/HSliderThumbSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/HSliderThumbSkin.as b/tourdeflexmobile/src/spark/skins/android4/HSliderThumbSkin.as deleted file mode 100644 index 517ff93..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/HSliderThumbSkin.as +++ /dev/null @@ -1,333 +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.skins.android4 -{ -import flash.display.DisplayObject; - -import mx.core.DPIClassification; - -import spark.components.Button; -import spark.skins.android4.assets.HSliderThumb_normal; -import spark.skins.mobile.supportClasses.MobileSkin; - -/** - * Android 4.x specific ActionScript-based skin for the HSlider thumb skin part in mobile applications. - * - * <p>Note that this particular implementation defines a hit zone which is larger than - * the visible thumb for better usability on mobile screens.</p> - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ -public class HSliderThumbSkin extends MobileSkin -{ - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - * - */ - public function HSliderThumbSkin() - { - super(); - - thumbNormalClass = spark.skins.android4.assets.HSliderThumb_normal; - thumbPressedClass = spark.skins.android4.assets.HSliderThumb_pressed; - - // set the dimensions to use based on the screen density - switch (applicationDPI) - { - case DPIClassification.DPI_640: - { - thumbImageWidth = 116; - thumbImageHeight = 116; - - hitZoneOffset = 20; - hitZoneSideLength = 160; - - break; - } - case DPIClassification.DPI_480: - { - // Note provisional may need changes - thumbImageWidth = 88; - thumbImageHeight = 88; - - hitZoneOffset = 20; - hitZoneSideLength = 130; - - break; - } - case DPIClassification.DPI_320: - { - thumbImageWidth = 58; - thumbImageHeight = 58; - - hitZoneOffset = 10; - hitZoneSideLength = 80; - - break; - } - case DPIClassification.DPI_240: - { - thumbImageWidth = 44; - thumbImageHeight = 44; - - hitZoneOffset = 10; - hitZoneSideLength = 65; - - break; - } - case DPIClassification.DPI_120: - { - thumbImageWidth = 22; - thumbImageHeight = 22; - - hitZoneOffset = 5; - hitZoneSideLength = 33; - - break; - } - default: - { - // default DPI_160 - thumbImageWidth = 29; - thumbImageHeight = 29; - - hitZoneOffset = 5; - hitZoneSideLength = 40; - - break; - } - - } - } - - //-------------------------------------------------------------------------- - // - // Properties - // - //-------------------------------------------------------------------------- - - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - */ - public var hostComponent:Button; - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - - // FXG thumb classes - /** - * Specifies the FXG class to use when the thumb is in the normal state - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var thumbNormalClass:Class; - - /** - * Specifies the FXG class to use when the thumb is in the pressed state - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var thumbPressedClass:Class; - - /** - * Specifies the DisplayObject to use when the thumb is in the normal state - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var thumbSkin_normal:DisplayObject; - - /** - * Specifies the DisplayObject to use when the thumb is in the pressed state - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var thumbSkin_pressed:DisplayObject; - - /** - * Specifies the current DisplayObject that should be shown - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var currentThumbSkin:DisplayObject; - - /** - * Width of the overall thumb image - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var thumbImageWidth:int; - - /** - * Height of the overall thumb image - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var thumbImageHeight:int; - - /** - * Length of the sizes of the hitzone (assumed to be square) - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var hitZoneSideLength:int; - - /** - * Distance between the left edge of the hitzone and the left edge - * of the thumb - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var hitZoneOffset:int; - - /** - * @private - * Remember which state is currently being displayed - */ - private var displayedState:String; - - //-------------------------------------------------------------------------- - // - // Overridden methods - // - //-------------------------------------------------------------------------- - - /** - * @private - */ - override protected function commitCurrentState():void - { - if (currentState == "up") - { - // show the normal button - if (!thumbSkin_normal) - { - thumbSkin_normal = new thumbNormalClass(); - addChild(thumbSkin_normal); - } - else - { - thumbSkin_normal.visible = true; - } - currentThumbSkin = thumbSkin_normal; - - // hide the pressed button - if (thumbSkin_pressed) - thumbSkin_pressed.visible = false; - } - else if (currentState == "down") - { - // show the pressed button - if (!thumbSkin_pressed) - { - thumbSkin_pressed = new thumbPressedClass(); - addChild(thumbSkin_pressed); - } - else - { - thumbSkin_pressed.visible = true; - } - currentThumbSkin = thumbSkin_pressed; - - // hide the normal button - if (thumbSkin_normal) - thumbSkin_normal.visible = false; - } - - displayedState = currentState; - - invalidateDisplayList(); - } - - /** - * @private - */ - override protected function measure():void - { - measuredWidth = thumbImageWidth; - measuredHeight = thumbImageHeight; - } - - /** - * @private - */ - override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void - { - super.layoutContents(unscaledWidth, unscaledHeight); - - setElementSize(currentThumbSkin, unscaledWidth, unscaledHeight); - setElementPosition(currentThumbSkin, 0, 0) - } - - /** - * @private - */ - override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void - { - // put in a larger hit zone than the thumb - graphics.beginFill(0xffffff, 0); - graphics.drawRect(-hitZoneOffset, -hitZoneOffset, hitZoneSideLength, hitZoneSideLength); - graphics.endFill(); - } -} -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/HSliderTrackSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/HSliderTrackSkin.as b/tourdeflexmobile/src/spark/skins/android4/HSliderTrackSkin.as deleted file mode 100644 index 57dc8f3..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/HSliderTrackSkin.as +++ /dev/null @@ -1,227 +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.skins.android4 -{ - import flash.display.DisplayObject; - - import mx.core.DPIClassification; - - import spark.components.Button; - import spark.skins.android4.assets.HSliderTrack; - import spark.skins.mobile.supportClasses.MobileSkin; - - /** - * ActionScript-based skin for the HSlider track skin part in mobile applications. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public class HSliderTrackSkin extends MobileSkin - { - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - * - */ - public function HSliderTrackSkin() - { - super(); - - trackClass = spark.skins.android4.assets.HSliderTrack; - - // set the right dimensions to use based on the screen density - switch (applicationDPI) - { - case DPIClassification.DPI_640: - { - trackWidth = 1200; - trackHeight = 8; - - visibleTrackOffset = 48; - - break; - } - case DPIClassification.DPI_480: - { - trackWidth = 900; - trackHeight = 6; - - visibleTrackOffset = 38; - - break; - } - case DPIClassification.DPI_320: - { - trackWidth = 600; - trackHeight = 4; - - visibleTrackOffset = 24; - - break; - } - case DPIClassification.DPI_240: - { - trackWidth = 450; - trackHeight = 3; - - visibleTrackOffset = 18; - - break; - } - case DPIClassification.DPI_120: - { - trackWidth = 225; - trackHeight = 2; - - visibleTrackOffset = 9; - - break; - } - default: - { - // default DPI_160 - trackWidth = 300; - trackHeight = 2; - - visibleTrackOffset = 12; - - break; - } - } - } - - //-------------------------------------------------------------------------- - // - // Properties - // - //-------------------------------------------------------------------------- - - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - */ - public var hostComponent:Button; - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - - /** - * Specifies the FXG class to use for the track image - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var trackClass:Class; - - /** - * Specifies the DisplayObject for the track image - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var trackSkin:DisplayObject; - - /** - * Specifies the track image width - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var trackWidth:int; - - /** - * Specifies the track image height - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - protected var trackHeight:int; - - /** - * Specifies the offset from the left and right edge to where - * the visible track begins. This should match the offset in the FXG assets. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public var visibleTrackOffset:int; - - //-------------------------------------------------------------------------- - // - // Overridden methods - // - //-------------------------------------------------------------------------- - - /** - * @private - */ - override protected function createChildren():void - { - trackSkin = new trackClass(); - addChild(trackSkin); - } - - /** - * @private - */ - override protected function measure():void - { - measuredWidth = trackWidth; - measuredHeight = trackHeight; - } - - /** - * @private - */ - override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void - { - super.layoutContents(unscaledWidth, unscaledHeight); - - var unscaledTrackWidth:int = unscaledWidth - (2 * visibleTrackOffset); - setElementSize(trackSkin, unscaledTrackWidth, unscaledHeight); - setElementPosition(trackSkin, visibleTrackOffset, 0); - } - - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/ListSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/ListSkin.as b/tourdeflexmobile/src/spark/skins/android4/ListSkin.as deleted file mode 100644 index c78a212..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/ListSkin.as +++ /dev/null @@ -1,204 +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.skins.android4 -{ - import flash.display.BlendMode; - import flash.display.DisplayObject; - import flash.display.Sprite; - - import mx.core.ClassFactory; - import mx.core.mx_internal; - - import spark.components.DataGroup; - import spark.components.List; - import spark.components.Scroller; - import spark.layouts.HorizontalAlign; - import spark.layouts.VerticalLayout; - import spark.skins.mobile.supportClasses.MobileSkin; - //import skins.Scrollers; - - //import skins.Scroller; - - use namespace mx_internal; - - /** - * ActionScript-based skin for the List components in mobile applications. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public class ListSkin extends MobileSkin - { - - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - * - */ - public function ListSkin() - { - super(); - - minWidth = 112; - blendMode = BlendMode.NORMAL; - } - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - */ - public var hostComponent:List; - - - //-------------------------------------------------------------------------- - // - // Skin parts - // - //-------------------------------------------------------------------------- - /** - * Scroller skin part. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public var scroller:Scroller; - - /** - * DataGroup skin part. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public var dataGroup:DataGroup; - - - //-------------------------------------------------------------------------- - // - // Overridden methods - // - //-------------------------------------------------------------------------- - /** - * @private - */ - override protected function commitCurrentState():void - { - super.commitCurrentState(); - - alpha = currentState.indexOf("disabled") == -1 ? 1 : 0.5; - } - - - /** - * @private - */ - override protected function createChildren():void - { - if (!dataGroup) - { - // Create data group layout - var layout:VerticalLayout = new VerticalLayout(); - layout.requestedMinRowCount = 5; - layout.horizontalAlign = HorizontalAlign.JUSTIFY; - layout.gap = 0; - - // Create data group - dataGroup = new DataGroup(); - dataGroup.layout = layout; - dataGroup.itemRenderer = new ClassFactory(spark.components.LabelItemRenderer); - } - if (!scroller) - { - // Create scroller - scroller = new Scroller(); - scroller.minViewportInset = 0; - scroller.hasFocusableChildren = false; - - // scroller.pullEnabled = false; - // scroller.bounceEnabled = false; - // scroller.scrollSnappingMode = "center"; - - addChild(scroller); - } - - // Associate scroller with data group - if (!scroller.viewport) - { - scroller.viewport = dataGroup; - - } - } - - /** - * @private - */ - override protected function measure():void - { - measuredWidth = scroller.getPreferredBoundsWidth(); - measuredHeight = scroller.getPreferredBoundsHeight(); - - } - - /** - * @private - */ - override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void - { - super.updateDisplayList(unscaledWidth, unscaledHeight); - - var borderWidth:int = getStyle("borderVisible") ? 1 : 0; - - // Background - graphics.beginFill(getStyle("contentBackgroundColor"), getStyle("contentBackgroundAlpha")); - graphics.drawRect(borderWidth, borderWidth, unscaledWidth - 2 * borderWidth, unscaledHeight - 2 * borderWidth); - graphics.endFill(); - - // Border - if (getStyle("borderVisible")) - { - graphics.lineStyle(.5, getStyle("borderColor"), getStyle("borderAlpha"), true); - graphics.drawRect(0, 0, unscaledWidth - 1, unscaledHeight - 1); - } - // Scroller - //scroller.minViewportInset = borderWidth; - setElementSize(scroller, unscaledWidth, unscaledHeight); - setElementPosition(scroller, 0, 0); - - } - } -} http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/RadioButtonSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/RadioButtonSkin.as b/tourdeflexmobile/src/spark/skins/android4/RadioButtonSkin.as deleted file mode 100644 index fd74645..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/RadioButtonSkin.as +++ /dev/null @@ -1,253 +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.skins.android4 -{ - -import flash.display.DisplayObject; - -import mx.core.DPIClassification; - -import spark.skins.android4.assets.RadioButton_up; -import spark.skins.mobile.supportClasses.SelectableButtonSkinBase; - -/** - * ActionScript-based skin for RadioButton controls in mobile applications. - * - * @see spark.components.RadioButton - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ -public class RadioButtonSkin extends SelectableButtonSkinBase -{ - //-------------------------------------------------------------------------- - // - // Class constants - // - //-------------------------------------------------------------------------- - - /** - * @private - */ - static private const exclusions:Array = ["labelDisplay", "labelDisplayShadow"]; - - //-------------------------------------------------------------------------- - // - // Member variables - // - //-------------------------------------------------------------------------- - - protected var symbolOffsetX:Number; - protected var symbolOffsetY:Number; - protected var iconWidth:Number; - protected var iconHeight:Number; - protected var symbolWidth:Number; - protected var symbolHeight:Number; - - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - * - */ - public function RadioButtonSkin() - { - super(); - - layoutPaddingLeft = 0; - layoutPaddingRight = 0; - layoutPaddingTop = 0; - layoutPaddingBottom = 0; - - upIconClass = spark.skins.android4.assets.RadioButton_up; - upSelectedIconClass = spark.skins.android4.assets.RadioButton_up; - downIconClass = spark.skins.android4.assets.RadioButton_down; - downSelectedIconClass = spark.skins.android4.assets.RadioButton_down; - upSymbolIconClass = null; - downSymbolIconClass = null; - upSymbolIconSelectedClass = spark.skins.android4.assets.RadioButton_upSymbolSelected; - downSymbolIconSelectedClass = spark.skins.android4.assets.RadioButton_downSymbolSelected; - - switch (applicationDPI) - { - case DPIClassification.DPI_640: - { - - layoutGap = 16; - minWidth = 128; - minHeight = 128; - iconWidth = 128; - iconHeight = 128; - symbolWidth = 44; - symbolHeight = 44; - symbolOffsetX = 44; - symbolOffsetY = 44; - - break; - } - case DPIClassification.DPI_480: - { - - layoutGap = 12; - minWidth = 96; - minHeight = 96; - iconWidth = 96; - iconHeight = 96; - symbolWidth = 33; - symbolHeight = 33; - symbolOffsetX = 33; - symbolOffsetY = 33; - - break; - } - case DPIClassification.DPI_320: - { - - layoutGap = 8; - minWidth = 64; - minHeight = 64; - iconWidth = 64; - iconHeight = 64; - symbolWidth = 22; - symbolHeight = 22; - symbolOffsetX = 22; - symbolOffsetY = 22; - - break; - } - case DPIClassification.DPI_240: - { - - layoutGap = 6; - minWidth = 48; - minHeight = 48; - iconWidth = 48; - iconHeight = 48; - symbolWidth = 16.5; - symbolHeight = 16.5; - symbolOffsetX = 16.5; - symbolOffsetY = 16.5; - - break; - } - case DPIClassification.DPI_120: - { - - layoutGap = 3; - minWidth = 24; - minHeight = 24; - iconWidth = 24; - iconHeight = 24; - symbolWidth = 8.25; - symbolHeight = 8.25; - symbolOffsetX = 8.25; - symbolOffsetY = 8.25; - - break; - } - default: - { - - layoutGap = 4; - minWidth = 32; - minHeight = 32; - iconWidth = 32; - iconHeight = 32; - symbolWidth = 11; - symbolHeight = 11; - symbolOffsetX = 11; - symbolOffsetY = 11; - - break; - } - } - } - - //-------------------------------------------------------------------------- - // - // Overridden methods - // - //-------------------------------------------------------------------------- - - /** - * @private - * RadioButton <code>chromeColor</code> is drawn to match the FXG ellipse - * shape and position. - */ - override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void - { - // super draws a transparent hit zone - super.drawBackground(unscaledWidth, unscaledHeight); - - // get the size and position of iconDisplay - var currentIcon:DisplayObject = getIconDisplay(); - - graphics.beginFill(getStyle("chromeColor")); - graphics.drawEllipse(currentIcon.x + 1, currentIcon.y + 1, currentIcon.width - 2, currentIcon.height - 2); - graphics.endFill(); - } - - /** - * @private - */ - override protected function get focusSkinExclusions():Array - { - return exclusions; - } - - override protected function commitCurrentState():void - { - super.commitCurrentState(); - if(symbolIcon != null) - { - symbolIcon.width = symbolWidth; - symbolIcon.height = symbolHeight; - } - var iconDisplay:DisplayObject = getIconDisplay(); - if(iconDisplay != null) - { - iconDisplay.width = iconWidth; - iconDisplay.height = iconHeight; - } - } - - override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void - { - super.layoutContents(unscaledWidth, unscaledHeight); - // position the symbols to align with the background "icon" - if (symbolIcon) - { - var currentIcon:DisplayObject = getIconDisplay(); - setElementPosition(symbolIcon, symbolOffsetX, symbolOffsetY); - } - } -} -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/SpinnerListContainerSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/SpinnerListContainerSkin.as b/tourdeflexmobile/src/spark/skins/android4/SpinnerListContainerSkin.as deleted file mode 100644 index a626c49..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/SpinnerListContainerSkin.as +++ /dev/null @@ -1,327 +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.skins.android4 -{ - import flash.display.Graphics; - import flash.display.InteractiveObject; - import flash.display.Sprite; - - import mx.core.DPIClassification; - import mx.core.mx_internal; - - import spark.components.Group; - import spark.components.SpinnerListContainer; - import spark.layouts.HorizontalLayout; - import spark.skins.android4.assets.SpinnerListContainerBackground; - import spark.skins.android4.assets.SpinnerListContainerSelectionIndicator; - import spark.skins.android4.assets.SpinnerListContainerShadow; - import spark.skins.mobile.supportClasses.MobileSkin; - - use namespace mx_internal; - /** - * ActionScript-based skin for the SpinnerListContainer in mobile applications. - * - * @see spark.components.SpinnerListContainer - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - public class SpinnerListContainerSkin extends MobileSkin - { - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - * - */ - public function SpinnerListContainerSkin() - { - super(); - - borderClass = spark.skins.android4.assets.SpinnerListContainerBackground; - selectionIndicatorClass = spark.skins.android4.assets.SpinnerListContainerSelectionIndicator; - shadowClass = spark.skins.android4.assets.SpinnerListContainerShadow; - cornerRadius = 0; - borderThickness = 0; - switch (applicationDPI) - { - case DPIClassification.DPI_640: - { - selectionIndicatorHeight = 182; - break; - } - case DPIClassification.DPI_480: - { - selectionIndicatorHeight = 144; - break; - } - case DPIClassification.DPI_320: - { - selectionIndicatorHeight = 96; - break; - } - case DPIClassification.DPI_240: - { - selectionIndicatorHeight = 72; - break; - } - case DPIClassification.DPI_120: - { - selectionIndicatorHeight = 36; - break; - } - default: // default DPI_160 - { - selectionIndicatorHeight = 48; - - break; - } - } - - minWidth = 30; - } - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - /** - * Pixel thickness of the border. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var borderThickness:Number; - - /** - * Radius of the border corners. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var cornerRadius:Number; - - /** - * Height of the selection indicator. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var selectionIndicatorHeight:Number; - - /** - * Class for the border part. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var borderClass:Class; - - /** - * Class for the selection indicator skin part. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var selectionIndicatorClass:Class; - - /** - * Class for the shadow skin part. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var shadowClass:Class; - - /** - * Border skin part which includes the background. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var border:InteractiveObject; - - /** - * Selection indicator skin part. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var selectionIndicator:InteractiveObject; - - /** - * Shadow skin part. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var shadow:InteractiveObject; - - /** - * Mask for the content group. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var contentGroupMask:Sprite; - - //-------------------------------------------------------------------------- - // - // Skin parts - // - //-------------------------------------------------------------------------- - - /** - * An optional skin part that defines the Group where the content - * children are pushed into and laid out. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - public var contentGroup:Group; - - //-------------------------------------------------------------------------- - // - // Properties - // - //-------------------------------------------------------------------------- - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - public var hostComponent:SpinnerListContainer; - - //-------------------------------------------------------------------------- - // - // Overridden Methods - // - //-------------------------------------------------------------------------- - /** - * @private - */ - override protected function createChildren():void - { - super.createChildren(); - - if (!border) - { - // Border and background - border = new borderClass(); - border.mouseEnabled = false; - addChild(border); - } - - if (!contentGroup) - { - // Contains the child elements - contentGroup = new Group(); - var hLayout:HorizontalLayout = new HorizontalLayout(); - hLayout.gap = 0; - hLayout.verticalAlign = "middle"; - contentGroup.layout = hLayout; - contentGroup.id = "contentGroup"; - addChild(contentGroup); - } - - if (!shadow) - { - // Shadowing sits on top of the content - shadow = new shadowClass(); - shadow.mouseEnabled = false; - addChild(shadow); - } - - - if (!contentGroupMask) - { - // Create a mask for the content - contentGroupMask = new Sprite(); - addChild(contentGroupMask); - } - } - - /** - * @private - */ - override protected function measure():void - { - super.measure(); - - var contentW:Number = contentGroup.getPreferredBoundsWidth(); - var contentH:Number = contentGroup.getPreferredBoundsHeight(); - - measuredWidth = measuredMinWidth = contentW + borderThickness * 2; - measuredHeight = contentH + borderThickness * 2; - - } - - /** - * @private - */ - override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void - { - super.layoutContents(unscaledWidth, unscaledHeight); - - setElementSize(contentGroup, unscaledWidth - borderThickness * 2, unscaledHeight - borderThickness * 2); - setElementPosition(contentGroup, borderThickness, borderThickness); - - // Inset by the borderThickness horizontally because the selectionIndicator starts at 0 - setElementSize(border, unscaledWidth - borderThickness * 2, unscaledHeight); - setElementPosition(border, borderThickness, 0); - - 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. - // We inset the mask on the left and right sides to accomplish this. - var g:Graphics = contentGroupMask.graphics; - g.clear(); - g.beginFill(0x00FF00); - g.drawRoundRect(borderThickness * 2, borderThickness, unscaledWidth - borderThickness * 4, unscaledHeight - borderThickness * 2, cornerRadius, cornerRadius); - g.endFill(); - - contentGroup.mask = contentGroupMask; - } - } -} - http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/SpinnerListScrollerSkin.mxml ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/SpinnerListScrollerSkin.mxml b/tourdeflexmobile/src/spark/skins/android4/SpinnerListScrollerSkin.mxml deleted file mode 100644 index 270818e..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/SpinnerListScrollerSkin.mxml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - -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. - ---> - - -<!-- - -Scroller unconditionally sets its skin's layout to private layout -implementation that handles the scroll policies. Scroller skins can -only provide replacement scrollbars. The skin's layout and -constraints or dimensions set on skin parts will not be honored. To -gain more control over the layout of a viewport and its scrollbars, -instead of using Scroller, add them to a Group and use the ScrollBar component's -viewport property to link them together. - ---> - -<!--- The default skin class for the Spark Scroller that is used by the SpinnerList component. - -@see spark.components.SpinnerList -@see spark.components.Scroller - -@langversion 3.0 -@playerversion AIR 3 -@productversion Flex 4.6 ---> -<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"> - - <fx:Metadata> - <![CDATA[ - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - [HostComponent("spark.components.Scroller")] - ]]> - </fx:Metadata> - - <fx:Script> - <![CDATA[ - /** - * @private - */ - override public function beginHighlightBitmapCapture() : Boolean - { - var needUpdate:Boolean = super.beginHighlightBitmapCapture(); - - // Draw an opaque rect that fill our entire skin. Our background - // is transparent, but we don't want focus/error skins to - // poke through. This is safe to do since we don't have any - // graphic elements as direct children. - graphics.beginFill(0); - graphics.drawRect(0, 0, width, height); - graphics.endFill(); - - return needUpdate; - } - - /** - * @private - */ - override public function endHighlightBitmapCapture() : Boolean - { - var needUpdate:Boolean = super.endHighlightBitmapCapture(); - - // Clear the rect we drew in beginBitmapCapture(); - graphics.clear(); - - return needUpdate; - } - ]]> - </fx:Script> - -</s:SparkSkin> - http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/SpinnerListSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/SpinnerListSkin.as b/tourdeflexmobile/src/spark/skins/android4/SpinnerListSkin.as deleted file mode 100644 index 006fddb..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/SpinnerListSkin.as +++ /dev/null @@ -1,293 +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.skins.android4 -{ - import flash.display.InteractiveObject; - - import mx.core.ClassFactory; - import mx.core.DPIClassification; - 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.android4.assets.SpinnerListContainerSelectionIndicator; - import spark.skins.mobile.supportClasses.MobileSkin; - - - use namespace mx_internal; - /** - * ActionScript-based skin for the SpinnerList in mobile applications. - * - * @see spark.components.SpinnerList - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - public class SpinnerListSkin extends MobileSkin - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - public function SpinnerListSkin() - { - 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; - } - } - - } - - //-------------------------------------------------------------------------- - // - // Skin parts - // - //-------------------------------------------------------------------------- - - /** - * Scroller skin part. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - public var scroller:Scroller; - - /** - * DataGroup skin part. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - public var dataGroup:DataGroup; - - //-------------------------------------------------------------------------- - // - // Properties - // - //-------------------------------------------------------------------------- - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - public var hostComponent:SpinnerList; - - /** - * Pixel size of the border. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var borderThickness:int; - - /** - * Class for the selection indicator skin part. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var selectionIndicatorClass:Class; - - /** - * Selection indicator skin part. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var selectionIndicator:InteractiveObject; - - /** - * Height of the selection indicator. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - protected var selectionIndicatorHeight:Number; - - //-------------------------------------------------------------------------- - // - // Overridden Methods - // - //-------------------------------------------------------------------------- - - /** - * @private - */ - override protected function commitCurrentState():void - { - super.commitCurrentState(); - - alpha = currentState.indexOf("disabled") == -1 ? 1 : 0.5; - } - - /** - * @private - */ - override protected function createChildren():void - { - super.createChildren(); - - if (!dataGroup) - { - // Create data group layout - var layout:VerticalSpinnerLayout = new VerticalSpinnerLayout(); - layout.requestedRowCount = 5; - // Create data group - dataGroup = new DataGroup(); - dataGroup.id = "dataGroup"; - dataGroup.layout = layout; - - dataGroup.itemRenderer = new ClassFactory(spark.components.SpinnerListItemRenderer); - } - - if (!scroller) - { - // Create scroller - scroller = new Scroller(); - scroller.id = "scroller"; - scroller.hasFocusableChildren = false; - scroller.ensureElementIsVisibleForSoftKeyboard = false; - // Only support vertical scrolling - scroller.setStyle("verticalScrollPolicy","on"); - scroller.setStyle("horizontalScrollPolicy", "off"); - scroller.setStyle("skinClass", spark.skins.android4.SpinnerListScrollerSkin); - - addChild(scroller); - } - - if (!selectionIndicator) - { - // Selection indicator is on top - selectionIndicator = new selectionIndicatorClass(); - selectionIndicator.mouseEnabled = false; - addChild(selectionIndicator); - } - - // Associate scroller with data group - if (!scroller.viewport) - scroller.viewport = dataGroup; - } - - /** - * @private - */ - override protected function measure():void - { - measuredWidth = scroller.getPreferredBoundsWidth() + borderThickness * 2; - measuredHeight = scroller.getPreferredBoundsHeight(); - //add in for selection indicator - measuredMinHeight = selectionIndicatorHeight + borderThickness * 4; - minHeight = measuredMinHeight; - } - - /** - * @private - */ - override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void - { - super.layoutContents(unscaledWidth, unscaledHeight); - - // Scroller - setElementSize(scroller, unscaledWidth - borderThickness * 2, unscaledHeight); - setElementPosition(scroller, borderThickness, 0); - //selection indicator - unscaledHeight = Math.max(unscaledHeight, selectionIndicatorHeight + borderThickness * 4); - - setElementSize(selectionIndicator, unscaledWidth, selectionIndicatorHeight); - setElementPosition(selectionIndicator, 0, Math.floor((unscaledHeight - selectionIndicatorHeight) / 2)); - } - - /** - * @private - */ - override public function styleChanged(styleProp:String):void - { - // Reinitialize the typical element so it picks up the latest styles - // Font styles might impact the size of the SpinnerList - if (styleProp != "color" && styleProp != "accentColor") - { - if (dataGroup) - dataGroup.invalidateTypicalItemRenderer(); - } - - super.styleChanged(styleProp); - } - - } -} - http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/SplitViewNavigatorSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/SplitViewNavigatorSkin.as b/tourdeflexmobile/src/spark/skins/android4/SplitViewNavigatorSkin.as deleted file mode 100644 index ee06eea..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/SplitViewNavigatorSkin.as +++ /dev/null @@ -1,157 +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.skins.android4 -{ - import mx.core.mx_internal; - - import spark.components.Callout; - import spark.components.Group; - import spark.components.SkinnablePopUpContainer; - import spark.components.SplitViewNavigator; - import spark.layouts.HorizontalLayout; - import spark.skins.mobile.supportClasses.MobileSkin; - - use namespace mx_internal; - - /** - * The default skin for the SplitViewNavigator component. This skin is - * chromeless and doesn't draw a background, border or separator. - * It only contains a single content group with a horizontal layout to hold - * the navigators, and a Callout component. - * The Callout component uses the default values for its layout properties. - * - * @see spark.components.Callout - * @see spark.components.SplitViewNavigator - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - public class SplitViewNavigatorSkin extends MobileSkin - { - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion AIR 3 - * @productversion Flex 4.6 - */ - public function SplitViewNavigatorSkin() - { - super(); - } - - //-------------------------------------------------------------------------- - // - // SkinParts - // - //-------------------------------------------------------------------------- - - /** - * @copy spark.components.SkinnableContainer#contentGroup - */ - public var contentGroup:Group; - - /** - * @copy spark.components.SplitViewNavigator#viewNavigatorPopUp - */ - public var viewNavigatorPopUp:SkinnablePopUpContainer; - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - - /** - * @copy spark.skins.spark.ApplicationSkin#hostComponent - */ - public var hostComponent:SplitViewNavigator; - - //-------------------------------------------------------------------------- - // - // Overridden Methods - // - //-------------------------------------------------------------------------- - /** - * @private - */ - override protected function createChildren():void - { - // Create the layout for the content group - var hLayout:HorizontalLayout = new HorizontalLayout(); - - // A gap of 1 is used to reveal a thin line of the background between - // each child navigator. This serves as a divider. To change the look - // of the divider, change the backgroundColor style. - hLayout.gap = 1; - - // Create the contentGroup - contentGroup = new Group(); - contentGroup.id = "contentGroup"; - contentGroup.layout = hLayout; - addChild(contentGroup); - - // Create the callout but don't add it to display list - viewNavigatorPopUp = new Callout(); - viewNavigatorPopUp.id = "viewNavigatorPopUp"; - } - - /** - * @private - */ - override protected function measure():void - { - super.measure(); - - measuredWidth = contentGroup.getPreferredBoundsWidth(); - measuredHeight = contentGroup.getPreferredBoundsHeight(); - } - - /** - * @private - */ - override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void - { - super.layoutContents(unscaledWidth, unscaledHeight); - - contentGroup.setLayoutBoundsSize(unscaledWidth, unscaledHeight); - contentGroup.setLayoutBoundsPosition(0, 0); - } - - /** - * @private - */ - override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void - { - // Background is used to draw the divider between each navigator - var color:uint = getStyle("backgroundColor"); - graphics.beginFill(color); - graphics.drawRect(0, 0, unscaledWidth, unscaledHeight); - graphics.endFill(); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/TabbedViewNavigatorTabBarSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/TabbedViewNavigatorTabBarSkin.as b/tourdeflexmobile/src/spark/skins/android4/TabbedViewNavigatorTabBarSkin.as deleted file mode 100644 index eea5948..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/TabbedViewNavigatorTabBarSkin.as +++ /dev/null @@ -1,122 +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.skins.android4 -{ -import spark.components.ButtonBarButton; -import spark.components.DataGroup; -import spark.skins.mobile.supportClasses.ButtonBarButtonClassFactory; -import spark.skins.mobile.supportClasses.TabbedViewNavigatorTabBarHorizontalLayout; - -/** - * The Android 4.x specific skin class for the Spark TabbedViewNavigator tabBar skin part. - * It uses the ButtonBarFirstButtonSkin and ButtonBarMiddleButtonSkin as skins for first - * middle buttons - * - * @see spark.components.TabbedViewNavigator#tabBar - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ -public class TabbedViewNavigatorTabBarSkin extends ButtonBarSkin -{ - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - * - */ - public function TabbedViewNavigatorTabBarSkin() - { - super(); - } - - //-------------------------------------------------------------------------- - // - // Overridden methods - // - //-------------------------------------------------------------------------- - - /** - * @private - */ - override protected function createChildren():void - { - if (!firstButton) - { - firstButton = new ButtonBarButtonClassFactory(ButtonBarButton); - firstButton.skinClass = spark.skins.android4.ButtonBarFirstButtonSkin; - } - - if (!lastButton) - { - lastButton = new ButtonBarButtonClassFactory(ButtonBarButton); - lastButton.skinClass = spark.skins.android4.ButtonBarFirstButtonSkin; - } - - if (!middleButton) - { - middleButton = new ButtonBarButtonClassFactory(ButtonBarButton); - middleButton.skinClass = spark.skins.android4.ButtonBarMiddleButtonSkin; - } - - if (!dataGroup) - { - // TabbedViewNavigatorButtonBarHorizontalLayout for even percent layout - var tabLayout:TabbedViewNavigatorTabBarHorizontalLayout = - new TabbedViewNavigatorTabBarHorizontalLayout(); - tabLayout.useVirtualLayout = false; - - dataGroup = new DataGroup(); - dataGroup.layout = tabLayout; - addChild(dataGroup); - } - } - - /** - * @private - */ - override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void - { - super.drawBackground(unscaledWidth, unscaledHeight); - - // backgroundAlpha style is not supported by ButtonBar - // TabbedViewNavigatorSkin sets a hard-coded value to support - // overlayControls - var backgroundAlphaValue:* = getStyle("backgroundAlpha"); - var backgroundAlpha:Number = (backgroundAlphaValue === undefined) - ? 1 : getStyle("backgroundAlpha"); - - graphics.beginFill(getStyle("chromeColor"), backgroundAlpha); - graphics.drawRect(0, 0, unscaledWidth, unscaledHeight); - graphics.endFill(); - } -} -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-examples/blob/8ccec1f5/tourdeflexmobile/src/spark/skins/android4/TextAreaHScrollBarSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmobile/src/spark/skins/android4/TextAreaHScrollBarSkin.as b/tourdeflexmobile/src/spark/skins/android4/TextAreaHScrollBarSkin.as deleted file mode 100644 index 540318e..0000000 --- a/tourdeflexmobile/src/spark/skins/android4/TextAreaHScrollBarSkin.as +++ /dev/null @@ -1,105 +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.skins.android4 -{ -import mx.core.DPIClassification; -import mx.core.mx_internal; - -use namespace mx_internal; - - /** - * The default skin class for the Spark TextAreaHScrollBar component in mobile - * applications. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ -public class TextAreaHScrollBarSkin extends HScrollBarSkin -{ - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 2.5 - * @productversion Flex 4.5 - */ - public function TextAreaHScrollBarSkin() - { - super(); - - thumbSkinClass = TextAreaHScrollBarThumbSkin; - var paddingBottom:int; - var paddingHorizontal:int; - - switch (applicationDPI) - { - case DPIClassification.DPI_640: - { - minHeight = 30; - paddingBottom = TextAreaHScrollBarThumbSkin.PADDING_BOTTOM_320DPI; - paddingHorizontal = TextAreaHScrollBarThumbSkin.PADDING_HORIZONTAL_320DPI; - break; - } - case DPIClassification.DPI_480: - { - minHeight = 22; - paddingBottom = TextAreaHScrollBarThumbSkin.PADDING_BOTTOM_480DPI; - paddingHorizontal = TextAreaHScrollBarThumbSkin.PADDING_HORIZONTAL_480DPI; - break; - } - case DPIClassification.DPI_320: - { - minHeight = 15; - paddingBottom = TextAreaHScrollBarThumbSkin.PADDING_BOTTOM_320DPI; - paddingHorizontal = TextAreaHScrollBarThumbSkin.PADDING_HORIZONTAL_320DPI; - break; - } - case DPIClassification.DPI_240: - { - minHeight = 11; - paddingBottom = TextAreaHScrollBarThumbSkin.PADDING_BOTTOM_240DPI; - paddingHorizontal = TextAreaHScrollBarThumbSkin.PADDING_HORIZONTAL_240DPI; - break; - } - case DPIClassification.DPI_120: - { - minHeight = 11; - paddingBottom = TextAreaHScrollBarThumbSkin.PADDING_BOTTOM_120DPI; - paddingHorizontal = TextAreaHScrollBarThumbSkin.PADDING_HORIZONTAL_120DPI; - break; - } - default: - { - // default DPI_160 - minHeight = 9; - paddingBottom = TextAreaHScrollBarThumbSkin.PADDING_BOTTOM_DEFAULTDPI; - paddingHorizontal = TextAreaHScrollBarThumbSkin.PADDING_HORIZONTAL_DEFAULTDPI; - break; - } - } - - // The minimum width is set such that, at it's smallest size, the thumb appears - // as wide as it is high. - minThumbWidth = (minHeight - paddingBottom) + (paddingHorizontal * 2); - } -} -} \ No newline at end of file
