Package | feathers.layout |
Interface | public interface IVariableVirtualLayout extends IVirtualLayout, ILayout, IFeathersEventDispatcher |
Implementors | FlowLayout, HorizontalLayout, VerticalLayout, WaterfallLayout |
Product Version : | Feathers 1.0.0 |
Property | Defined By | ||
---|---|---|---|
hasVariableItemDimensions : Boolean
When the layout is virtualized, and this value is true, the items may
have variable dimensions. | IVariableVirtualLayout | ||
requiresLayoutOnScroll : Boolean [read-only]
Determines if the container calls layout() when the
scroll position changes. | ILayout | ||
typicalItem : DisplayObject
Used internally by a component that supports layout virtualization,
such as List, to provide a display object with
dimensions that represent a "typical" item in the layout. | IVirtualLayout | ||
useVirtualLayout : Boolean
Determines if virtual layout should be used. | IVirtualLayout |
Method | Defined By | ||
---|---|---|---|
addEventListener(type:String, listener:Function):void
Adds a listener for an event type. | IFeathersEventDispatcher | ||
addToVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void
Inserts an item in to the cache at the specified index, pushing the
old cached value at that index, and all following values, up one
index. | IVariableVirtualLayout | ||
calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int
Using the current index and a key press, calculates the new index. | ILayout | ||
dispatchEvent(event:Event):void
Dispatches an event to all listeners added for the specified event type. | IFeathersEventDispatcher | ||
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event from the pool with the specified to all listeners
for the specified event type. | IFeathersEventDispatcher | ||
getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point
Calculates the scroll position nearest to the current scroll position
that will display the full bounds of the item within the view port. | ILayout | ||
getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point
Using the item dimensions, calculates a scroll position that will
ensure that the item at a given index will be visible within the
specified bounds. | ILayout | ||
getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>
Used internally by a component, such as List, to
determines which indices are visible with the specified view port
bounds and scroll position. | IVirtualLayout | ||
hasEventListener(type:String, listener:Function = null):Boolean
Checks if a listener has been added for the specified event type. | IFeathersEventDispatcher | ||
layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult
Positions (and possibly resizes) the supplied items within the
optional bounds argument. | ILayout | ||
measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point
Used internally by a component, such as List, to measure
the view port based on the typical item dimensions or cached
dimensions, if available. | IVirtualLayout | ||
removeEventListener(type:String, listener:Function):void
Removes a listener for an event type. | IFeathersEventDispatcher | ||
removeEventListeners(type:String = null):void
Removes all listeners for an event type. | IFeathersEventDispatcher | ||
removeFromVariableVirtualCacheAtIndex(index:int):void
Removes an item in to the cache at the specified index, moving the
values at following indexes down by one. | IVariableVirtualLayout | ||
resetVariableVirtualCache():void
Clears the cached dimensions for all virtualized indices. | IVariableVirtualLayout | ||
resetVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void
Clears the cached dimensions for one specific virtualized index. | IVariableVirtualLayout |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when the layout would like to adjust the container's scroll position. | IVariableVirtualLayout |
hasVariableItemDimensions | property |
hasVariableItemDimensions:Boolean
When the layout is virtualized, and this value is true, the items may have variable dimensions. If false, the items will all share the same dimensions as the typical item. Performance is better for layouts where all items have the same dimensions.
public function get hasVariableItemDimensions():Boolean
public function set hasVariableItemDimensions(value:Boolean):void
addToVariableVirtualCacheAtIndex | () | method |
public function addToVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void
Inserts an item in to the cache at the specified index, pushing the old cached value at that index, and all following values, up one index.
Parameters
index:int | |
item:DisplayObject (default = null )
|
removeFromVariableVirtualCacheAtIndex | () | method |
public function removeFromVariableVirtualCacheAtIndex(index:int):void
Removes an item in to the cache at the specified index, moving the values at following indexes down by one.
Parameters
index:int |
resetVariableVirtualCache | () | method |
public function resetVariableVirtualCache():void
Clears the cached dimensions for all virtualized indices.
resetVariableVirtualCacheAtIndex | () | method |
public function resetVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void
Clears the cached dimensions for one specific virtualized index.
Parameters
index:int | |
item:DisplayObject (default = null )
|
scroll | Event |
starling.events.Event
starling.events.Event.SCROLL
Dispatched when the layout would like to adjust the container's scroll position. Typically, this is used when the virtual dimensions of an item differ from its real dimensions. This event allows the container to adjust scrolling so that it appears smooth, without jarring jumps or shifts when an item resizes.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
data | A flash.geom.Point object
representing how much the scroll position should be adjusted in both
horizontal and vertical directions. Measured in pixels. |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |