You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2017/03/07 00:09:58 UTC

[2/2] git commit: [flex-asjs] [refs/heads/develop] - - Fix build: Creat custom material icon which will display FontAwesomeIcon in FlexTeamPage_MDL

- Fix build: Creat custom material icon which will display FontAwesomeIcon in FlexTeamPage_MDL


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

Branch: refs/heads/develop
Commit: 86ecc8acf7fb2603969db1d5bcf853f8d077559e
Parents: 2a172a0
Author: piotrz <pi...@apache.org>
Authored: Tue Mar 7 01:09:52 2017 +0100
Committer: piotrz <pi...@apache.org>
Committed: Tue Mar 7 01:09:52 2017 +0100

----------------------------------------------------------------------
 .../flex/itemRenderers/MemberItemRenderer.mxml  | 58 ++++++++++----------
 .../MaterialIconWithFontAwesomeIcon.as          | 28 ++++++++++
 2 files changed, 58 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/86ecc8ac/examples/flexjs/FlexTeamPage_MDL/src/main/flex/itemRenderers/MemberItemRenderer.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/FlexTeamPage_MDL/src/main/flex/itemRenderers/MemberItemRenderer.mxml b/examples/flexjs/FlexTeamPage_MDL/src/main/flex/itemRenderers/MemberItemRenderer.mxml
index b19bbc2..ad8004b 100644
--- a/examples/flexjs/FlexTeamPage_MDL/src/main/flex/itemRenderers/MemberItemRenderer.mxml
+++ b/examples/flexjs/FlexTeamPage_MDL/src/main/flex/itemRenderers/MemberItemRenderer.mxml
@@ -20,34 +20,34 @@ limitations under the License.
 <mdl:ListItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:js="library://ns.apache.org/flexjs/basic"
                       xmlns:mdl="library://ns.apache.org/flexjs/mdl"
-                      xmlns:fa="library://ns.apache.org/flexjs/fa"
                       xmlns="http://www.w3.org/1999/xhtml"
-                      >
+                      xmlns:materialIcon="materialIcon.*" xmlns:fa="library://ns.apache.org/flexjs/fa">
 
     <fx:Script>
 		<![CDATA[
         import org.apache.flex.fa.FontAwesomeIconRotation;
-        import org.apache.flex.fa.FontAwesomeIconSize;
         import org.apache.flex.fa.FontAwesomeIconType;
 
         import vos.MemberVO;
 
         [Bindable("dataChange")]
-        public function get member():MemberVO{
+        public function get member():MemberVO
+        {
             return data as MemberVO;
         }
 
-        [Bindable] private var _spin:Boolean =  false;
+        [Bindable]
+        private var _spin:Boolean = false;
 
-        private function handleCogClick():void {
-            _spin= !_spin;
+        private function handleCogClick():void
+        {
+            _spin = !_spin;
         }
-
         ]]>
 	</fx:Script>
 
     <mdl:beads>
-        <js:ItemRendererDataBinding />
+        <js:ItemRendererDataBinding/>
     </mdl:beads>
 
     <mdl:Card className="demo-card-wide" shadow="8">
@@ -57,57 +57,59 @@ limitations under the License.
         </mdl:CardTitle>
         <mdl:CardSupportingText>
             <js:Container className="cardRow1">
-                <js:HTMLText html="{member.bio}" className="bio" />
-                <js:Image src="http://flex.apache.org/{member.photoURL}" className="photo" />
+                <js:HTMLText html="{member.bio}" className="bio"/>
+                <js:Image src="http://flex.apache.org/{member.photoURL}" className="photo"/>
             </js:Container>
             <!--<js:TextNode text="{member.bio}"/>-->
         </mdl:CardSupportingText>
-        <mdl:Spacer height="20" />
+        <mdl:Spacer height="20"/>
         <mdl:CardActions border="true">
             <mdl:Button colored="true" fab="true" ripple="true" raised="false" primary="true">
                 <mdl:materialIcon>
-                    <fa:FontAwesomeIcon iconType="{FontAwesomeIconType.TWITTER}" />
+                    <materialIcon:MaterialIconWithFontAwesomeIcon iconType="{FontAwesomeIconType.TWITTER}"/>
                 </mdl:materialIcon>
             </mdl:Button>
             <mdl:Button colored="true" fab="true" ripple="true" raised="false" accent="true">
                 <mdl:materialIcon>
-                    <fa:FontAwesomeIcon iconType="{FontAwesomeIconType.LINKEDIN}" />
+                    <materialIcon:MaterialIconWithFontAwesomeIcon iconType="{FontAwesomeIconType.LINKEDIN}"/>
                 </mdl:materialIcon>
             </mdl:Button>
             <mdl:Button colored="true" fab="true" ripple="true" raised="false">
                 <mdl:materialIcon>
-                    <fa:FontAwesomeIcon iconType="{FontAwesomeIconType.GITHUB}" />
+                    <materialIcon:MaterialIconWithFontAwesomeIcon iconType="{FontAwesomeIconType.GITHUB}"/>
                 </mdl:materialIcon>
             </mdl:Button>
             <mdl:Button colored="true" fab="true" ripple="true" raised="false">
                 <mdl:materialIcon>
-                    <fa:FontAwesomeIcon iconType="{FontAwesomeIconType.GITHUB}" fixedWidth="true" />
+                    <materialIcon:MaterialIconWithFontAwesomeIcon iconType="{FontAwesomeIconType.GITHUB}"
+                                                             fixedWidth="true"/>
                 </mdl:materialIcon>
             </mdl:Button>
             <mdl:Button colored="true" fab="true" ripple="true" raised="false">
                 <mdl:materialIcon>
-                    <fa:FontAwesomeIcon iconType="{FontAwesomeIconType.GLASS}"
-                                        showBorder="true" rotation="{FontAwesomeIconRotation.R90}">
-                    </fa:FontAwesomeIcon>
+                    <materialIcon:MaterialIconWithFontAwesomeIcon iconType="{FontAwesomeIconType.GLASS}"
+                                                             showBorder="true"
+                                                             rotation="{FontAwesomeIconRotation.R90}">
+                    </materialIcon:MaterialIconWithFontAwesomeIcon>
                 </mdl:materialIcon>
             </mdl:Button>
             <mdl:Button colored="true" fab="true" ripple="true" raised="false" click="{handleCogClick()}">
                 <mdl:materialIcon>
-                    <fa:FontAwesomeIcon iconType="{FontAwesomeIconType.COG}">
-                        <fa:beads>
-                            <fa:Animate spin="{_spin}" />
-                        </fa:beads>
-                    </fa:FontAwesomeIcon>
+                    <materialIcon:MaterialIconWithFontAwesomeIcon iconType="{FontAwesomeIconType.COG}">
+                        <materialIcon:beads>
+                            <fa:Animate spin="{_spin}"/>
+                        </materialIcon:beads>
+                    </materialIcon:MaterialIconWithFontAwesomeIcon>
                 </mdl:materialIcon>
             </mdl:Button>
 
             <mdl:Button colored="true" fab="true" ripple="true" raised="false">
                 <mdl:materialIcon>
-                    <fa:FontAwesomeIcon iconType="{FontAwesomeIconType.SPINNER}">
-                        <fa:beads>
+                    <materialIcon:MaterialIconWithFontAwesomeIcon iconType="{FontAwesomeIconType.SPINNER}">
+                        <materialIcon:beads>
                             <fa:Animate pulse="true"/>
-                        </fa:beads>
-                    </fa:FontAwesomeIcon>
+                        </materialIcon:beads>
+                    </materialIcon:MaterialIconWithFontAwesomeIcon>
                 </mdl:materialIcon>
             </mdl:Button>
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/86ecc8ac/examples/flexjs/FlexTeamPage_MDL/src/main/flex/materialIcon/MaterialIconWithFontAwesomeIcon.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/FlexTeamPage_MDL/src/main/flex/materialIcon/MaterialIconWithFontAwesomeIcon.as b/examples/flexjs/FlexTeamPage_MDL/src/main/flex/materialIcon/MaterialIconWithFontAwesomeIcon.as
new file mode 100644
index 0000000..69aa280
--- /dev/null
+++ b/examples/flexjs/FlexTeamPage_MDL/src/main/flex/materialIcon/MaterialIconWithFontAwesomeIcon.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 materialIcon
+{
+    import org.apache.flex.fa.FontAwesomeIcon;
+    import org.apache.flex.mdl.materialIcons.IMaterialIcon;
+
+    public class MaterialIconWithFontAwesomeIcon extends FontAwesomeIcon implements IMaterialIcon
+    {
+
+    }
+}