You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/04/26 01:35:30 UTC
[45/51] [partial] ADC articles donated by Adobe Systems Inc
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.fxpProperties
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.fxpProperties b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.fxpProperties
new file mode 100644
index 0000000..cfc200d
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.fxpProperties
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+ 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.
+
+-->
+<fxpProperties abbreviated="false" authoringTool="Flex Builder" compiles="true" parentProject="9a7ad751-b504-47c4-b161-acb6179d4b86" projectUUID="9a7ad751-b504-47c4-b161-acb6179d4b86" pureCatalystProject="false" sdkVersion="4.5.1" uuid="10ff9a86-6f6a-4b60-bd72-055df14a2c7c" version="15">
+ <projects/>
+ <src/>
+ <swc>
+ <linked location="sdkPlaceHolder" path="sdkPlaceHolder" position="0" uuid="10ff9a86-6f6a-4b60-bd72-055df14a2c7c"/>
+ <linked location="/libs" path="/libs" position="1" uuid="10ff9a86-6f6a-4b60-bd72-055df14a2c7c"/>
+ </swc>
+ <misc/>
+ <theme/>
+ <mxmlFormattingPrefs groupAttributesByState="true" maxLineWidth="100" mxmlAlignAttributes="true" mxmlAttributeOrder="id,userLabel,includeIn,excludeFrom,visible,x,y,z,left,right,top,bottom,width,height,minWidth,minHeight,maxWidth,maxHeight,label" mxmlKeepAttributeValuesOrganized="true"/>
+</fxpProperties>
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.project
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.project b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.project
new file mode 100644
index 0000000..d186bb7
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.project
@@ -0,0 +1,43 @@
+<?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.
+
+-->
+<projectDescription>
+ <name>SampleTabsEffects</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.adobe.flexbuilder.project.flexbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.adobe.flexbuilder.project.apollobuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.adobe.flexide.project.multiplatform.multiplatformnature</nature>
+ <nature>com.adobe.flexbuilder.project.apollonature</nature>
+ <nature>com.adobe.flexbuilder.project.flexnature</nature>
+ <nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+ </natures>
+</projectDescription>
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.settings/org.eclipse.core.resources.prefs
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.settings/org.eclipse.core.resources.prefs b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..7abe36f
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,18 @@
+# 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.
+
+#Tue Aug 16 11:22:19 EDT 2011
+eclipse.preferences.version=1
+encoding/<project>=utf-8
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/SampleTabsEffects.apk
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/SampleTabsEffects.apk b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/SampleTabsEffects.apk
new file mode 100644
index 0000000..65555f3
Binary files /dev/null and b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/SampleTabsEffects.apk differ
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/SampleTabsEffects.ipa
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/SampleTabsEffects.ipa b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/SampleTabsEffects.ipa
new file mode 100644
index 0000000..e32016b
Binary files /dev/null and b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/SampleTabsEffects.ipa differ
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/libs/.emptyDir
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/libs/.emptyDir b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/libs/.emptyDir
new file mode 100644
index 0000000..b0b2b1c
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/libs/.emptyDir
@@ -0,0 +1 @@
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/mimetype
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/mimetype b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/mimetype
new file mode 100644
index 0000000..a86de00
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/mimetype
@@ -0,0 +1 @@
+application/vnd.adobe.fxp
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/SampleTabsEffects-app.xml
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/SampleTabsEffects-app.xml b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/SampleTabsEffects-app.xml
new file mode 100644
index 0000000..ac732ab
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/SampleTabsEffects-app.xml
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!--
+
+ 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.
+
+-->
+<application xmlns="http://ns.adobe.com/air/application/2.6">
+
+<!-- Adobe AIR Application Descriptor File Template.
+
+ Specifies parameters for identifying, installing, and launching AIR applications.
+
+ xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/3.0
+ The last segment of the namespace specifies the version
+ of the AIR runtime required for this application to run.
+
+ minimumPatchLevel - The minimum patch level of the AIR runtime required to run
+ the application. Optional.
+-->
+
+ <!-- A universally unique application identifier. Must be unique across all AIR applications.
+ Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
+ <id>SampleTabsEffects</id>
+
+ <!-- Used as the filename for the application. Required. -->
+ <filename>SampleTabsEffects</filename>
+
+ <!-- The name that is displayed in the AIR application installer.
+ May have multiple values for each language. See samples or xsd schema file. Optional. -->
+ <name>SampleTabsEffects</name>
+
+ <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
+ Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
+ An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
+ <versionNumber>0.0.0</versionNumber>
+
+ <!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
+ <!-- <versionLabel></versionLabel> -->
+
+ <!-- Description, displayed in the AIR application installer.
+ May have multiple values for each language. See samples or xsd schema file. Optional. -->
+ <!-- <description></description> -->
+
+ <!-- Copyright information. Optional -->
+ <!-- <copyright></copyright> -->
+
+ <!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
+ <!-- <publisherID></publisherID> -->
+
+ <!-- Settings for the application's initial window. Required. -->
+ <initialWindow>
+ <!-- The main SWF or HTML file of the application. Required. -->
+ <!-- Note: In Flash Builder, the SWF reference is set automatically. -->
+ <content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
+
+ <!-- The title of the main window. Optional. -->
+ <!-- <title></title> -->
+
+ <!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
+ <!-- <systemChrome></systemChrome> -->
+
+ <!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
+ <!-- <transparent></transparent> -->
+
+ <!-- Whether the window is initially visible. Optional. Default false. -->
+ <!-- <visible></visible> -->
+
+ <!-- Whether the user can minimize the window. Optional. Default true. -->
+ <!-- <minimizable></minimizable> -->
+
+ <!-- Whether the user can maximize the window. Optional. Default true. -->
+ <!-- <maximizable></maximizable> -->
+
+ <!-- Whether the user can resize the window. Optional. Default true. -->
+ <!-- <resizable></resizable> -->
+
+ <!-- The window's initial width in pixels. Optional. -->
+ <!-- <width></width> -->
+
+ <!-- The window's initial height in pixels. Optional. -->
+ <!-- <height></height> -->
+
+ <!-- The window's initial x position. Optional. -->
+ <!-- <x></x> -->
+
+ <!-- The window's initial y position. Optional. -->
+ <!-- <y></y> -->
+
+ <!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->
+ <!-- <minSize></minSize> -->
+
+ <!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->
+ <!-- <maxSize></maxSize> -->
+
+ <!-- The initial aspect ratio of the app when launched (either "portrait" or "landscape"). Optional. Mobile only. Default is the natural orientation of the device -->
+
+ <!-- <aspectRatio></aspectRatio> -->
+
+ <!-- Whether the app will begin auto-orienting on launch. Optional. Mobile only. Default false -->
+
+ <!-- <autoOrients></autoOrients> -->
+
+ <!-- Whether the app launches in full screen. Optional. Mobile only. Default false -->
+
+ <!-- <fullScreen></fullScreen> -->
+
+ <!-- The render mode for the app (either auto, cpu, or gpu). Optional. Mobile only. Default auto -->
+
+ <!-- <renderMode></renderMode> -->
+
+ <!-- Whether or not to pan when a soft keyboard is raised or lowered (either "pan" or "none"). Optional. Defaults "pan." -->
+ <!-- <softKeyboardBehavior></softKeyboardBehavior> -->
+ <autoOrients>true</autoOrients>
+ <fullScreen>false</fullScreen>
+ <visible>true</visible>
+ <softKeyboardBehavior>none</softKeyboardBehavior>
+ </initialWindow>
+
+ <!-- We recommend omitting the supportedProfiles element, -->
+ <!-- which in turn permits your application to be deployed to all -->
+ <!-- devices supported by AIR. If you wish to restrict deployment -->
+ <!-- (i.e., to only mobile devices) then add this element and list -->
+ <!-- only the profiles which your application does support. -->
+ <!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> -->
+
+ <!-- The subpath of the standard default installation location to use. Optional. -->
+ <!-- <installFolder></installFolder> -->
+
+ <!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
+ <!-- <programMenuFolder></programMenuFolder> -->
+
+ <!-- The icon the system uses for the application. For at least one resolution,
+ specify the path to a PNG file included in the AIR package. Optional. -->
+ <!-- <icon>
+ <image16x16></image16x16>
+ <image32x32></image32x32>
+ <image36x36></image36x36>
+ <image48x48></image48x48>
+ <image57x57></image57x57>
+ <image72x72></image72x72>
+ <image114x114></image114x114>
+ <image128x128></image128x128>
+ </icon> -->
+
+ <!-- Whether the application handles the update when a user double-clicks an update version
+ of the AIR file (true), or the default AIR application installer handles the update (false).
+ Optional. Default false. -->
+ <!-- <customUpdateUI></customUpdateUI> -->
+
+ <!-- Whether the application can be launched when the user clicks a link in a web browser.
+ Optional. Default false. -->
+ <!-- <allowBrowserInvocation></allowBrowserInvocation> -->
+
+ <!-- Listing of file types for which the application can register. Optional. -->
+ <!-- <fileTypes> -->
+
+ <!-- Defines one file type. Optional. -->
+ <!-- <fileType> -->
+
+ <!-- The name that the system displays for the registered file type. Required. -->
+ <!-- <name></name> -->
+
+ <!-- The extension to register. Required. -->
+ <!-- <extension></extension> -->
+
+ <!-- The description of the file type. Optional. -->
+ <!-- <description></description> -->
+
+ <!-- The MIME content type. -->
+ <!-- <contentType></contentType> -->
+
+ <!-- The icon to display for the file type. Optional. -->
+ <!-- <icon>
+ <image16x16></image16x16>
+ <image32x32></image32x32>
+ <image48x48></image48x48>
+ <image128x128></image128x128>
+ </icon> -->
+
+ <!-- </fileType> -->
+ <!-- </fileTypes> -->
+
+ <!-- iOS specific capabilities -->
+ <!-- <iPhone> -->
+ <!-- A list of plist key/value pairs to be added to the application Info.plist -->
+ <!-- <InfoAdditions>
+ <![CDATA[
+ <key>UIDeviceFamily</key>
+ <array>
+ <string>1</string>
+ <string>2</string>
+ </array>
+ <key>UIStatusBarStyle</key>
+ <string>UIStatusBarStyleBlackOpaque</string>
+ <key>UIRequiresPersistentWiFi</key>
+ <string>YES</string>
+ ]]>
+ </InfoAdditions> -->
+ <!-- Display Resolution for the app (either "standard" or "high"). Optional. Default "standard" -->
+ <!-- <requestedDisplayResolution></requestedDisplayResolution> -->
+ <!-- </iPhone> -->
+
+ <!-- Specify Android specific tags that get passed to AndroidManifest.xml file. -->
+ <!--<android>
+ <manifestAdditions>
+ <![CDATA[
+ <manifest android:installLocation="auto">
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+ <uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
+ <application android:enabled="true">
+ <activity android:excludeFromRecents="false">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+ </manifest>
+ ]]>
+ </manifestAdditions>
+ </android> -->
+ <!-- End of the schema for adding the android specific tags in AndroidManifest.xml file -->
+
+<android>
+ <manifestAdditions><![CDATA[
+ <manifest android:installLocation="auto">
+ <!--See the Adobe AIR documentation for more information about setting Google Android permissions-->
+ <!--Removing the permission android.permission.INTERNET will have the side effect
+ of preventing you from debugging your application on your device-->
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>-->
+ <!--<uses-permission android:name="android.permission.READ_PHONE_STATE"/>-->
+ <!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>-->
+ <!--The DISABLE_KEYGUARD and WAKE_LOCK permissions should be toggled together
+ in order to access AIR's SystemIdleMode APIs-->
+ <!--<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>-->
+ <!--<uses-permission android:name="android.permission.WAKE_LOCK"/>-->
+ <!--<uses-permission android:name="android.permission.CAMERA"/>-->
+ <!--<uses-permission android:name="android.permission.RECORD_AUDIO"/>-->
+ <!--The ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE permissions should be toggled
+ together in order to use AIR's NetworkInfo APIs-->
+ <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
+ <!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>-->
+ </manifest>
+
+ ]]></manifestAdditions>
+ </android>
+ <iPhone>
+ <InfoAdditions><![CDATA[
+ <key>UIDeviceFamily</key>
+ <array>
+ <string>1</string>
+ <string>2</string>
+ </array>
+ ]]></InfoAdditions>
+ <requestedDisplayResolution>high</requestedDisplayResolution>
+ </iPhone>
+</application>
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/SampleTabsEffects.mxml
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/SampleTabsEffects.mxml b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/SampleTabsEffects.mxml
new file mode 100644
index 0000000..adbc39c
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/SampleTabsEffects.mxml
@@ -0,0 +1,67 @@
+<?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.
+
+-->
+<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark" applicationComplete="tabbedviewnavigatorapplication1_applicationCompleteHandler(event)">
+
+ <fx:Style source="styles.css"/>
+ <fx:Script>
+ <![CDATA[
+ import mx.events.FlexEvent;
+
+ import spark.events.IndexChangeEvent;
+
+ import views.SlideView;
+
+ protected function tabbedviewnavigatorapplication1_applicationCompleteHandler(event:FlexEvent):void
+ {
+ this.tabbedNavigator.addEventListener(IndexChangeEvent.CHANGE,onChange);
+ }
+
+ protected function onChange(event:IndexChangeEvent):void
+ {
+ if (event.newIndex == 0)
+ seqEffect.play([v1.activeView]);
+ else if (event.newIndex == 1)
+ moveEffect.play([v2.activeView]);
+ else if (event.newIndex == 2)
+ fadeEffect.play([v3.activeView]);
+ }
+ ]]>
+ </fx:Script>
+
+ <fx:Declarations>
+ <s:Sequence id="seqEffect">
+ <s:Parallel>
+ <s:Scale duration="800" id="scaleUp" scaleXBy=".8"/>
+ <s:Rotate3D angleYFrom="0.0" angleYTo="360"
+ duration="1600"
+ repeatCount="{2}" repeatBehavior="reverse"/>
+ </s:Parallel>
+ <s:Scale duration="300" id="scaleDown" scaleXBy="-.8"/>
+ </s:Sequence>
+ <s:Move3D id="moveEffect" duration="300" xFrom="400" xTo="0"/>
+ <s:Fade duration="800" id="fadeEffect" alphaFrom="0" alphaTo="1.0"/>
+ </fx:Declarations>
+
+ <s:ViewNavigator id="v1" label="Welcome" width="100%" height="100%" firstView="views.WelcomeView" activate="seqEffect.play([v1.activeView])"/>
+ <s:ViewNavigator id="v2" label="Slide" width="100%" height="100%" firstView="views.SlideView" />
+ <s:ViewNavigator id="v3" label="Fade In" width="100%" height="100%" firstView="views.FadeInView" />
+
+</s:TabbedViewNavigatorApplication>
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/blackberry-tablet.xml
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/blackberry-tablet.xml b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/blackberry-tablet.xml
new file mode 100644
index 0000000..7dd226b
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/blackberry-tablet.xml
@@ -0,0 +1,22 @@
+<?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.
+
+-->
+
+
+<qnx/>
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/ActionBarSkin.as
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/ActionBarSkin.as b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/ActionBarSkin.as
new file mode 100644
index 0000000..2f1a6cb
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/ActionBarSkin.as
@@ -0,0 +1,713 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 skins
+{
+import flash.display.GradientType;
+import flash.events.Event;
+import flash.text.TextFormatAlign;
+
+import mx.core.DPIClassification;
+import mx.core.mx_internal;
+import mx.utils.ColorUtil;
+
+import spark.components.ActionBar;
+import spark.components.Group;
+import spark.components.supportClasses.StyleableTextField;
+import spark.core.SpriteVisualElement;
+import spark.layouts.HorizontalAlign;
+import spark.layouts.HorizontalLayout;
+import spark.layouts.VerticalAlign;
+import spark.skins.mobile.supportClasses.MobileSkin;
+import spark.skins.mobile160.assets.ActionBarBackground;
+import spark.skins.mobile240.assets.ActionBarBackground;
+import spark.skins.mobile320.assets.ActionBarBackground;
+
+use namespace mx_internal;
+
+/**
+ * The default skin class for the Spark ActionBar component in mobile
+ * applications.
+ *
+ * @see spark.components.ActionBar
+ * @see spark.skins.mobile.NavigationButtonSkin
+ * @see spark.skins.mobile.NavigationBackButtonSkin
+ * @see spark.skins.mobile.ActionButtonSkin
+ * @see spark.skins.mobile.ActionRoundedButtonSkin
+ *
+ * @langversion 3.0
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+public class ActionBarSkin extends MobileSkin
+{
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal static const ACTIONBAR_CHROME_COLOR_RATIOS:Array = [0, 80];
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public function ActionBarSkin()
+ {
+ super();
+
+ switch (applicationDPI)
+ {
+ case DPIClassification.DPI_320:
+ {
+ borderSize = 2;
+ layoutShadowHeight = 6;
+ layoutContentGroupHeight = 86;
+ layoutTitleGroupHorizontalPadding = 26;
+
+ borderClass = spark.skins.mobile320.assets.ActionBarBackground;
+
+ break;
+ }
+ case DPIClassification.DPI_240:
+ {
+ borderSize = 1;
+ layoutShadowHeight = 3;
+ layoutContentGroupHeight = 65;
+ layoutTitleGroupHorizontalPadding = 20;
+
+ borderClass = spark.skins.mobile240.assets.ActionBarBackground;
+
+ break;
+ }
+ default:
+ {
+ // default DPI_160
+ borderSize = 1;
+ layoutShadowHeight = 3;
+ layoutContentGroupHeight = 43;
+ layoutTitleGroupHorizontalPadding = 13;
+
+ borderClass = spark.skins.mobile160.assets.ActionBarBackground;
+
+ break;
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Graphics variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * FXG Class reference for the ActionBar background border graphic.
+ *
+ * @langversion 3.0
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ protected var borderClass:Class;
+
+ //--------------------------------------------------------------------------
+ //
+ // Layout variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var borderSize:uint;
+
+ /**
+ * Height of shadow embedded in borderClass graphic.
+ *
+ * @langversion 3.0
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ protected var layoutShadowHeight:uint;
+
+ /**
+ * Default height for navigationGroup, titleGroup and actionGroup.
+ *
+ * @langversion 3.0
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ protected var layoutContentGroupHeight:uint;
+
+ /**
+ * Default horizontal padding for the titleGroup and titleDisplay.
+ *
+ * @langversion 3.0
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ protected var layoutTitleGroupHorizontalPadding:uint;
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @copy spark.skins.spark.ApplicationSkin#hostComponent
+ */
+ public var hostComponent:ActionBar;
+
+ /**
+ * @private
+ */
+ private var _navigationVisible:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var _titleContentVisible:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var _actionVisible:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var border:SpriteVisualElement;
+
+ //--------------------------------------------------------------------------
+ //
+ // Skin parts
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @copy spark.components.ActionBar#navigationGroup
+ */
+ public var navigationGroup:Group;
+
+ /**
+ * @copy spark.components.ActionBar#titleGroup
+ */
+ public var titleGroup:Group;
+
+ /**
+ * @copy spark.components.ActionBar#actionGroup
+ */
+ public var actionGroup:Group;
+
+ /**
+ * @copy spark.components.ActionBar#titleDisplay
+ *
+ * @private
+ * Wraps a StyleableTextField in a UIComponent to be compatible with
+ * ViewTransition effects.
+ */
+ public var titleDisplay:TitleDisplayComponent;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override protected function createChildren():void
+ {
+ border = new borderClass();
+ addChild(border);
+
+ navigationGroup = new Group();
+ var hLayout:HorizontalLayout = new HorizontalLayout();
+ hLayout.horizontalAlign = HorizontalAlign.LEFT;
+ hLayout.verticalAlign = VerticalAlign.MIDDLE;
+ hLayout.gap = 0;
+ hLayout.paddingLeft = hLayout.paddingTop = hLayout.paddingRight =
+ hLayout.paddingBottom = 0;
+ navigationGroup.layout = hLayout;
+ navigationGroup.id = "navigationGroup";
+
+ titleGroup = new Group();
+ hLayout = new HorizontalLayout();
+ hLayout.horizontalAlign = HorizontalAlign.LEFT;
+ hLayout.verticalAlign = VerticalAlign.MIDDLE;
+ hLayout.gap = 0;
+ hLayout.paddingLeft = hLayout.paddingRight = layoutTitleGroupHorizontalPadding;
+ hLayout.paddingTop = hLayout.paddingBottom = 0;
+ titleGroup.layout = hLayout;
+ titleGroup.id = "titleGroup";
+
+ actionGroup = new Group();
+ hLayout = new HorizontalLayout();
+ hLayout.horizontalAlign = HorizontalAlign.RIGHT;
+ hLayout.verticalAlign = VerticalAlign.MIDDLE;
+ hLayout.gap = 0;
+ hLayout.paddingLeft = hLayout.paddingTop = hLayout.paddingRight =
+ hLayout.paddingBottom = 0;
+ actionGroup.layout = hLayout;
+ actionGroup.id = "actionGroup";
+
+ titleDisplay = new TitleDisplayComponent();
+ titleDisplay.id = "titleDisplay";
+
+ // initialize titleAlign style (center is managed explicitly in layoutContents)
+ var titleAlign:String = getStyle("titleAlign");
+ titleAlign = (titleAlign == "center") ? TextFormatAlign.LEFT : titleAlign;
+ titleDisplay.setStyle("textAlign", titleAlign);
+
+ addChild(navigationGroup);
+ addChild(titleGroup);
+ addChild(actionGroup);
+ addChild(titleDisplay);
+ }
+
+ /**
+ * @private
+ */
+ override protected function measure():void
+ {
+ var titleWidth:Number = 0;
+ var titleHeight:Number = 0;
+
+ if (_titleContentVisible)
+ {
+ titleWidth = titleGroup.getPreferredBoundsWidth();
+ titleHeight = titleGroup.getPreferredBoundsHeight();
+ }
+ else
+ {
+ // use titleLayout for paddingLeft and paddingRight
+ var layoutObject:Object = hostComponent.titleLayout;
+ titleWidth = ((layoutObject.paddingLeft) ? Number(layoutObject.paddingLeft) : 0)
+ + ((layoutObject.paddingRight) ? Number(layoutObject.paddingRight) : 0)
+ + titleDisplay.getPreferredBoundsWidth();
+
+ titleHeight = titleDisplay.getPreferredBoundsHeight();
+ }
+
+ measuredWidth =
+ getStyle("paddingLeft")
+ + navigationGroup.getPreferredBoundsWidth()
+ + titleWidth
+ + actionGroup.getPreferredBoundsWidth()
+ + getStyle("paddingRight");
+
+ // measuredHeight is contentGroupHeight, 2x border on top and bottom
+ measuredHeight =
+ getStyle("paddingTop")
+ + Math.max(layoutContentGroupHeight,
+ navigationGroup.getPreferredBoundsHeight(),
+ actionGroup.getPreferredBoundsHeight(),
+ titleHeight)
+ + getStyle("paddingBottom");
+ }
+
+ /**
+ * @private
+ */
+ override protected function commitCurrentState():void
+ {
+ super.commitCurrentState();
+
+ _titleContentVisible = currentState.indexOf("titleContent") >= 0;
+ _navigationVisible = currentState.indexOf("Navigation") >= 0;
+ _actionVisible = currentState.indexOf("Action") >= 0;
+
+ invalidateSize();
+ invalidateDisplayList();
+ }
+
+ /**
+ * @private
+ */
+ override public function styleChanged(styleProp:String):void
+ {
+ if (titleDisplay)
+ {
+ var allStyles:Boolean = !styleProp || styleProp == "styleName";
+
+ if (allStyles || (styleProp == "titleAlign"))
+ {
+ var titleAlign:String = getStyle("titleAlign");
+
+ if (titleAlign == "center")
+ {
+ // If the title align is set to center, the alignment is set to LEFT
+ // so that the skin can manually center the component in layoutContents
+ titleDisplay.setStyle("textAlign", TextFormatAlign.LEFT);
+ }
+ else
+ {
+ titleDisplay.setStyle("textAlign", titleAlign);
+ }
+ }
+ }
+
+ super.styleChanged(styleProp);
+ }
+
+ /**
+ * @private
+ */
+ override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.layoutContents(unscaledWidth, unscaledHeight);
+
+ var navigationGroupWidth:Number = 0;
+
+ var paddingLeft:Number = getStyle("paddingLeft");
+ var paddingRight:Number = getStyle("paddingRight");
+ var paddingTop:Number = getStyle("paddingTop");
+ var paddingBottom:Number = getStyle("paddingBottom");
+
+ var titleCompX:Number = paddingLeft;
+ var titleCompWidth:Number = 0;
+
+ var actionGroupX:Number = unscaledWidth;
+ var actionGroupWidth:Number = 0;
+
+ // remove top and bottom padding from content group height
+ var contentGroupsHeight:Number = Math.max(0, unscaledHeight - paddingTop - paddingBottom);
+
+ // FXG uses scale-9, drop shadow is drawn outside the bounds
+ setElementSize(border, unscaledWidth, unscaledHeight + layoutShadowHeight);
+
+ // position groups, overlap of navigation and action groups is allowed
+ // when overlap occurs, titleDisplay/titleGroup is not visible
+ if (_navigationVisible)
+ {
+ navigationGroupWidth = navigationGroup.getPreferredBoundsWidth();
+ titleCompX += navigationGroupWidth;
+
+ setElementSize(navigationGroup, navigationGroupWidth, contentGroupsHeight);
+ setElementPosition(navigationGroup, paddingLeft, paddingTop);
+ }
+
+ if (_actionVisible)
+ {
+ // actionGroup x position can be negative
+ actionGroupWidth = actionGroup.getPreferredBoundsWidth();
+ actionGroupX = unscaledWidth - actionGroupWidth - paddingRight;
+
+ setElementSize(actionGroup, actionGroupWidth, contentGroupsHeight);
+ setElementPosition(actionGroup, actionGroupX, paddingTop);
+ }
+
+ // titleGroup or titleDisplay is given remaining width after navigation
+ // and action groups preferred widths
+ titleCompWidth = unscaledWidth - navigationGroupWidth - actionGroupWidth
+ - paddingLeft - paddingRight;
+
+ if (titleCompWidth <= 0)
+ {
+ titleDisplay.visible = false;
+ titleGroup.visible = false;
+ }
+ else if (_titleContentVisible)
+ {
+ titleDisplay.visible = false;
+ titleGroup.visible = true;
+
+ // use titleGroup for titleContent
+ setElementSize(titleGroup, titleCompWidth, contentGroupsHeight);
+ setElementPosition(titleGroup, titleCompX, paddingTop);
+ }
+ else
+ {
+ // use titleDisplay for title text label
+ titleGroup.visible = false;
+
+ // use titleLayout for paddingLeft and paddingRight
+ var layoutObject:Object = hostComponent.titleLayout;
+ var titlePaddingLeft:Number = (layoutObject.paddingLeft) ? Number(layoutObject.paddingLeft) : 0;
+ var titlePaddingRight:Number = (layoutObject.paddingRight) ? Number(layoutObject.paddingRight) : 0;
+
+ // align titleDisplay to the absolute center
+ var titleAlign:String = getStyle("titleAlign");
+
+ // check for available width after padding
+ if ((titleCompWidth - titlePaddingLeft - titlePaddingRight) <= 0)
+ {
+ titleCompX = 0;
+ titleCompWidth = 0;
+ }
+ else if (titleAlign == "center")
+ {
+ // use LEFT instead of CENTER
+ titleCompWidth = titleDisplay.getExplicitOrMeasuredWidth();
+
+ // use x position of titleDisplay to implement CENTER
+ titleCompX = Math.round((unscaledWidth - titleCompWidth) / 2);
+
+ var navigationOverlap:Number = navigationGroupWidth + titlePaddingLeft - titleCompX;
+ var actionOverlap:Number = (titleCompX + titleCompWidth + titlePaddingRight) - actionGroupX;
+
+ // shrink and/or move titleDisplay width if there is any
+ // overlap after centering
+ if ((navigationOverlap > 0) && (actionOverlap > 0))
+ {
+ // remaining width
+ titleCompX = navigationGroupWidth + titlePaddingLeft;
+ titleCompWidth = unscaledWidth - navigationGroupWidth - actionGroupWidth - titlePaddingLeft - titlePaddingRight;
+ }
+ else if ((navigationOverlap > 0) || (actionOverlap > 0))
+ {
+ if (navigationOverlap > 0)
+ {
+ // nudge to the right
+ titleCompX += navigationOverlap;
+ }
+ else if (actionOverlap > 0)
+ {
+ // nudge to the left
+ titleCompX -= actionOverlap;
+
+ // force left padding
+ if (titleCompX < (navigationGroupWidth + titlePaddingLeft))
+ titleCompX = navigationGroupWidth + titlePaddingLeft;
+ }
+
+ // recompute action overlap and force right padding
+ actionOverlap = (titleCompX + titleCompWidth + titlePaddingRight) - actionGroupX;
+
+ if (actionOverlap > 0)
+ titleCompWidth -= actionOverlap;
+ }
+ }
+ else
+ {
+ // implement padding by adjusting width and position
+ titleCompX += titlePaddingLeft;
+ titleCompWidth = titleCompWidth - titlePaddingLeft - titlePaddingRight;
+ }
+
+ // check for negative width
+ titleCompWidth = (titleCompWidth < 0) ? 0 : titleCompWidth;
+
+ setElementSize(titleDisplay, titleCompWidth, contentGroupsHeight);
+ setElementPosition(titleDisplay, titleCompX, paddingTop);
+
+ titleDisplay.visible = true;
+ }
+ }
+
+ /**
+ * @private
+ */
+ override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.drawBackground(unscaledWidth, unscaledHeight);
+
+ var chromeColor:uint = getStyle("chromeColor");
+ var backgroundAlphaValue:Number = getStyle("backgroundAlpha");
+ var colors:Array = [];
+
+ // apply alpha to chromeColor fill only
+ var backgroundAlphas:Array = [backgroundAlphaValue, backgroundAlphaValue];
+
+ // exclude top and bottom 1px borders
+ colorMatrix.createGradientBox(unscaledWidth, unscaledHeight - (borderSize * 2), Math.PI / 2, 0, 0);
+
+ colors[0] = ColorUtil.adjustBrightness2(chromeColor, 20);
+ colors[1] = chromeColor;
+
+ graphics.beginGradientFill(GradientType.LINEAR, colors, backgroundAlphas, ACTIONBAR_CHROME_COLOR_RATIOS, colorMatrix);
+ graphics.drawRect(0, borderSize, unscaledWidth, unscaledHeight - (borderSize * 2));
+ graphics.endFill();
+ }
+
+}
+}
+import flash.events.Event;
+
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+import mx.events.FlexEvent;
+
+import spark.components.supportClasses.StyleableTextField;
+import spark.core.IDisplayText;
+
+use namespace mx_internal;
+
+/**
+ * @private
+ * Component that holds StyleableTextFields to produce a drop shadow effect.
+ * Combines label and shadow into a single component to allow transitions to
+ * target them both.
+ */
+class TitleDisplayComponent extends UIComponent implements IDisplayText
+{
+ private var titleDisplay:StyleableTextField;
+ private var titleDisplayShadow:StyleableTextField;
+ private var title:String;
+ private var titleChanged:Boolean;
+
+ public function TitleDisplayComponent()
+ {
+ super();
+ title = "";
+ }
+
+ override public function get baselinePosition():Number
+ {
+ return titleDisplay.baselinePosition;
+ }
+
+ /**
+ * @private
+ */
+ override protected function createChildren():void
+ {
+ super.createChildren();
+
+ titleDisplay = StyleableTextField(createInFontContext(StyleableTextField));
+ titleDisplay.styleName = this;
+ titleDisplay.editable = false;
+ titleDisplay.selectable = false;
+ titleDisplay.multiline = false;
+ titleDisplay.wordWrap = false;
+ titleDisplay.addEventListener(FlexEvent.VALUE_COMMIT,
+ titleDisplay_valueCommitHandler);
+
+ titleDisplayShadow =
+ StyleableTextField(createInFontContext(StyleableTextField));
+ titleDisplayShadow.styleName = this;
+ titleDisplayShadow.colorName = "textShadowColor";
+ titleDisplayShadow.editable = false;
+ titleDisplayShadow.selectable = false;
+ titleDisplayShadow.multiline = false;
+ titleDisplayShadow.wordWrap = false;
+
+ addChild(titleDisplayShadow);
+ addChild(titleDisplay);
+ }
+
+ /**
+ * @private
+ */
+ override protected function commitProperties():void
+ {
+ super.commitProperties();
+
+ if (titleChanged)
+ {
+ titleDisplay.text = title;
+
+ invalidateSize();
+ invalidateDisplayList();
+
+ titleChanged = false;
+ }
+ }
+
+ /**
+ * @private
+ */
+ override protected function measure():void
+ {
+ // reset text if it was truncated before.
+ if (titleDisplay.isTruncated)
+ titleDisplay.text = title;
+
+ measuredWidth = titleDisplay.getPreferredBoundsWidth();
+
+ // tightTextHeight
+ measuredHeight = titleDisplay.getPreferredBoundsHeight();
+ }
+
+ /**
+ * @private
+ */
+ override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ // reset text if it was truncated before.
+ if (titleDisplay.isTruncated)
+ titleDisplay.text = title;
+ titleDisplay.commitStyles();
+
+ // use preferred height, setLayoutBoundsSize will accommodate for tight
+ // text adjustment
+ var tightHeight:Number = titleDisplay.getPreferredBoundsHeight();
+ var tightY:Number = (unscaledHeight - tightHeight) / 2;
+
+ titleDisplay.setLayoutBoundsSize(unscaledWidth, tightHeight);
+ titleDisplay.setLayoutBoundsPosition(0, (unscaledHeight - tightHeight) / 2);
+
+ // now truncate the text
+ titleDisplay.truncateToFit();
+
+ titleDisplayShadow.commitStyles();
+ titleDisplayShadow.setLayoutBoundsSize(unscaledWidth, tightHeight);
+ titleDisplayShadow.setLayoutBoundsPosition(0, tightY + 1);
+
+ titleDisplayShadow.alpha = getStyle("textShadowAlpha");
+
+ // if labelDisplay is truncated, then push it down here as well.
+ // otherwise, it would have gotten pushed in the labelDisplay_valueCommitHandler()
+ if (titleDisplay.isTruncated)
+ titleDisplayShadow.text = titleDisplay.text;
+ }
+
+ /**
+ * @private
+ */
+ private function titleDisplay_valueCommitHandler(event:Event):void
+ {
+ titleDisplayShadow.text = titleDisplay.text;
+ }
+
+ public function get text():String
+ {
+ return title;
+ }
+
+ public function set text(value:String):void
+ {
+ title = value;
+ titleChanged = true;
+
+ invalidateProperties();
+ }
+
+ public function get isTruncated():Boolean
+ {
+ return titleDisplay.isTruncated;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/ButtonBarSkin.as
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/ButtonBarSkin.as b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/ButtonBarSkin.as
new file mode 100644
index 0000000..b79d6fe
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/ButtonBarSkin.as
@@ -0,0 +1,189 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 skins
+{
+import spark.components.ButtonBar;
+import spark.components.ButtonBarButton;
+import spark.components.DataGroup;
+import spark.components.Scroller;
+import spark.components.supportClasses.ButtonBarHorizontalLayout;
+import spark.skins.mobile.supportClasses.ButtonBarButtonClassFactory;
+import spark.skins.mobile.supportClasses.MobileSkin;
+
+/**
+ * The default skin class for the Spark ButtonBar component.
+ *
+ * @see spark.components.ButtonBar
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+public class ButtonBarSkin extends MobileSkin
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ *
+ */
+ public function ButtonBarSkin()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Skin parts
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @copy spark.skins.spark.ApplicationSkin#hostComponent
+ */
+ public var hostComponent:ButtonBar;
+
+ /**
+ * @copy spark.components.ButtonBar#firstButton
+ */
+ public var firstButton:ButtonBarButtonClassFactory;
+
+ /**
+ * @copy spark.components.ButtonBar#lastButton
+ */
+ public var lastButton:ButtonBarButtonClassFactory;
+
+ /**
+ * @copy spark.components.ButtonBar#middleButton
+ */
+ public var middleButton:ButtonBarButtonClassFactory;
+
+ /**
+ * @copy spark.components.SkinnableDataContainer#dataGroup
+ */
+ public var dataGroup:DataGroup;
+
+ public var scroll:Scroller;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override protected function createChildren():void
+ {
+ trace("Button bar create");
+ // Set up the class factories for the buttons
+ if (!firstButton)
+ {
+ firstButton = new ButtonBarButtonClassFactory(ButtonBarButton);
+ //firstButton.skinClass = spark.skins.mobile.ButtonBarFirstButtonSkin;
+ firstButton.skinClass = skins.TabbedViewNavigatorTabBarFirstTabSkin;
+ }
+
+ if (!lastButton)
+ {
+ lastButton = new ButtonBarButtonClassFactory(ButtonBarButton);
+ lastButton.skinClass = skins.TabbedViewNavigatorTabBarFirstTabSkin;
+ }
+
+ if (!middleButton)
+ {
+ middleButton = new ButtonBarButtonClassFactory(ButtonBarButton);
+ middleButton.skinClass = skins.TabbedViewNavigatorTabBarFirstTabSkin;
+ }
+
+ // create the data group to house the buttons
+ if (!dataGroup)
+ {
+ dataGroup = new DataGroup();
+ var hLayout:ButtonBarHorizontalLayout = new ButtonBarHorizontalLayout();
+ hLayout.gap = 0;
+ dataGroup.layout = hLayout;
+ /*scroll = new Scroller();
+ scroll
+ scroll.height=2000;*/
+ //var g:Group = new Group();
+ //s.addChild(g);
+ //g.addElement(tabBar);
+ /*scroll.addChild(dataGroup);
+ trace("BUTTON SKIN This is button skin " + scroll);
+ this.addChild(scroll);*/
+ //this.addChild(tabBar);
+ addChild(dataGroup);
+ }
+ }
+
+ /**
+ * @private
+ */
+ override protected function commitCurrentState():void
+ {
+ alpha = (currentState == "disabled") ? 0.5 : 1;
+ }
+
+ /**
+ * @private
+ */
+ override protected function measure():void
+ {
+ trace("This is measure");
+ measuredWidth = dataGroup.measuredWidth;
+ measuredHeight = dataGroup.measuredHeight;
+
+ measuredMinWidth = dataGroup.measuredMinWidth;
+ measuredMinHeight = dataGroup.measuredMinHeight;
+ }
+
+ /**
+ * @private
+ */
+ override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ // Changing layout here will move the buttons but not the rect behind them. The TabbedViewNavigatorTabBarSkin
+ // is used for the rect drawing
+ super.layoutContents(unscaledWidth, unscaledHeight);
+ trace("Height " + this.unscaledHeight + " " + parent.height + " " + dataGroup.numElements + " dp len " + dataGroup.dataProvider.length);
+ //if (dataGroup.dataProvider.length==3)
+ //dataGroup.dataProvider.removeItemAt(0);
+ trace("Layout contents in button skin " + dataGroup.itemRenderer + " SCROLL " + scroll);
+ /*for (var i:int =0; i<dataGroup.numElements; i++)
+ {
+ dataGroup.getElementAt(i).width=300;
+ }*/
+ setElementPosition(scroll, 0, 0);
+ setElementSize(scroll, unscaledWidth, unscaledHeight);
+ }
+}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/MyPopupComponentSkin.mxml
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/MyPopupComponentSkin.mxml b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/MyPopupComponentSkin.mxml
new file mode 100644
index 0000000..690693a
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/MyPopupComponentSkin.mxml
@@ -0,0 +1,109 @@
+<?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.
+
+-->
+
+
+<!--- The default skin class for a Spark ViewMenu in a mobile application.
+
+@see spark.components.ViewMenu
+
+@langversion 3.0
+@playerversion Flash 10
+@playerversion AIR 1.5
+@productversion Flex 4
+-->
+<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:fb="http://ns.adobe.com/flashbuilder/2009" alpha.disabled="0.5">
+
+ <fx:Metadata>
+ <![CDATA[
+ /**
+ * @copy spark.skins.spark.ApplicationSkin#hostComponent
+ */
+ [HostComponent("spark.components.ViewMenu")]
+ ]]>
+ </fx:Metadata>
+ <fx:Script>
+ <![CDATA[
+ import spark.effects.easing.Power;
+ ]]>
+ </fx:Script>
+ <s:states>
+ <s:State name="normal" stateGroups="openedGroup"/>
+ <s:State name="closed" stateGroups="closedGroup"/>
+ <s:State name="disabled" stateGroups="openedGroup"/>
+ <s:State name="normalAndLandscape" stateGroups="openedGroup, landscapeGroup"/>
+ <s:State name="closedAndLandscape" stateGroups="closedGroup, landscapeGroup"/>
+ <s:State name="disabledAndLandscape" stateGroups="openedGroup, landscapeGroup" />
+ </s:states>
+
+ <s:transitions>
+ <s:Transition fromState="closed" toState="normal" autoReverse="true">
+ <s:Parallel>
+ <s:Fade target="{chromeGroup}" duration="150" easer="{new Power(0.5, 3)}"/>
+ <s:Move target="{chromeGroup}" duration="150" disableLayout="true" />
+ </s:Parallel>
+ </s:Transition>
+
+ <s:Transition fromState="closedAndLandscape" toState="normalAndLandscape" autoReverse="true">
+ <s:Parallel>
+ <s:Fade target="{chromeGroup}" duration="150" easer="{new Power(0.5, 3)}" />
+ <s:Move target="{chromeGroup}" duration="150" disableLayout="true" />
+ </s:Parallel>
+ </s:Transition>
+
+ <s:Transition fromState="normal" toState="closed" autoReverse="true">
+ <s:Parallel>
+ <s:Fade target="{chromeGroup}" duration="100" easer="{new Power(0.5, 3)}"/>
+ <s:Move target="{chromeGroup}" duration="100" disableLayout="true"/>
+ </s:Parallel>
+ </s:Transition>
+
+ <s:Transition fromState="normalAndLandscape" toState="closedAndLandscape" autoReverse="true">
+ <s:Parallel>
+ <s:Fade target="{chromeGroup}" duration="100" easer="{new Power(0.5, 3)}"/>
+ <s:Move target="{chromeGroup}" duration="100" disableLayout="true"/>
+ </s:Parallel>
+ </s:Transition>
+ </s:transitions>
+
+ <s:Group id="chromeGroup" left="100" top="100">
+
+ <!-- Background and border - sets one corner rounded and adds a drop shadow filter-->
+ <s:Rect left="0" right="0" top="1" bottom="0" id="background" topRightRadiusX="15">
+ <s:filters>
+ <s:DropShadowFilter color="0x000000" blurX="20" />
+ </s:filters>
+ <s:fill>
+ <s:SolidColor color="0xF9F1D3"/>
+ </s:fill>
+ <s:stroke>
+ <s:SolidColorStroke weight="2" color="#323232" joints="bevel" alpha=".5"/>
+ </s:stroke>
+ </s:Rect>
+
+ <!--- @copy spark.components.SkinnableContainer#contentGroup -->
+ <s:Group id="contentGroup" left="0" right="0" top="3" bottom="2" minWidth="0" minHeight="0">
+ <s:layout>
+ <s:ViewMenuLayout horizontalGap="2" verticalGap="2" id="contentGroupLayout"
+ requestedMaxColumnCount="3" requestedMaxColumnCount.landscapeGroup="6"/>
+ </s:layout>
+ </s:Group>
+ </s:Group>
+</s:SparkSkin>
http://git-wip-us.apache.org/repos/asf/flex-external/blob/1bcc0e18/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/MyTextAreaSkin.as
----------------------------------------------------------------------
diff --git a/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/MyTextAreaSkin.as b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/MyTextAreaSkin.as
new file mode 100644
index 0000000..14e4c8a
--- /dev/null
+++ b/ADC/devnet/flex/TransitionsSamples/SampleTabEffects/src/skins/MyTextAreaSkin.as
@@ -0,0 +1,676 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 skins
+{
+
+ import flash.events.Event;
+ import flash.events.KeyboardEvent;
+ import flash.events.SoftKeyboardEvent;
+ import flash.geom.Point;
+ import flash.geom.Rectangle;
+ import flash.system.Capabilities;
+ import flash.ui.Keyboard;
+
+ import mx.core.DPIClassification;
+ import mx.core.mx_internal;
+ import mx.events.FlexEvent;
+
+ import spark.components.Group;
+ import spark.components.Scroller;
+ import spark.components.TextArea;
+ import spark.components.supportClasses.StyleableTextField;
+ import spark.events.CaretBoundsChangeEvent;
+ import spark.skins.mobile.supportClasses.TextSkinBase;
+ import spark.skins.mobile160.assets.TextInput_border;
+ import spark.skins.mobile240.assets.TextInput_border;
+ import spark.skins.mobile320.assets.TextInput_border;
+
+
+ use namespace mx_internal;
+
+ /**
+ * ActionScript-based skin for TextArea components in mobile applications.
+ *
+ * @see spark.components.TextArea
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public class MyTextAreaSkin extends TextSkinBase
+ {
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public function MyTextAreaSkin()
+ {
+ super();
+
+ addEventListener(Event.RESIZE, resizeHandler);
+
+ switch (applicationDPI)
+ {
+ case DPIClassification.DPI_320:
+ {
+ borderClass = spark.skins.mobile320.assets.TextInput_border;
+ layoutCornerEllipseSize = 24;
+ measuredDefaultWidth = 612;
+ measuredDefaultHeight = 106;
+ layoutBorderSize = 2;
+
+ break;
+ }
+ case DPIClassification.DPI_240:
+ {
+ borderClass = spark.skins.mobile240.assets.TextInput_border;
+ layoutCornerEllipseSize = 12;
+ measuredDefaultWidth = 440;
+ measuredDefaultHeight = 70;
+ layoutBorderSize = 1;
+
+ break;
+ }
+ default:
+ {
+ borderClass = spark.skins.mobile160.assets.TextInput_border;
+ layoutCornerEllipseSize = 12;
+ measuredDefaultWidth = 306;
+ measuredDefaultHeight = 53;
+ layoutBorderSize = 1;
+
+ break;
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Skin parts
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+
+ * Scroller skin part.
+
+ *
+
+ * @langversion 3.0
+
+ * @playerversion Flash 10
+
+ * @playerversion AIR 2.5
+
+ * @productversion Flex 4.5
+
+ */
+
+ public var scroller:Scroller;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+
+ * @copy spark.skins.spark.ApplicationSkin#hostComponent
+
+ */
+
+ public var hostComponent:TextArea;
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * The width of the component on the previous layout manager
+ * pass. This gets set in updateDisplayList() and used in measure() on
+ * the next layout pass. This is so our "guessed width" in measure()
+ * will be as accurate as possible since textDisplay is multiline and
+ * the textDisplay height is dependent on the width.
+ *
+ * In the constructor this is actually set based on the DPI.
+ */
+ mx_internal var oldUnscaledWidth:Number;
+
+ private var textDisplayGroup:Group;
+ private var _isIOS:Boolean;
+ private var invalidateCaretPosition:Boolean = true;
+ private var oldCaretBounds:Rectangle = new Rectangle(-1, -1, -1, -1);
+ private var lastTextHeight:Number;
+ private var lastTextWidth:Number;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override protected function createChildren():void
+ {
+ if (!textDisplay)
+ {
+ // wrap StyleableTextField in UIComponent
+ textDisplay = StyleableTextField(createInFontContext(StyleableTextField));
+ textDisplay.styleName = this;
+ textDisplay.multiline = true;
+ textDisplay.editable = true;
+ textDisplay.lineBreak = getStyle("lineBreak");
+ textDisplay.useTightTextBounds = false;
+ textDisplay.scrollToRangeDelegate = scrollToRange;
+ trace("Background " + textDisplay.background);
+ textDisplay.background=true;
+ textDisplay.backgroundColor = 0x0C8EBA;
+
+ //textDisplay.textColor=0xFFFFFF;
+
+ // on iOS, resize the TextField and let the native control handle scrolling
+ _isIOS = (Capabilities.version.indexOf("IOS") == 0);
+
+ if (!_isIOS)
+ textDisplay.addEventListener(KeyboardEvent.KEY_DOWN, textDisplay_keyHandler);
+
+ textDisplay.addEventListener(Event.CHANGE, textDisplay_changeHandler);
+ textDisplay.addEventListener(FlexEvent.VALUE_COMMIT, textDisplay_changeHandler);
+ textDisplay.addEventListener(Event.SCROLL, textDisplay_scrollHandler);
+ textDisplay.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE, textDisplay_softKeyboardActivateHandler);
+
+ textDisplay.left = getStyle("paddingLeft");
+ textDisplay.top = getStyle("paddingTop");
+ textDisplay.right = getStyle("paddingRight");
+ textDisplay.bottom = getStyle("paddingBottom");
+
+ // wrap StyleableTextComponent in Group for viewport
+ textDisplayGroup = new Group();
+ textDisplayGroup.clipAndEnableScrolling = true;
+ textDisplayGroup.addElement(textDisplay);
+ }
+
+ if (!scroller)
+ {
+ scroller = new Scroller();
+ scroller.minViewportInset = 0;
+ scroller.measuredSizeIncludesScrollBars = false;
+ scroller.ensureElementIsVisibleForSoftKeyboard = false;
+
+ addChild(scroller);
+ }
+
+ if (!scroller.viewport)
+ scroller.viewport = textDisplayGroup;
+
+ super.createChildren();
+ }
+
+ /**
+ * @private
+ * TextArea prompt supports wrapping and multiline
+ */
+ override protected function createPromptDisplay():StyleableTextField
+ {
+ var prompt:StyleableTextField = super.createPromptDisplay();
+ prompt.editable = true;
+ prompt.wordWrap = true;
+
+ return prompt;
+ }
+
+ /**
+ * @private
+ */
+ override protected function measure():void
+ {
+ super.measure();
+
+ var paddingTop:Number = getStyle("paddingTop");
+ var paddingBottom:Number = getStyle("paddingBottom");
+ var paddingLeft:Number = getStyle("paddingLeft");
+ var paddingRight:Number = getStyle("paddingRight");
+
+ // TextDisplay always defaults to 440 pixels wide (the value is DPI dependent),
+ // and tall enough to show all text.
+ //
+ // You can set an explicit width and the height will adjust accordingly. The opposite
+ // is not true: setting an explicit height will not adjust the width accordingly.
+
+ measuredWidth = measuredDefaultWidth;
+
+ // now we need to measure textDisplay's height. Unfortunately, this is tricky and
+ // is dependent on textDisplay's width. Let's use the heuristic that our width
+ // is the same as our last width.
+ // We don't use layoutMeasuredWidth, because that value is just a constant and doesn't
+ // take into account the fact that the TextArea could have an explicitWidth or could
+ // be constrained by some value. However, we still default oldTextDisplayWidth to
+ // be layoutMeasuredWidth the first time through.
+ var textDisplayEstimatedWidth:Number = oldUnscaledWidth - paddingLeft - paddingRight;
+
+ // now we need to measure textDisplay's height. Unfortunately, this is tricky and
+ // is dependent on textDisplay's width.
+ // Use the old textDisplay width as an estimte for the new one.
+ // If we are wrong, we'll find out in updateDisplayList()
+ textDisplay.commitStyles();
+
+ // Clear min sizes first.
+ textDisplay.minWidth = textDisplay.minHeight = NaN;
+
+ // If lineBreak == explicit, always use NaN for estimated width
+ if (getStyle("lineBreak") == "explicit")
+ textDisplayEstimatedWidth = NaN;
+
+ setElementSize(textDisplay, textDisplayEstimatedWidth, NaN);
+
+ measuredHeight = getElementPreferredHeight(textDisplay) + paddingTop + paddingBottom;
+ }
+
+ /**
+
+ * @private
+
+ */
+
+ override protected function layoutContents(unscaledWidth:Number,
+ unscaledHeight:Number):void
+ {
+ super.layoutContents(unscaledWidth, unscaledHeight);
+
+ // position & size border
+ if (border)
+ {
+ setElementSize(border, unscaledWidth, unscaledHeight);
+ setElementPosition(border, 0, 0);
+ }
+
+ setElementSize(scroller, unscaledWidth, unscaledHeight);
+ setElementPosition(scroller, 0, 0);
+
+ // position & size the text
+ var explicitLineBreak:Boolean = getStyle("lineBreak") == "explicit";
+ var paddingLeft:Number = getStyle("paddingLeft");
+ var paddingRight:Number = getStyle("paddingRight");
+ var paddingTop:Number = getStyle("paddingTop");
+ var paddingBottom:Number = getStyle("paddingBottom");
+
+ var unscaledTextWidth:Number = unscaledWidth - paddingLeft - paddingRight;
+ var unscaledTextHeight:Number = unscaledHeight - paddingTop - paddingBottom;
+ var textHeight:Number = unscaledTextHeight;
+ var textWidth:Number = explicitLineBreak ? textDisplay.measuredTextSize.x : unscaledTextWidth;
+
+ // grab old measured textDisplay height before resizing it
+ var oldPreferredTextHeight:Number = getElementPreferredHeight(textDisplay);
+
+ // set width first to measure height correctly
+ textDisplay.commitStyles();
+ textDisplay.setLayoutBoundsSize(textWidth, NaN);
+
+ // TextField height should match its content or the TextArea bounds at minimum
+ // iOS special case to prevent Flex Scroller scrolling when editable
+ if (!_isIOS || !textDisplay.editable)
+ textHeight = Math.max(textDisplay.measuredTextSize.y, textHeight);
+
+ // FIXME (jasonsj): iOS native scroll bar appears even when explictHeight
+ // is not specified. Focus-in is jumpy.
+
+ if (promptDisplay)
+ {
+ promptDisplay.commitStyles();
+ setElementSize(promptDisplay, unscaledTextWidth, textHeight);
+ setElementPosition(promptDisplay, paddingLeft, paddingTop);
+
+ // no need to update textDisplay if promptDisplay is present
+ return;
+ }
+
+ // keep track of oldUnscaledWidth so we have a good guess as to the width
+ // of the textDisplay on the next measure() pass
+ oldUnscaledWidth = unscaledWidth;
+
+ // set the width of textDisplay to textWidth.
+ // set the height to oldTextHeight. If the height's actually wrong,
+ // we'll invalidateSize() and go through this layout pass again anyways
+ setElementSize(textDisplay, textWidth, textHeight);
+
+ // Set minWidth/Height on the text so the textDisplayGroup sizes accordingly
+ textDisplay.minWidth = textWidth;
+ textDisplay.minHeight = textHeight;
+ textDisplayGroup.invalidateDisplayList();
+
+ // grab new measured textDisplay height after the textDisplay has taken its final width
+ var newPreferredTextHeight:Number = getElementPreferredHeight(textDisplay);
+
+ // if the resize caused the textDisplay's height to change (because of
+ // text reflow), then we need to remeasure ourselves with our new width
+ if (oldPreferredTextHeight != newPreferredTextHeight)
+ invalidateSize();
+
+ // checking if text fits in TextArea
+ // does not apply to iOS due to native text editing and scrolling
+ // invalidateCaretPosition will never be true for iOS
+ if (invalidateCaretPosition)
+ {
+ // if the caret is outside the viewport, update the Group verticalScrollPosition
+ var charIndex:int = textDisplay.selectionBeginIndex;
+ var caretBounds:Rectangle = textDisplay.getCharBoundaries(charIndex);
+ var lineIndex:int = textDisplay.getLineIndexOfChar(charIndex);
+
+ // getCharBoundaries() returns null for new lines
+ if (!caretBounds)
+ {
+ // temporarily insert a character at the caretIndex
+ textDisplay.replaceText(charIndex, charIndex, "W");
+ caretBounds = textDisplay.getCharBoundaries(charIndex);
+ lineIndex = textDisplay.getLineIndexOfChar(charIndex);
+ textDisplay.replaceText(charIndex, charIndex + 1, "");
+ }
+
+ if (caretBounds)
+ {
+ // Scroll the internal Scroller to ensure the caret is visible
+ if (textHeight > unscaledTextHeight)
+ {
+
+ if (charIndex == textDisplay.text.length)
+ {
+ // Make sure textDisplayGroup is validated, otherwise the
+ // verticalScrollPosition may be out of bounds, which will
+ // cause a bounce effect.
+ textDisplayGroup.validateNow();
+ textDisplayGroup.verticalScrollPosition = textHeight;
+ }
+ else
+ {
+ // caretTopPositon and caretBottomPosition are TextField-relative positions
+ // the TextField is inset by padding styles of the TextArea (via the VGroup)
+
+ // adjust top position to 0 when on the first line
+ // caretTopPosition will be negative when off stage
+ var caretTopPosition:Number = ((caretBounds.y) < 0 || (lineIndex == 0))
+ ? 0 : caretBounds.y;
+
+ // caretBottomPosition is the y coordinate of the bottom bounds of the caret
+ var caretBottomPosition:Number = caretBounds.y + caretBounds.height;
+
+ // note that verticalScrollPosition min/max do not account for padding
+ var vspTop:Number = textDisplayGroup.verticalScrollPosition;
+
+ // vspBottom should be the max visible Y in the TextField
+ // coordinate space.
+ // remove paddingBottom for some clearance between caret and border
+ var vspBottom:Number = vspTop + unscaledHeight - paddingTop - paddingBottom;
+
+ // is the caret in or below the padding and viewport?
+ if (caretBottomPosition > vspBottom)
+ {
+ // adjust caretBottomPosition to max scroll position when on the last line
+ if (lineIndex + 1 == textDisplay.numLines)
+ {
+ // use textHeight+paddings instead of textDisplayGroup.contentHeight
+ // Group has not been resized by this point
+ textDisplayGroup.verticalScrollPosition = (textHeight + paddingTop + paddingBottom) - textDisplayGroup.height;
+ }
+ else
+ {
+ // bottom edge of the caret moves just inside the bottom edge of the scroller
+ // add delta between caret and vspBottom
+ textDisplayGroup.verticalScrollPosition = vspTop + (caretBottomPosition - vspBottom);
+ }
+ }
+ // is the caret above the viewport?
+ else if (caretTopPosition < vspTop)
+ {
+ // top edge of the caret moves inside the top edge of the scroller
+ textDisplayGroup.verticalScrollPosition = caretTopPosition;
+ }
+ }
+
+ scroller.validateNow();
+ }
+
+ // Convert to local coordinates
+ // Dispatch an event for an ancestor Scroller
+ // It will scroll the TextArea so the caret is in view
+ convertBoundsToLocal(caretBounds);
+ if (caretBounds.bottom != oldCaretBounds.bottom || caretBounds.top != oldCaretBounds.top)
+ dispatchEvent(new CaretBoundsChangeEvent(CaretBoundsChangeEvent.CARET_BOUNDS_CHANGE,true,true,oldCaretBounds,caretBounds));
+
+ oldCaretBounds = caretBounds;
+ }
+
+ invalidateCaretPosition = false;
+ }
+
+ // Make sure final scroll position is valid
+ snapTextScrollPosition();
+ }
+
+ /**
+ * @private
+ * Make sure the scroll positions are valid, and adjust if needed.
+ */
+ private function snapTextScrollPosition():void
+ {
+ var maxHsp:Number = textDisplayGroup.contentWidth > textDisplayGroup.width ?
+ textDisplayGroup.contentWidth-textDisplayGroup.width : 0;
+ textDisplayGroup.horizontalScrollPosition =
+ Math.min(Math.max(0,textDisplayGroup.horizontalScrollPosition),maxHsp);
+
+ var maxVsp:Number = textDisplayGroup.contentHeight > textDisplayGroup.height ?
+ textDisplayGroup.contentHeight-textDisplayGroup.height : 0;
+
+ textDisplayGroup.verticalScrollPosition =
+ Math.min(Math.max(0,textDisplayGroup.verticalScrollPosition),maxVsp);
+ }
+
+ /**
+ * @private
+ * Get the bounds of the caret
+ */
+ private function getCaretBounds():Rectangle
+ {
+ var charIndex:int = textDisplay.selectionBeginIndex;
+ var caretBounds:Rectangle = textDisplay.getCharBoundaries(charIndex);
+
+ if (!caretBounds)
+ {
+ textDisplay.replaceText(charIndex, charIndex, "W");
+ caretBounds = textDisplay.getCharBoundaries(charIndex);
+ textDisplay.replaceText(charIndex, charIndex + 1, "");
+ }
+
+ return caretBounds;
+ }
+
+ /**
+ * @private
+ * Convert bounds from textDisplay to local coordinates
+ */
+ private function convertBoundsToLocal(bounds:Rectangle):void
+ {
+ if (bounds)
+ {
+ var position:Point = new Point(bounds.x, bounds.y);
+ position = textDisplay.localToGlobal(position);
+ position = globalToLocal(position);
+ bounds.x = position.x;
+ bounds.y = position.y;
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function scrollToRange(anchorPosition:int, activePosition:int):void
+ {
+ var pos:int = Math.min(anchorPosition, activePosition);
+ var bounds:Rectangle = textDisplay.getCharBoundaries(pos);
+ var vsp:int = textDisplayGroup.verticalScrollPosition;
+ var paddingTop:Number = getStyle("paddingTop");
+ var paddingBottom:Number = getStyle("paddingBottom");
+
+ if (bounds && (bounds.top < vsp - paddingTop ||
+ bounds.bottom > vsp + unscaledHeight - paddingTop - paddingBottom))
+ {
+ textDisplayGroup.verticalScrollPosition = bounds.top + paddingTop;
+ snapTextScrollPosition();
+ }
+ }
+
+ /**
+ * @private
+ * Handle size and caret position changes that occur when text content
+ * changes.
+ */
+ private function textDisplay_changeHandler(event:Event):void
+ {
+ var tH:Number = textDisplay.textHeight;
+ var tW:Number = textDisplay.textWidth;
+ var explicitLineBreak:Boolean = getStyle("lineBreak") == "explicit";
+
+ // Size and caret position have changed if the text height is different or
+ // the text width is different and we aren't word wrapping
+ if (tH != lastTextHeight || ( explicitLineBreak && tW != lastTextWidth))
+ {
+ invalidateSize();
+ invalidateDisplayList();
+ invalidateCaretPosition = true;
+ }
+
+ lastTextHeight = tH;
+ lastTextWidth = tW;
+ }
+
+ /**
+ * @private
+ * Cancels any native scroll that the Flash Player attempts to do
+ */
+ private function textDisplay_scrollHandler(event:Event):void
+ {
+ // if iOS, let the OS handle scrolling
+ if (_isIOS)
+ return;
+
+ // If not IOS, we will handle scrolling, so don't let the native
+ // flash textfield scroll at all.
+ if (textDisplay.scrollV > 1)
+ textDisplay.scrollV = 1;
+ if (textDisplay.scrollH > 0)
+ textDisplay.scrollH = 0;
+ }
+
+ /**
+ * @private
+ * Adjust viewport when using key navigation
+ */
+ private function textDisplay_keyHandler(event:KeyboardEvent):void
+ {
+ // update scroll position when caret changes
+ if ((event.keyCode == Keyboard.UP
+ || event.keyCode == Keyboard.DOWN
+ || event.keyCode == Keyboard.LEFT
+ || event.keyCode == Keyboard.RIGHT))
+ {
+ invalidateDisplayList();
+ invalidateCaretPosition = true;
+ }
+
+ // Change event is not always sent when delete key is pressed, so
+ // invalidate the size here
+ if (event.keyCode == Keyboard.BACKSPACE)
+ {
+ invalidateSize();
+ }
+ }
+
+ /**
+ * @private
+ * Send a caret change event to an ancestor Scroller
+ */
+ private function textDisplay_softKeyboardActivateHandler(event:SoftKeyboardEvent):void
+ {
+ var keyboardRect:Rectangle = stage.softKeyboardRect;
+
+ if (keyboardRect.width > 0 && keyboardRect.height > 0)
+ {
+ var newCaretBounds:Rectangle = getCaretBounds();
+ convertBoundsToLocal(newCaretBounds);
+
+ if (oldCaretBounds != newCaretBounds)
+ {
+ dispatchEvent(new CaretBoundsChangeEvent(CaretBoundsChangeEvent.CARET_BOUNDS_CHANGE,true,true,oldCaretBounds,newCaretBounds));
+ oldCaretBounds = newCaretBounds;
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function resizeHandler(event:Event):void
+ {
+ // Resizing needs to tickle the TextArea's internal auto-scroll logic
+ invalidateCaretPosition = true;
+ invalidateDisplayList();
+ }
+
+ /**
+ * @private
+ */
+ override public function styleChanged(styleProp:String):void
+ {
+ super.styleChanged(styleProp);
+
+ // propogate styleChanged explicitly to textDisplay
+ if (textDisplay)
+ textDisplay.styleChanged(styleProp);
+
+ // Check for padding style changes
+ if (!styleProp || styleProp == "styleName" || styleProp.indexOf("padding") >= 0)
+ {
+ if (textDisplay)
+ {
+ textDisplay.left = getStyle("paddingLeft");
+ textDisplay.top = getStyle("paddingTop");
+ textDisplay.right = getStyle("paddingRight");
+ textDisplay.bottom = getStyle("paddingBottom");
+ }
+ }
+ }
+ }
+}
\ No newline at end of file