flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [41/50] git commit: [flex-asjs] [refs/heads/feature/mdl] - Optimize accordion item renderers layout.
Date Mon, 19 Dec 2016 02:18:29 GMT
Optimize accordion item renderers layout.


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

Branch: refs/heads/feature/mdl
Commit: 133dd3c70d14e07a7cca140fc2b832fc24d7394e
Parents: dfec5b2
Author: yishayw <yishayjobs@hotmail.com>
Authored: Sun Dec 18 13:14:43 2016 +0200
Committer: yishayw <yishayjobs@hotmail.com>
Committed: Sun Dec 18 13:14:43 2016 +0200

----------------------------------------------------------------------
 .../projects/HTML/src/main/flex/HTMLClasses.as  |  3 +-
 .../html/beads/AccordionItemRendererView.as     | 63 ++++++++++++++++++++
 .../supportClasses/AccordionItemRenderer.as     |  5 ++
 .../flex/html/supportClasses/ICollapsible.as    |  1 +
 .../HTML/src/main/resources/defaults.css        |  1 +
 5 files changed, 72 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/133dd3c7/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
index 077bd88..35f2a98 100644
--- a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
+++ b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
@@ -64,7 +64,8 @@ internal class HTMLClasses
 	{
 	    import org.apache.flex.html.beads.NumericStepperView; NumericStepperView;
 	}
-    import org.apache.flex.html.beads.PanelView; PanelView;
+	import org.apache.flex.html.beads.PanelView; PanelView;
+	import org.apache.flex.html.beads.AccordionItemRendererView; AccordionItemRendererView;
 	import org.apache.flex.html.beads.SliderView; SliderView;
 	COMPILE::SWF
 	{

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/133dd3c7/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AccordionItemRendererView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AccordionItemRendererView.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AccordionItemRendererView.as
new file mode 100644
index 0000000..29842be
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AccordionItemRendererView.as
@@ -0,0 +1,63 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.html.beads
+{		
+	import org.apache.flex.events.Event;
+	import org.apache.flex.html.supportClasses.ICollapsible;
+    
+	/**
+	 * This class creates and manages the contents of an AccordionItemItemRenderer
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+	 */
+	public class AccordionItemRendererView extends PanelView
+	{
+		/**
+     	 *  The AccordionItemRendererView class is the default view for
+         *  the org.apache.flex.html.supportClasses.AccordionItemRenderer classes.
+         *  It provides some layout optimizations that can be attained by assuming
+		 *  the strand to be an org.apache.flex.html.supportClasses.ICollapsible.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function AccordionItemRendererView()
+		{
+			super();
+		}
+		
+		override protected function performLayout(event:Event):void
+		{
+			var collapsibleStrand:ICollapsible = _strand as ICollapsible;
+			if (!collapsibleStrand.collapsed)
+			{
+				super.performLayout(event);
+			} else // skip layout for viewport children
+			{
+				layoutViewBeforeContentLayout();
+				layoutViewAfterContentLayout();
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/133dd3c7/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/AccordionItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/AccordionItemRenderer.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/AccordionItemRenderer.as
index 2b069c7..e1e4b0d 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/AccordionItemRenderer.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/AccordionItemRenderer.as
@@ -158,5 +158,10 @@ package org.apache.flex.html.supportClasses
 			height = collapsedHeight;
 		}
 		
+		public function get collapsed():Boolean
+		{
+			return height == collapsedHeight;
+		}
+		
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/133dd3c7/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ICollapsible.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ICollapsible.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ICollapsible.as
index 39a496e..c1f0c4e 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ICollapsible.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ICollapsible.as
@@ -23,5 +23,6 @@ package org.apache.flex.html.supportClasses
 		function get collapsedHeight():Number;
 		function get collapsedWidth():Number;
 		function collapse():void;
+		function get collapsed():Boolean;
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/133dd3c7/frameworks/projects/HTML/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/defaults.css b/frameworks/projects/HTML/src/main/resources/defaults.css
index 24bc5c7..d9989ec 100644
--- a/frameworks/projects/HTML/src/main/resources/defaults.css
+++ b/frameworks/projects/HTML/src/main/resources/defaults.css
@@ -415,6 +415,7 @@ StringItemRenderer
 AccordionItemRenderer
 {
 	IBeadController: ClassReference("org.apache.flex.html.beads.controllers.AccordionItemRendererMouseController");
+	IBeadView: ClassReference("org.apache.flex.html.beads.AccordionItemRendererView");
 }
 
 TreeItemRenderer


Mime
View raw message