Repository: flex-asjs Updated Branches: refs/heads/develop 807667699 -> 876fa8990
List example with Icon in IR Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/876fa899 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/876fa899 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/876fa899 Branch: refs/heads/develop Commit: 876fa89901f9e00d372da0ecd71d75303cf89bed Parents: 8076676 Author: Carlos Rovira <carlosrov...@apache.org> Authored: Sat Dec 10 16:05:47 2016 +0100 Committer: Carlos Rovira <carlosrov...@apache.org> Committed: Sat Dec 10 16:05:47 2016 +0100 ---------------------------------------------------------------------- .../flexjs/MDLExample/src/main/flex/Lists.mxml | 11 ++++- .../itemRenderers/ActorListItemRenderer.mxml | 44 ------------------ .../ActorNameAndIconListItemRenderer.mxml | 49 ++++++++++++++++++++ .../ActorNameListItemRenderer.mxml | 44 ++++++++++++++++++ .../src/main/resources/mdl-styles.css | 13 ++++-- 5 files changed, 111 insertions(+), 50 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/876fa899/examples/flexjs/MDLExample/src/main/flex/Lists.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLExample/src/main/flex/Lists.mxml b/examples/flexjs/MDLExample/src/main/flex/Lists.mxml index d18dbf5..38ef48d 100644 --- a/examples/flexjs/MDLExample/src/main/flex/Lists.mxml +++ b/examples/flexjs/MDLExample/src/main/flex/Lists.mxml @@ -45,10 +45,17 @@ limitations under the License. destinationPropertyName="dataProvider" /> </mdl:beads> </mdl:List> - </mdl:Grid> - + <mdl:List labelField="actorName" className="actorNameAndIconListItemRenderer"> + <mdl:beads> + <js:ConstantBinding + sourceID="model" + sourcePropertyName="actors" + destinationPropertyName="dataProvider" /> + </mdl:beads> + </mdl:List> + </mdl:Grid> <!-- <mdl:List labelField="label" className="customListItemRenderer"> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/876fa899/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorListItemRenderer.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorListItemRenderer.mxml b/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorListItemRenderer.mxml deleted file mode 100644 index b4b33b5..0000000 --- a/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorListItemRenderer.mxml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - ---> -<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="http://www.w3.org/1999/xhtml"> - - <fx:Script> - <![CDATA[ - import vos.ActorVO; - - [Bindable("dataChange")] - public function get actor():ActorVO - { - return data as ActorVO; - } - ]]> - </fx:Script> - - <js:beads> - <js:ItemRendererDataBinding /> - </js:beads> - - <mdl:ListItemPrimaryContent text="{actor.actorName}"/> - -</mdl:ListItemRenderer> - http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/876fa899/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorNameAndIconListItemRenderer.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorNameAndIconListItemRenderer.mxml b/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorNameAndIconListItemRenderer.mxml new file mode 100644 index 0000000..39e1a3c --- /dev/null +++ b/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorNameAndIconListItemRenderer.mxml @@ -0,0 +1,49 @@ +<?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. + +--> +<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="http://www.w3.org/1999/xhtml"> + + <fx:Script> + <![CDATA[ + import vos.ActorVO; + + [Bindable("dataChange")] + public function get actor():ActorVO + { + return data as ActorVO; + } + ]]> + </fx:Script> + + <js:beads> + <js:ItemRendererDataBinding /> + </js:beads> + + <mdl:ListItemPrimaryContent> + <mdl:beads> + <mdl:MaterialIconPerson listItemIcon="true"/> + </mdl:beads> + <js:Span text="{actor.actorName}"/> + </mdl:ListItemPrimaryContent> + +</mdl:ListItemRenderer> + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/876fa899/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorNameListItemRenderer.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorNameListItemRenderer.mxml b/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorNameListItemRenderer.mxml new file mode 100644 index 0000000..b4b33b5 --- /dev/null +++ b/examples/flexjs/MDLExample/src/main/flex/itemRenderers/ActorNameListItemRenderer.mxml @@ -0,0 +1,44 @@ +<?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. + +--> +<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="http://www.w3.org/1999/xhtml"> + + <fx:Script> + <![CDATA[ + import vos.ActorVO; + + [Bindable("dataChange")] + public function get actor():ActorVO + { + return data as ActorVO; + } + ]]> + </fx:Script> + + <js:beads> + <js:ItemRendererDataBinding /> + </js:beads> + + <mdl:ListItemPrimaryContent text="{actor.actorName}"/> + +</mdl:ListItemRenderer> + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/876fa899/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css b/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css index aac2219..6730c58 100644 --- a/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css +++ b/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css @@ -41,16 +41,21 @@ js|Image IBeadView: ClassReference("org.apache.flex.html.beads.ImageView"); } -.actorListItemRenderer +.actorNameListItemRenderer { - IItemRenderer: ClassReference("itemRenderers.ActorListItemRenderer"); + IItemRenderer: ClassReference("itemRenderers.ActorNameListItemRenderer"); } -.customListItemRenderer +.actorNameAndIconListItemRenderer { - IItemRenderer: ClassReference("itemRenderers.CustomListItemRenderer"); + IItemRenderer: ClassReference("itemRenderers.ActorNameAndIconListItemRenderer"); } +/*.customListItemRenderer +{ + IItemRenderer: ClassReference("itemRenderers.CustomListItemRenderer"); +}*/ + .layoutTransparent { background: url('assets/transparent.jpg') center / cover; color: white;