You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by bi...@apache.org on 2014/12/10 21:41:36 UTC

[2/3] git commit: [flex-examples] [refs/heads/develop] - added another air feature

added another air feature


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

Branch: refs/heads/develop
Commit: fec2c3b6b85b4e3f4d0aa0537f59170e2325f713
Parents: 67a2807
Author: nasha001 <na...@DM-DT-NASH.hartford.gov>
Authored: Wed Nov 12 10:58:00 2014 -0500
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Wed Dec 10 12:24:21 2014 -0800

----------------------------------------------------------------------
 .../src/AIRViews/NativeAppView.mxml             | 73 ++++++++++++++++++++
 tourdeflexmobile/src/TourDeFlexMobile.mxml      | 46 ++++++------
 2 files changed, 97 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-examples/blob/fec2c3b6/tourdeflexmobile/src/AIRViews/NativeAppView.mxml
----------------------------------------------------------------------
diff --git a/tourdeflexmobile/src/AIRViews/NativeAppView.mxml b/tourdeflexmobile/src/AIRViews/NativeAppView.mxml
new file mode 100644
index 0000000..bee6e54
--- /dev/null
+++ b/tourdeflexmobile/src/AIRViews/NativeAppView.mxml
@@ -0,0 +1,73 @@
+<?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:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		xmlns:s="library://ns.adobe.com/flex/spark" 
+		title="Native App">
+	
+	<fx:Script>
+		<![CDATA[
+
+			
+			protected function buttonHandler(event:MouseEvent):void
+			{
+				if(currentState == "DemoState")
+				{
+					currentState = "InfoState";				
+				}
+				else if(currentState == "InfoState")
+				{
+					currentState = "DemoState";
+				}
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<s:states>
+		<s:State name="DemoState"/>
+		<s:State name="InfoState"/>
+	</s:states>
+	
+	<fx:Declarations>
+		<s:MultiDPIBitmapSource id="aboutIcon" 
+								source160dpi="@Embed('assets/icons/160/about.png')" 
+								source240dpi="@Embed('assets/icons/240/about.png')" 
+								source320dpi="@Embed('assets/icons/320/about.png')" 
+								source480dpi="assets/icons/480/about.png"/>
+		<s:MultiDPIBitmapSource id="demoIcon" 
+								source160dpi="@Embed('assets/icons/160/dock.png')" 
+								source240dpi="@Embed('assets/icons/240/dock.png')" 
+								source320dpi="@Embed('assets/icons/320/dock.png')" 
+								source480dpi="assets/icons/480/dock.png"/>
+		<s:ArrayCollection id="itemsCollection"/>
+	</fx:Declarations>
+	<s:VGroup width="100%" height="100%" includeIn="DemoState" horizontalAlign="center" verticalAlign="middle">
+		<s:Button label="Email" click="navigateToURL(new URLRequest ('mailto:email@email.com'))"/>
+		<s:Button label="Browser" click="navigateToURL(new URLRequest ('http://flex.apache.org/'))"/>
+		<s:Button label="Maps" click="navigateToURL(new URLRequest ('http://maps.google.com/'))"/>
+		<s:Button label="SMS" click="navigateToURL(new URLRequest ('sms:1234567890'))"/>
+		<s:Button label="Phone" click="navigateToURL(new URLRequest ('tel:1234567890'))"/>
+	</s:VGroup>
+	<s:TextArea includeIn="InfoState" selectable="false" left="10" right="10" top="10" bottom="10" editable="false" 
+				text="In AIR, on mobile platforms, the sms: and tel: URI schemes are supported. On Android, vipaccess:, connectpro:, and market: URI schemes are supported. The URL syntax is subject to the platform conventions. For example, on Android, the URI scheme must be lower case. When you navigate to a URL using one of these schemes, the runtime opens the URL in the default application for handling the scheme. Thus, navigating to tel:+5555555555 opens the phone dialer with the specified number already entered. A separate application or utility, such as a phone dialer must be available to process the URL. "/>	
+	<s:actionContent>
+		<s:Button click="buttonHandler(event)" icon.DemoState="{aboutIcon}" icon.InfoState="{demoIcon}"/>
+	</s:actionContent>
+</s:View>

http://git-wip-us.apache.org/repos/asf/flex-examples/blob/fec2c3b6/tourdeflexmobile/src/TourDeFlexMobile.mxml
----------------------------------------------------------------------
diff --git a/tourdeflexmobile/src/TourDeFlexMobile.mxml b/tourdeflexmobile/src/TourDeFlexMobile.mxml
index bab2d37..9d71bb4 100644
--- a/tourdeflexmobile/src/TourDeFlexMobile.mxml
+++ b/tourdeflexmobile/src/TourDeFlexMobile.mxml
@@ -27,6 +27,7 @@ limitations under the License.
 	<fx:Style source="styles.css"/>	
 	<fx:Script>
 		<![CDATA[
+			import AIRViews.NativeAppView;
 			
 			import flash.events.Event;
 			import flash.events.MouseEvent;
@@ -41,6 +42,7 @@ limitations under the License.
 			import AIRViews.AccelerometerView;
 			import AIRViews.CameraView;
 			import AIRViews.GeolocationView;
+			import AIRViews.NativeAppView;
 			import AIRViews.SQLiteView;
 			
 			import LayoutViews.AccordionLayoutView;
@@ -96,34 +98,33 @@ limitations under the License.
 				}
 			} 	
 			
-			/*	protected function mouseMove(event:MouseEvent):void 
+			/*protected function mouseMove(event:MouseEvent):void 
 			{				
-			navigator.mouseEnabled = false;		
-			var myRectangle:Rectangle = new Rectangle(-215, 42, 215, 0);
-			lateralMenu.startDrag(false, myRectangle );
-			trace(lateralMenu.x)
-			//lateralMenu.addEventListener(MouseEvent.CLICK,suppressClick,true,9999,true);
-			
+				navigator.mouseEnabled = false;		
+				var myRectangle:Rectangle = new Rectangle(-215, 42, 215, 0);
+				lateralMenu.startDrag(false, myRectangle );
+				trace(lateralMenu.x)
+				//lateralMenu.addEventListener(MouseEvent.CLICK,suppressClick,true,9999,true);
 			} 
 			
 			protected function mouseUp(event:MouseEvent):void 
 			{		
+				if (lateralMenu.x < -65) 
+				{
+					lateralMenu.stopDrag();
 			
-			if (lateralMenu.x < -65) 
-			{
-			lateralMenu.stopDrag();
-			lateralMenu.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);				
-			lateralMenu.removeEventListener(MouseEvent.MOUSE_DOWN, mouseMove);					
-			moveOut.play();
-			isOpen == false;					
-			}
-			if (lateralMenu.x > -65) 
-			{
-			lateralMenu.stopDrag();
-			moveIn.play();
-			isOpen == true;					
-			}
-			lateralMenu.stopDrag();	
+					moveOut.play();
+					isOpen == false;					
+				}
+				if (lateralMenu.x > -65) 
+				{
+					lateralMenu.stopDrag();
+					moveIn.play();
+					isOpen == true;					
+				}
+				lateralMenu.stopDrag();	
+				lateralMenu.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);				
+				lateralMenu.removeEventListener(MouseEvent.MOUSE_DOWN, mouseMove);		
 			}	*/	
 			
 			
@@ -251,6 +252,7 @@ limitations under the License.
 				<fx:Object label="Accelerometer" type="view" view="{AccelerometerView}"/>
 				<!--fx:Object label="Camera" type="view" view="{CameraView}"/-->
 				<fx:Object label="Geolocation" type="view" view="{GeolocationView}"/>
+				<fx:Object label="Native App Integration" type="view" view="{NativeAppView}"/>
 				<fx:Object label="SQLite" type="view" view="{SQLiteView}"/>
 				
 				<fx:Object label="DATA ACCESS" type="separator"/>