You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2018/09/17 11:19:28 UTC

[royale-asjs] branch develop updated: Add view states example to Jewel Example

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new f7a2012  Add view states example to Jewel Example
f7a2012 is described below

commit f7a201206f9225e40d8adc04e82fff8842140bee
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Sep 17 13:19:21 2018 +0200

    Add view states example to Jewel Example
---
 examples/royale/JewelExample/.vscode/tasks.json    |  4 +-
 .../JewelExample/src/main/royale/MainContent.mxml  |  1 +
 .../src/main/royale/ViewStatesPlayGround.mxml      | 97 ++++++++++++++++++++++
 .../src/main/royale/models/MainNavigationModel.as  |  5 +-
 4 files changed, 104 insertions(+), 3 deletions(-)

diff --git a/examples/royale/JewelExample/.vscode/tasks.json b/examples/royale/JewelExample/.vscode/tasks.json
index 4a047cb..6a0a5cf 100644
--- a/examples/royale/JewelExample/.vscode/tasks.json
+++ b/examples/royale/JewelExample/.vscode/tasks.json
@@ -26,7 +26,9 @@
                 "reveal": "always",
                 "panel": "new"
             },
-            "problemMatcher": []
+            "problemMatcher": [
+                "$nextgenas_nomatch"
+            ]
         },
         {
             "label": "Build Release with AS3 Extension",
diff --git a/examples/royale/JewelExample/src/main/royale/MainContent.mxml b/examples/royale/JewelExample/src/main/royale/MainContent.mxml
index d9276f2..f04358a 100644
--- a/examples/royale/JewelExample/src/main/royale/MainContent.mxml
+++ b/examples/royale/JewelExample/src/main/royale/MainContent.mxml
@@ -136,6 +136,7 @@ limitations under the License.
         <local:DropDownListPlayGround id="dropdownlist_panel"/>
         <local:SnackbarPlayGround id="snackbar_panel"/>
         <local:TabBarPlayGround id="tabbar_panel"/>
+        <local:ViewStatesPlayGround id="viewstates_panel"/>
     </j:ApplicationMainContent>
     
 </j:ApplicationResponsiveView>
diff --git a/examples/royale/JewelExample/src/main/royale/ViewStatesPlayGround.mxml b/examples/royale/JewelExample/src/main/royale/ViewStatesPlayGround.mxml
new file mode 100644
index 0000000..2e01ded
--- /dev/null
+++ b/examples/royale/JewelExample/src/main/royale/ViewStatesPlayGround.mxml
@@ -0,0 +1,97 @@
+<?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.
+
+-->
+<j:SectionContent xmlns:fx="http://ns.adobe.com/mxml/2009"
+				xmlns:j="library://ns.apache.org/royale/jewel"
+				xmlns:html="library://ns.apache.org/royale/html"
+				xmlns:js="library://ns.apache.org/royale/basic">
+
+	
+	
+	<j:beads>
+        <js:ContainerDataBinding/>
+    </j:beads>
+
+	<j:Grid gap="true" itemsVerticalAlign="itemsSameHeight">
+		<j:GridCell desktopNumerator="1" desktopDenominator="1"
+					tabletNumerator="1" tabletDenominator="1"
+					phoneNumerator="1" phoneDenominator="1"
+					id="cellIncludeIn">
+			<j:states>
+                <js:State name="login"/>
+                <js:State name="loggedIn"/>
+            </j:states>
+            
+            <j:beads>
+                <js:SimpleStatesImpl/>
+            </j:beads>
+
+            <j:Card includeIn="login">
+                <html:H1 text="View States with includeIn"/>
+                <j:TextInput text="someuser"/>
+                <j:TextInput text="somepass">
+                    <j:beads>
+                        <j:PasswordInput/>
+                    </j:beads>
+                </j:TextInput>
+                <j:Button text="Login" emphasis="primary" click="cellIncludeIn.currentState = 'loggedIn'"/>
+            </j:Card>
+
+            <j:Card includeIn="loggedIn">
+                <html:H1 text="You are logged in!! :)"/>
+                <j:Button text="Logout" click="cellIncludeIn.currentState = 'login'"/>
+            </j:Card>
+		</j:GridCell>
+	</j:Grid>
+
+	<j:Grid gap="true" itemsVerticalAlign="itemsSameHeight">
+		<j:GridCell desktopNumerator="1" desktopDenominator="1"
+					tabletNumerator="1" tabletDenominator="1"
+					phoneNumerator="1" phoneDenominator="1"
+					id="cellDotNotation">
+			<j:states>
+                <js:State name="login_dot"/>
+                <js:State name="loggedIn_dot"/>   
+            </j:states>
+            
+            <j:beads>
+                <js:SimpleStatesImpl/>
+            </j:beads>
+
+            <j:Card visible="true" visible.loggedIn_dot="false">
+                <html:H1 text="View States with dot notation"/>
+                <j:TextInput text="someuser"/>
+                <j:TextInput text="somepass">
+                    <j:beads>
+                        <j:PasswordInput/>
+                    </j:beads>
+                </j:TextInput>
+                <j:Button text="Login" emphasis="primary" click="cellDotNotation.currentState = 'loggedIn_dot'" />
+            </j:Card>
+
+            <j:Card visible="false" visible.loggedIn_dot="true">
+                <html:H1 text="You are logged in!! :)"/>
+                <j:Button text="Logout" click="cellDotNotation.currentState = 'login_dot'"/>
+            </j:Card>
+		</j:GridCell>
+		
+	</j:Grid>
+	
+
+</j:SectionContent>
diff --git a/examples/royale/JewelExample/src/main/royale/models/MainNavigationModel.as b/examples/royale/JewelExample/src/main/royale/models/MainNavigationModel.as
index 68874be..fbdefe1 100644
--- a/examples/royale/JewelExample/src/main/royale/models/MainNavigationModel.as
+++ b/examples/royale/JewelExample/src/main/royale/models/MainNavigationModel.as
@@ -51,10 +51,11 @@ package models
         }
         
         private var _containerDrawerNavigation:ArrayList = new ArrayList([
-            new NavigationLinkVO("Card", "card_panel", MaterialIconType.WEB_ASSET),
+            new NavigationLinkVO("View States", "viewstates_panel", MaterialIconType.FLIP_TO_FRONT),
             new NavigationLinkVO("Grid", "grid_panel", MaterialIconType.GRID_ON),
             new NavigationLinkVO("Tables", "tables_panel", MaterialIconType.VIEW_QUILT),
-            new NavigationLinkVO("TabBar", "tabbar_panel", MaterialIconType.TAB)
+            new NavigationLinkVO("TabBar", "tabbar_panel", MaterialIconType.TAB),
+            new NavigationLinkVO("Card", "card_panel", MaterialIconType.WEB_ASSET)
             // new NavigationLinkVO("Tabs", "tabs_panel")
         ]);