Package | feathers.controls |
Class | public class Drawers |
Inheritance | Drawers FeathersControl starling.display.Sprite |
Product Version : | Feathers 1.2.0 |
Additionally, each drawer may be individually "docked" in an always-open state, making this a useful application-level layout container even if the drawers never need to be hidden. Docking behavior may be limited to either portrait or landscape, or a drawer may be docked in both orientations. By default, a drawer is not docked.
The following example creates an app with a slide out menu to the left of the main content:
var navigator:StackScreenNavigator = new StackScreenNavigator(); var list:List = new List(); // the navigator's screens, the list's data provider, and additional // properties should be set here. var drawers:Drawers = new Drawers(); drawers.content = navigator; drawers.leftDrawer = menu; drawers.leftDrawerToggleEventType = Event.OPEN; this.addChild( drawers );
In the example above, a screen in the StackScreenNavigator
component dispatches an event of type Event.OPEN
when it
wants to display the slide out the List
that is used as
the left drawer.
See also
Property | Defined By | ||
---|---|---|---|
addedEffect : Function
An optional effect that is activated when the component is added to
the stage. | FeathersControl | ||
autoSizeMode : String
Determines how the drawers container will set its own size when its
dimensions (width and height) aren't set explicitly. | Drawers | ||
bottomDrawer : IFeathersControl
The drawer that appears below the primary content. | Drawers | ||
bottomDrawerDockMode : String
Determines if the bottom drawer is docked in all, some, or no stage
orientations. | Drawers | ||
bottomDrawerToggleEventType : String
When this event is dispatched by the content event dispatcher, the
bottom drawer will toggle open and closed. | Drawers | ||
clipDrawers : Boolean
Determines if the drawers are clipped while opening or closing. | Drawers | ||
content : IFeathersControl
The primary content displayed in the center of the container. | Drawers | ||
contentEventDispatcherChangeEventType : String
The event dispatched by the content to indicate that the content
event dispatcher has changed. | Drawers | ||
contentEventDispatcherField : String
A property of the content that references an event
dispatcher that dispatches events to toggle drawers open and closed. | Drawers | ||
contentEventDispatcherFunction : Function
A function that returns an event dispatcher that dispatches events to
toggle drawers open and closed. | Drawers | ||
defaultTextEditorFactory : Function [static]
A function used by all UI controls that support text editor to
create an ITextEditor instance. | FeathersControl | ||
defaultTextRendererFactory : Function [static]
A function used by all UI controls that support text renderers to
create an ITextRenderer instance. | FeathersControl | ||
depth : int [read-only]
The component's depth in the display list, relative to the stage. | FeathersControl | ||
effectsSuspended : Boolean [read-only]
Indicates if effects have been suspended. | FeathersControl | ||
explicitHeight : Number [read-only]
The height value explicitly set by passing a value to the
height setter or by calling the setSize()
function. | FeathersControl | ||
explicitMaxHeight : Number [read-only]
The maximum height value explicitly set by passing a value to the
maxHeight setter. | FeathersControl | ||
explicitMaxWidth : Number [read-only]
The maximum width value explicitly set by passing a value to the
maxWidth setter. | FeathersControl | ||
explicitMinHeight : Number [read-only]
The minimum height value explicitly set by passing a value to the
minHeight setter. | FeathersControl | ||
explicitMinWidth : Number [read-only]
The minimum width value explicitly set by passing a value to the
minWidth setter. | FeathersControl | ||
explicitWidth : Number [read-only]
The width value explicitly set by passing a value to the
width setter or to the setSize() method. | FeathersControl | ||
focusInEffect : Function
An optional effect that is activated when the component receives
focus. | FeathersControl | ||
focusManager : IFocusManager
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
The current focus manager for this component. | FeathersControl | ||
focusOutEffect : Function
An optional effect that is activated when the component loses focus. | FeathersControl | ||
focusOwner : IFocusDisplayObject
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
Used for associating focusable display objects that are not direct
children with an "owner" focusable display object, such as pop-ups. | FeathersControl | ||
globalStyleProvider : IStyleProvider [static]
The default IStyleProvider for all Drawers
components. | Drawers | ||
height : Number [override]
The height of the component, in pixels. | FeathersControl | ||
hideEffect : Function
An optional effect that is activated when the component is hidden. | FeathersControl | ||
includeInLayout : Boolean
Determines if the ILayout should use this object or ignore it. | FeathersControl | ||
isBottomDrawerDocked : Boolean [read-only]
Indicates if the bottom drawer is currently docked. | Drawers | ||
isBottomDrawerOpen : Boolean
Indicates if the bottom drawer is currently open. | Drawers | ||
isCreated : Boolean [read-only]
Determines if the component has been initialized and validated for
the first time. | FeathersControl | ||
isEnabled : Boolean
Indicates whether the control is interactive or not. | FeathersControl | ||
isFocusEnabled : Boolean
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
Determines if this component can receive focus. | FeathersControl | ||
isInitialized : Boolean [read-only]
Determines if the component has been initialized yet. | FeathersControl | ||
isLeftDrawerDocked : Boolean [read-only]
Indicates if the left drawer is currently docked. | Drawers | ||
isLeftDrawerOpen : Boolean
Indicates if the left drawer is currently open. | Drawers | ||
isQuickHitAreaEnabled : Boolean
Similar to mouseChildren on the classic display list. | FeathersControl | ||
isRightDrawerDocked : Boolean [read-only]
Indicates if the right drawer is currently docked. | Drawers | ||
isRightDrawerOpen : Boolean
Indicates if the right drawer is currently open. | Drawers | ||
isShowingFocus : Boolean [read-only]
The implementation of this method is provided for convenience, but
it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
Indicates if the showFocus() method has been called on
the object when it has focus. | FeathersControl | ||
isTopDrawerDocked : Boolean [read-only]
Indicates if the top drawer is currently docked. | Drawers | ||
isTopDrawerOpen : Boolean
Indicates if the top drawer is currently open. | Drawers | ||
layoutData : ILayoutData
Extra parameters associated with this display object that will be
used by the layout algorithm. | FeathersControl | ||
leftDrawer : IFeathersControl
The drawer that appears below the primary content. | Drawers | ||
leftDrawerDockMode : String
Determines if the left drawer is docked in all, some, or no stage
orientations. | Drawers | ||
leftDrawerToggleEventType : String
When this event is dispatched by the content event dispatcher, the
left drawer will toggle open and closed. | Drawers | ||
maintainTouchFocus : Boolean [read-only]
The implementation of this method is provided for convenience, but
it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
If true, the display object should remain in focus,
even if something else is touched. | FeathersControl | ||
maxHeight : Number
The maximum recommended height to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | ||
maxWidth : Number
The maximum recommended width to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | ||
minHeight : Number
The minimum recommended height to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | ||
minimumDragDistance : Number
The minimum physical distance (in inches) that a touch must move
before a drag gesture begins. | Drawers | ||
minimumDrawerThrowVelocity : Number
The minimum physical velocity (in inches per second) that a touch
must move before the a drawern can be "thrown" to open or close it. | Drawers | ||
minTouchHeight : Number
If using isQuickHitAreaEnabled, and the hit area's
height is smaller than this value, it will be expanded. | FeathersControl | ||
minTouchWidth : Number
If using isQuickHitAreaEnabled, and the hit area's
width is smaller than this value, it will be expanded. | FeathersControl | ||
minWidth : Number
The minimum recommended width to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | ||
moveEffect : Function
An optional effect that is activated when the component is moved to
a new position. | FeathersControl | ||
nextDownFocus : IFocusDisplayObject
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
The next object that will receive focus when
Keyboard.DOWN is pressed at
KeyLocation.D_PAD and a focus manager is enabled. | FeathersControl | ||
nextLeftFocus : IFocusDisplayObject
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
The next object that will receive focus when
Keyboard.LEFT is pressed at
KeyLocation.D_PAD and a focus manager is enabled. | FeathersControl | ||
nextRightFocus : IFocusDisplayObject
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
The next object that will receive focus when
Keyboard.RIGHT is pressed at
KeyLocation.D_PAD and a focus manager is enabled. | FeathersControl | ||
nextTabFocus : IFocusDisplayObject
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
The next object that will receive focus when the tab key is pressed
when a focus manager is enabled. | FeathersControl | ||
nextUpFocus : IFocusDisplayObject
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
The next object that will receive focus when
Keyboard.UP is pressed at
KeyLocation.D_PAD and a focus manager is enabled. | FeathersControl | ||
openGesture : String
An optional touch gesture used to open a drawer. | Drawers | ||
openGestureEdgeSize : Number
The size (in inches) of the region near the edge of the content that
can be dragged when the openGesture property is set to
DragGesture.EDGE. | Drawers | ||
previousTabFocus : IFocusDisplayObject
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
The previous object that will receive focus when the tab key is
pressed while holding shift when a focus manager is enabled. | FeathersControl | ||
resizeEffect : Function
An optional effect that is activated when the component is resized
with new dimensions. | FeathersControl | ||
rightDrawer : IFeathersControl
The drawer that appears to the right of the primary content. | Drawers | ||
rightDrawerDockMode : String
Determines if the right drawer is docked in all, some, or no stage
orientations. | Drawers | ||
rightDrawerToggleEventType : String
When this event is dispatched by the content event dispatcher, the
right drawer will toggle open and closed. | Drawers | ||
showEffect : Function
An optional effect that is activated when the component is shown. | FeathersControl | ||
styleName : String
The concatenated styleNameList, with values separated
by spaces. | FeathersControl | ||
styleNameList : TokenList [read-only]
Contains a list of all "styles" assigned to this control. | FeathersControl | ||
styleProvider : IStyleProvider
When a component initializes, a style provider may be used to set
properties that affect the component's visual appearance. | FeathersControl | ||
toolTip : String
Text to display in a tool tip to when hovering over this component,
if the ToolTipManager is enabled. | FeathersControl | ||
topDrawer : IFeathersControl
The drawer that appears above the primary content. | Drawers | ||
topDrawerDockMode : String
Determines if the top drawer is docked in all, some, or no stage
orientations. | Drawers | ||
topDrawerToggleEventType : String
When this event is dispatched by the content event dispatcher, the
top drawer will toggle open and closed. | Drawers | ||
width : Number [override]
The width of the component, in pixels. | FeathersControl |
Property | Defined By | ||
---|---|---|---|
actualHeight : Number = 0
The final height value that should be used for layout. | FeathersControl | ||
actualMinHeight : Number = 0
The final minimum height value that should be used for layout. | FeathersControl | ||
actualMinWidth : Number = 0
The final minimum width value that should be used for layout. | FeathersControl | ||
actualWidth : Number = 0
The final width value that should be used for layout. | FeathersControl | ||
contentEventDispatcher : EventDispatcher
The event dispatcher that controls opening and closing drawers with
events. | Drawers | ||
defaultStyleProvider : IStyleProvider [read-only]
When the FeathersControl constructor is called, the
styleProvider property is set to this value. | FeathersControl |
Method | Defined By | ||
---|---|---|---|
Drawers(content:IFeathersControl = null)
Constructor. | Drawers | ||
getBounds(targetSpace:DisplayObject, resultRect:Rectangle = null):Rectangle [override]
Feathers components use an optimized getBounds()
implementation that may sometimes behave differently than regular
Starling display objects. | FeathersControl | ||
hideFocus():void
The implementation of this method is provided for convenience, but
it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
| FeathersControl | ||
initializeNow():void
If the component has not yet initialized, initializes immediately. | FeathersControl | ||
invalidate(flag:String):void
Call this function to tell the UI control that a redraw is pending. | FeathersControl | ||
isInvalid(flag:String = null):Boolean
Indicates whether the control is pending validation or not. | FeathersControl | ||
move(x:Number, y:Number):void
Sets both the x and the y positions of the control in a single
function call. | FeathersControl | ||
removeFromParentWithEffect(effect:Function, dispose:Boolean = false):void
Plays an effect before removing the component from its parent. | FeathersControl | ||
resetStyleProvider():void
Resets the styleProvider property to its default value,
which is usually the global style provider for the component. | FeathersControl | ||
resumeEffects():void
Indicates that effects should be re-activated after being suspended. | FeathersControl | ||
setSize(width:Number, height:Number):void
Sets both the width and the height of the control in a single
function call. | FeathersControl | ||
showFocus():void
The implementation of this method is provided for convenience, but
it cannot be used unless a subclass implements the
IFocusDisplayObject interface.
| FeathersControl | ||
suspendEffects():void
Indicates that effects should not be activated temporarily. | FeathersControl | ||
toggleBottomDrawer(duration:Number):void
Opens or closes the bottom drawer. | Drawers | ||
toggleLeftDrawer(duration:Number):void
Opens or closes the left drawer. | Drawers | ||
toggleRightDrawer(duration:Number):void
Opens or closes the right drawer. | Drawers | ||
toggleTopDrawer(duration:Number):void
Opens or closes the top drawer. | Drawers | ||
validate():void
Immediately validates the display object, if it is invalid. | FeathersControl |
Method | Defined By | ||
---|---|---|---|
autoSizeIfNeeded():Boolean
If the component's dimensions have not been set explicitly, it will
measure its content and determine an ideal size for itself. | Drawers | ||
clearInvalidationFlag(flag:String):void
Clears an invalidation flag. | FeathersControl | ||
contentToContentEventDispatcher():EventDispatcher
Uses the content event dispatcher fields and functions to generate a
content event dispatcher icon for the content. | Drawers | ||
draw():void
Override to customize layout and to adjust properties of children. | FeathersControl | ||
focusInHandler(event:Event):void
Default event handler for FeathersEventType.FOCUS_IN
that may be overridden in subclasses to perform additional actions
when the component receives focus. | FeathersControl | ||
focusOutHandler(event:Event):void
Default event handler for FeathersEventType.FOCUS_OUT
that may be overridden in subclasses to perform additional actions
when the component loses focus. | FeathersControl | ||
ignoreNextStyleRestriction():void
The next style that is set will not be restricted. | FeathersControl | ||
initialize():void
Called the first time that the UI control is added to the stage, and
you should override this function to customize the initialization
process. | FeathersControl | ||
layoutChildren():void
Positions and sizes the children. | Drawers | ||
processStyleRestriction(key:Object):Boolean
Used by setters for properties that are considered "styles" to
determine if the setter has been called directly on the component or
from a style provider. | FeathersControl | ||
refreshFocusIndicator():void
Updates the focus indicator skin by showing or hiding it and
adjusting its position and dimensions. | FeathersControl | ||
saveMeasurements(width:Number, height:Number, minWidth:Number = 0, minHeight:Number = 0):Boolean
Saves the dimensions and minimum dimensions calculated for the
component. | FeathersControl | ||
setInvalidationFlag(flag:String):void
Sets an invalidation flag. | FeathersControl | ||
setSizeInternal(width:Number, height:Number, canInvalidate:Boolean):Boolean
Sets the width and height of the control, with the option of
invalidating or not. | FeathersControl |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when the user starts dragging the content to open or close a drawer. | Drawers | |||
Dispatched when a drawer has completed closing. | Drawers | |||
Dispatched after the component has validated for the first time. | FeathersControl | |||
Dispatched when the user stops dragging the content to open or close a drawer. | Drawers | |||
Dispatched after initialize() has been called, but before the first time that draw() has been called. | FeathersControl | |||
Dispatched when a drawer has completed opening. | Drawers | |||
Dispatched when the width or height of the control changes. | FeathersControl |
Style | Defined By | ||
---|---|---|---|
bottomDrawerDivider : DisplayObject The divider between the bottom drawer and the content when the bottom drawer is docked. | Drawers | ||
focusIndicatorSkin : DisplayObject If this component supports focus, this optional skin will be displayed above the component when showFocus() is called. | FeathersControl | ||
focusPadding : Number Quickly sets all focus padding properties to the same value. | FeathersControl | ||
focusPaddingBottom : Number The minimum space, in pixels, between the object's bottom edge and the bottom edge of the focus indicator skin. | FeathersControl | ||
focusPaddingLeft : Number The minimum space, in pixels, between the object's left edge and the left edge of the focus indicator skin. | FeathersControl | ||
focusPaddingRight : Number The minimum space, in pixels, between the object's right edge and the right edge of the focus indicator skin. | FeathersControl | ||
focusPaddingTop : Number The minimum space, in pixels, between the object's top edge and the top edge of the focus indicator skin. | FeathersControl | ||
leftDrawerDivider : DisplayObject The divider between the left drawer and the content when the left drawer is docked. | Drawers | ||
openMode : String Determines whether the drawer opens above the content or below it. | Drawers | ||
openOrCloseDuration : Number The duration, in seconds, of the animation when a drawer opens or closes. | Drawers | ||
openOrCloseEase : Object The easing function used for opening or closing the drawers. | Drawers | ||
overlaySkin : DisplayObject An optional display object that appears above the content when a drawer is open. | Drawers | ||
rightDrawerDivider : DisplayObject The divider between the right drawer and the content when the right drawer is docked. | Drawers | ||
topDrawerDivider : DisplayObject The divider between the top drawer and the content when the top drawer is docked. | Drawers |
Constant | Defined By | ||
---|---|---|---|
SCREEN_NAVIGATOR_CONTENT_EVENT_DISPATCHER_FIELD : String = "activeScreen" [static]
The field used to access the "content event dispatcher" of a
ScreenNavigator component, which happens to be the
currently active screen. | Drawers |
autoSizeMode | property |
autoSizeMode:String
Determines how the drawers container will set its own size when its dimensions (width and height) aren't set explicitly.
In the following example, the drawers container will be sized to match its content:
drawers.autoSizeMode = AutoSizeMode.CONTENT;
The default value is feathers.controls.AutoSizeMode.STAGE
.
public function get autoSizeMode():String
public function set autoSizeMode(value:String):void
See also
bottomDrawer | property |
bottomDrawer:IFeathersControl
The drawer that appears below the primary content.
In the following example, a List
is added as the
bottom drawer:
var list:List = new List(); // set data provider and other properties here drawers.bottomDrawer = list;
The default value is null
.
public function get bottomDrawer():IFeathersControl
public function set bottomDrawer(value:IFeathersControl):void
See also
bottomDrawerDockMode | property |
bottomDrawerDockMode:String
Determines if the bottom drawer is docked in all, some, or no stage orientations. The current stage orientation is determined by calculating the aspect ratio of the stage.
In the following example, the bottom drawer is docked in the landscape stage orientation:
drawers.bottomDrawerDockMode = Orientation.LANDSCAPE;
The default value is feathers.layout.Orientation.NONE
.
public function get bottomDrawerDockMode():String
public function set bottomDrawerDockMode(value:String):void
See also
bottomDrawerToggleEventType | property |
bottomDrawerToggleEventType:String
When this event is dispatched by the content event dispatcher, the bottom drawer will toggle open and closed.
In the following example, the bottom drawer is toggled when the
content dispatches an event of type Event.OPEN
:
drawers.bottomDrawerToggleEventType = Event.OPEN;
The default value is null
.
public function get bottomDrawerToggleEventType():String
public function set bottomDrawerToggleEventType(value:String):void
See also
clipDrawers | property |
clipDrawers:Boolean
Determines if the drawers are clipped while opening or closing. If the content does not have a background, the drawers should generally be clipped so that the drawer does not show under the content. If the content has a fully opaque background that will conceal the drawers, then clipping may be disabled to potentially improve performance.
In the following example, clipping will be disabled:
navigator.clipDrawers = false;
The default value is true
.
public function get clipDrawers():Boolean
public function set clipDrawers(value:Boolean):void
See also
content | property |
content:IFeathersControl
The primary content displayed in the center of the container.
If the primary content is a container where you'd prefer to listen
to events from its children, you may need to use properties like
contentEventDispatcherField
, contentEventDispatcherFunction
,
and contentEventDispatcherChangeEventType
to ensure that
open and close events for drawers are correctly mapped to the correct
event dispatcher. If the content is dispatching the events, then those
properties should be set to null
.
In the following example, a StackScreenNavigator
is added
as the content:
var navigator:StackScreenNavigator = new StackScreenNavigator(); // additional code to add the screens can go here drawers.content = navigator;
The default value is null
.
public function get content():IFeathersControl
public function set content(value:IFeathersControl):void
See also
contentEventDispatcher | property |
protected var contentEventDispatcher:EventDispatcher
The event dispatcher that controls opening and closing drawers with
events. Often, the event dispatcher is the content itself, but you
may specify a contentEventDispatcherField
to access a
property of the content instead, or you may specify a
contentEventDispatcherFunction
to run some more complex
code to access the event dispatcher.
See also
contentEventDispatcherChangeEventType | property |
contentEventDispatcherChangeEventType:String
The event dispatched by the content to indicate that the content
event dispatcher has changed. When this event is dispatched by the
content, the drawers container will listen for the drawer toggle
events from the new dispatcher that discovered using
contentEventDispatcherField
or
contentEventDispatcherFunction
.
For StackScreenNavigator
and
ScreenNavigator
components, this value is automatically
set to Event.CHANGE
.
In the following example, the drawers container will update its
content event dispatcher when the content dispatches an event of type
Event.CHANGE
:
drawers.contentEventDispatcherChangeEventType = Event.CHANGE;
The default value is null
.
public function get contentEventDispatcherChangeEventType():String
public function set contentEventDispatcherChangeEventType(value:String):void
See also
contentEventDispatcherField | property |
contentEventDispatcherField:String
A property of the content
that references an event
dispatcher that dispatches events to toggle drawers open and closed.
For StackScreenNavigator
and
ScreenNavigator
components, this value is automatically
set to "activeScreen"
to listen for events from the
currently active/visible screen.
In the following example, the content event dispatcher field is customized:
drawers.contentEventDispatcherField = "selectedChild";
The default value is null
.
public function get contentEventDispatcherField():String
public function set contentEventDispatcherField(value:String):void
See also
contentEventDispatcherFunction | property |
contentEventDispatcherFunction:Function
A function that returns an event dispatcher that dispatches events to toggle drawers open and closed.
The function is expected to have the following signature:
function( content:DisplayObject ):EventDispatcher
In the following example, the content event dispatcher function is customized:
drawers.contentEventDispatcherField = function( content:CustomView ):void { return content.selectedChild; };
The default value is null
.
public function get contentEventDispatcherFunction():Function
public function set contentEventDispatcherFunction(value:Function):void
See also
globalStyleProvider | property |
public static var globalStyleProvider:IStyleProvider
The default IStyleProvider
for all Drawers
components.
The default value is null
.
See also
isBottomDrawerDocked | property |
isBottomDrawerDocked:Boolean
[read-only]
Indicates if the bottom drawer is currently docked. Docking behavior of
the bottom drawer is controlled with the bottomDrawerDockMode
property. To check if the bottom drawer is open, but not docked, use
the isBottomDrawerOpen
property.
public function get isBottomDrawerDocked():Boolean
See also
isBottomDrawerOpen | property |
isBottomDrawerOpen:Boolean
Indicates if the bottom drawer is currently open. If you want to check
if the bottom drawer is docked, check isBottomDrawerDocked
instead.
To animate the bottom drawer open or closed, call
toggleBottomDrawer()
. Setting isBottomDrawerOpen
will open or close the bottom drawer without animation.
In the following example, we check if the bottom drawer is open:
if( drawers.isBottomDrawerOpen ) { // do something }
The default value is false
.
public function get isBottomDrawerOpen():Boolean
public function set isBottomDrawerOpen(value:Boolean):void
See also
isLeftDrawerDocked | property |
isLeftDrawerDocked:Boolean
[read-only]
Indicates if the left drawer is currently docked. Docking behavior of
the left drawer is controlled with the leftDrawerDockMode
property. To check if the left drawer is open, but not docked, use
the isLeftDrawerOpen
property.
public function get isLeftDrawerDocked():Boolean
See also
isLeftDrawerOpen | property |
isLeftDrawerOpen:Boolean
Indicates if the left drawer is currently open. If you want to check
if the left drawer is docked, check isLeftDrawerDocked
instead.
To animate the left drawer open or closed, call
toggleLeftDrawer()
. Setting isLeftDrawerOpen
will open or close the left drawer without animation.
In the following example, we check if the left drawer is open:
if( drawers.isLeftDrawerOpen ) { // do something }
The default value is false
.
public function get isLeftDrawerOpen():Boolean
public function set isLeftDrawerOpen(value:Boolean):void
See also
isRightDrawerDocked | property |
isRightDrawerDocked:Boolean
[read-only]
Indicates if the right drawer is currently docked. Docking behavior of
the right drawer is controlled with the rightDrawerDockMode
property. To check if the right drawer is open, but not docked, use
the isRightDrawerOpen
property.
public function get isRightDrawerDocked():Boolean
See also
isRightDrawerOpen | property |
isRightDrawerOpen:Boolean
Indicates if the right drawer is currently open. If you want to check
if the right drawer is docked, check isRightDrawerDocked
instead.
To animate the right drawer open or closed, call
toggleRightDrawer()
. Setting isRightDrawerOpen
will open or close the right drawer without animation.
In the following example, we check if the right drawer is open:
if( drawers.isRightDrawerOpen ) { // do something }
The default value is false
.
public function get isRightDrawerOpen():Boolean
public function set isRightDrawerOpen(value:Boolean):void
See also
isTopDrawerDocked | property |
isTopDrawerDocked:Boolean
[read-only]
Indicates if the top drawer is currently docked. Docking behavior of
the top drawer is controlled with the topDrawerDockMode
property. To check if the top drawer is open, but not docked, use
the isTopDrawerOpen
property.
public function get isTopDrawerDocked():Boolean
See also
isTopDrawerOpen | property |
isTopDrawerOpen:Boolean
Indicates if the top drawer is currently open. If you want to check
if the top drawer is docked, check isTopDrawerDocked
instead.
To animate the top drawer open or closed, call
toggleTopDrawer()
. Setting isTopDrawerOpen
will open or close the top drawer without animation.
In the following example, we check if the top drawer is open:
if( drawers.isTopDrawerOpen ) { // do something }
The default value is false
.
public function get isTopDrawerOpen():Boolean
public function set isTopDrawerOpen(value:Boolean):void
See also
leftDrawer | property |
leftDrawer:IFeathersControl
The drawer that appears below the primary content.
In the following example, a List
is added as the
left drawer:
var list:List = new List(); // set data provider and other properties here drawers.leftDrawer = list;
The default value is null
.
public function get leftDrawer():IFeathersControl
public function set leftDrawer(value:IFeathersControl):void
See also
leftDrawerDockMode | property |
leftDrawerDockMode:String
Determines if the left drawer is docked in all, some, or no stage orientations. The current stage orientation is determined by calculating the aspect ratio of the stage.
In the following example, the left drawer is docked in the landscape stage orientation:
drawers.leftDrawerDockMode = Orientation.LANDSCAPE;
The default value is feathers.layout.Orientation.NONE
.
public function get leftDrawerDockMode():String
public function set leftDrawerDockMode(value:String):void
See also
leftDrawerToggleEventType | property |
leftDrawerToggleEventType:String
When this event is dispatched by the content event dispatcher, the left drawer will toggle open and closed.
In the following example, the left drawer is toggled when the
content dispatches and event of type Event.OPEN
:
drawers.leftDrawerToggleEventType = Event.OPEN;
The default value is null
.
public function get leftDrawerToggleEventType():String
public function set leftDrawerToggleEventType(value:String):void
See also
minimumDragDistance | property |
minimumDragDistance:Number
The minimum physical distance (in inches) that a touch must move before a drag gesture begins.
In the following example, the minimum drag distance is customized:
drawers.minimumDragDistance = 0.1;
The default value is 0.04
.
public function get minimumDragDistance():Number
public function set minimumDragDistance(value:Number):void
minimumDrawerThrowVelocity | property |
minimumDrawerThrowVelocity:Number
The minimum physical velocity (in inches per second) that a touch must move before the a drawern can be "thrown" to open or close it. Otherwise, it will settle open or closed based on which state is closer when the touch ends.
In the following example, the minimum drawer throw velocity is customized:
drawers.minimumDrawerThrowVelocity = 2;
The default value is 5
.
public function get minimumDrawerThrowVelocity():Number
public function set minimumDrawerThrowVelocity(value:Number):void
openGesture | property |
openGesture:String
An optional touch gesture used to open a drawer.
In the following example, the drawers are opened by dragging anywhere inside the content:
drawers.openGesture = DragGesture.CONTENT;
The default value is feathers.controls.DragGesture.EDGE
.
public function get openGesture():String
public function set openGesture(value:String):void
See also
openGestureEdgeSize | property |
openGestureEdgeSize:Number
The size (in inches) of the region near the edge of the content that
can be dragged when the openGesture
property is set to
DragGesture.EDGE
.
In the following example, the open gesture edge size is customized:
drawers.openGestureEdgeSize = 0.25;
The default value is 0.1
.
public function get openGestureEdgeSize():Number
public function set openGestureEdgeSize(value:Number):void
See also
rightDrawer | property |
rightDrawer:IFeathersControl
The drawer that appears to the right of the primary content.
In the following example, a List
is added as the
right drawer:
var list:List = new List(); // set data provider and other properties here drawers.rightDrawer = list;
The default value is null
.
public function get rightDrawer():IFeathersControl
public function set rightDrawer(value:IFeathersControl):void
See also
rightDrawerDockMode | property |
rightDrawerDockMode:String
Determines if the right drawer is docked in all, some, or no stage orientations. The current stage orientation is determined by calculating the aspect ratio of the stage.
In the following example, the right drawer is docked in the landscape stage orientation:
drawers.rightDrawerDockMode = Orientation.LANDSCAPE;
The default value is feathers.layout.Orientation.NONE
.
public function get rightDrawerDockMode():String
public function set rightDrawerDockMode(value:String):void
See also
rightDrawerToggleEventType | property |
rightDrawerToggleEventType:String
When this event is dispatched by the content event dispatcher, the right drawer will toggle open and closed.
In the following example, the right drawer is toggled when the
content dispatches an event of type Event.OPEN
:
drawers.rightDrawerToggleEventType = Event.OPEN;
The default value is null
.
public function get rightDrawerToggleEventType():String
public function set rightDrawerToggleEventType(value:String):void
See also
topDrawer | property |
topDrawer:IFeathersControl
The drawer that appears above the primary content.
In the following example, a List
is added as the
top drawer:
var list:List = new List(); // set data provider and other properties here drawers.topDrawer = list;
The default value is null
.
public function get topDrawer():IFeathersControl
public function set topDrawer(value:IFeathersControl):void
See also
topDrawerDockMode | property |
topDrawerDockMode:String
Determines if the top drawer is docked in all, some, or no stage orientations. The current stage orientation is determined by calculating the aspect ratio of the stage.
In the following example, the top drawer is docked in the landscape stage orientation:
drawers.topDrawerDockMode = Orientation.LANDSCAPE;
The default value is feathers.layout.Orientation.NONE
.
public function get topDrawerDockMode():String
public function set topDrawerDockMode(value:String):void
See also
topDrawerToggleEventType | property |
topDrawerToggleEventType:String
When this event is dispatched by the content event dispatcher, the top drawer will toggle open and closed.
In the following example, the top drawer is toggled when the
content dispatches an event of type Event.OPEN
:
drawers.topDrawerToggleEventType = Event.OPEN;
The default value is null
.
public function get topDrawerToggleEventType():String
public function set topDrawerToggleEventType(value:String):void
See also
Drawers | () | Constructor |
public function Drawers(content:IFeathersControl = null)
Constructor.
Parameterscontent:IFeathersControl (default = null )
|
autoSizeIfNeeded | () | method |
protected function autoSizeIfNeeded():Boolean
If the component's dimensions have not been set explicitly, it will
measure its content and determine an ideal size for itself. If the
explicitWidth
or explicitHeight
member
variables are set, those value will be used without additional
measurement. If one is set, but not the other, the dimension with the
explicit value will not be measured, but the other non-explicit
dimension will still need measurement.
Calls saveMeasurements()
to set up the
actualWidth
and actualHeight
member
variables used for layout.
Meant for internal use, and subclasses may override this function with a custom implementation.
ReturnsBoolean |
contentToContentEventDispatcher | () | method |
protected function contentToContentEventDispatcher():EventDispatcher
Uses the content event dispatcher fields and functions to generate a content event dispatcher icon for the content.
All of the content event dispatcher fields and functions, ordered by priority:
contentEventDispatcherFunction
contentEventDispatcherField
EventDispatcher |
See also
layoutChildren | () | method |
protected function layoutChildren():void
Positions and sizes the children.
toggleBottomDrawer | () | method |
public function toggleBottomDrawer(duration:Number):void
Opens or closes the bottom drawer. If the duration
argument
is NaN
, the default openOrCloseDuration
is
used. The default value of the duration
argument is
NaN
. Otherwise, this value is the duration of the
animation, in seconds.
To open or close the bottom drawer without animation, set the
isBottomDrawerOpen
property.
Parameters
duration:Number (default = NaN )
|
See also
toggleLeftDrawer | () | method |
public function toggleLeftDrawer(duration:Number):void
Opens or closes the left drawer. If the duration
argument
is NaN
, the default openOrCloseDuration
is
used. The default value of the duration
argument is
NaN
. Otherwise, this value is the duration of the
animation, in seconds.
To open or close the left drawer without animation, set the
isLeftDrawerOpen
property.
Parameters
duration:Number (default = NaN )
|
See also
toggleRightDrawer | () | method |
public function toggleRightDrawer(duration:Number):void
Opens or closes the right drawer. If the duration
argument
is NaN
, the default openOrCloseDuration
is
used. The default value of the duration
argument is
NaN
. Otherwise, this value is the duration of the
animation, in seconds.
To open or close the right drawer without animation, set the
isRightDrawerOpen
property.
Parameters
duration:Number (default = NaN )
|
See also
toggleTopDrawer | () | method |
public function toggleTopDrawer(duration:Number):void
Opens or closes the top drawer. If the duration
argument
is NaN
, the default openOrCloseDuration
is
used. The default value of the duration
argument is
NaN
. Otherwise, this value is the duration of the
animation, in seconds.
To open or close the top drawer without animation, set the
isTopDrawerOpen
property.
Parameters
duration:Number (default = NaN )
|
See also
beginInteraction | Event |
starling.events.Event
feathers.events.FeathersEventType.BEGIN_INTERACTION
Dispatched when the user starts dragging the content to open or close a drawer.
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 | null |
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. |
FeathersEventType.BEGIN_INTERACTION
event type is
used by many UI controls where a drag or other interaction happens
over time. An example is a Slider
control where the
user touches the thumb to begin dragging.
See also
close | Event |
starling.events.Event
starling.events.Event.CLOSE
Dispatched when a drawer has completed closing. The data
property of the event indicates which drawer was closed.
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 | The drawer that was closed. |
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. |
See also
endInteraction | Event |
starling.events.Event
feathers.events.FeathersEventType.END_INTERACTION
Dispatched when the user stops dragging the content to open or close a drawer. The drawer may continue opening or closing after this event is dispatched if the user interaction has also triggered an animation.
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 | null |
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. |
FeathersEventType.END_INTERACTION
event type is
used by many UI controls where a drag or other interaction happens
over time. An example is a Slider
control where the
user stops touching the thumb after dragging.
Depending on the control, the result of the interaction may
continue after the interaction ends. For instance, a Scroller
may be "thrown", and the scrolling will continue animating after the
user has finished interacting with it.
See also
open | Event |
starling.events.Event
starling.events.Event.OPEN
Dispatched when a drawer has completed opening. The data
property of the event indicates which drawer is open.
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 | The drawer that was opened. |
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. |
See also
topDrawerDivider | style |
topDrawerDivider:DisplayObject
The divider between the top drawer and the content when the top drawer is docked.
In the following example, a Quad
is added as the
top drawer divider:
var divider:Quad = new Quad( 2, 2, 0x999999 ); drawers.topDrawerDivider = quad; drawers.topDrawerDockMode = Orientation.BOTH
The default value is null
.
See also
rightDrawerDivider | style |
rightDrawerDivider:DisplayObject
The divider between the right drawer and the content when the right drawer is docked.
In the following example, a Quad
is added as the
right drawer divider:
var divider:Quad = new Quad( 2, 2, 0x999999 ); drawers.rightDrawerDivider = quad; drawers.rightDrawerDockMode = Orientation.BOTH
The default value is null
.
See also
overlaySkin | style |
overlaySkin:DisplayObject
An optional display object that appears above the content when a drawer is open.
In the following example, a Quad
is added as the
overlay skin:
var skin:Quad = new Quad( 10, 10, 0x000000 ); skin.alpha = 0.75; drawers.overlaySkin = skin;
The default value is null
.
openOrCloseEase | style |
openOrCloseEase:Object
The easing function used for opening or closing the drawers.
In the following example, the ease of the animation that opens and closes a drawer is customized:
drawers.openOrCloseEase = Transitions.EASE_IN_OUT;
The default value is starling.animation.Transitions.EASE_OUT
.
See also
openOrCloseDuration | style |
openOrCloseDuration:Number
The duration, in seconds, of the animation when a drawer opens or closes.
In the following example, the duration of the animation that opens or closes a drawer is set to 500 milliseconds:
drawers.openOrCloseDuration = 0.5;
The default value is 0.25
.
See also
openMode | style |
openMode:String
Determines whether the drawer opens above the content or below it.
In the following example, the drawers are opened above the content:
drawers.openMode = RelativeDepth.ABOVE;
The default value is feathers.layout.RelativeDepth#BELOW
.
See also
leftDrawerDivider | style |
leftDrawerDivider:DisplayObject
The divider between the left drawer and the content when the left drawer is docked.
In the following example, a Quad
is added as the
left drawer divider:
var divider:Quad = new Quad( 2, 2, 0x999999 ); drawers.leftDrawerDivider = quad; drawers.leftDrawerDockMode = Orientation.BOTH
The default value is null
.
See also
bottomDrawerDivider | style |
bottomDrawerDivider:DisplayObject
The divider between the bottom drawer and the content when the bottom drawer is docked.
In the following example, a Quad
is added as the
bottom drawer divider:
var divider:Quad = new Quad( 2, 2, 0x999999 ); drawers.bottomDrawerDivider = quad; drawers.bottomDrawerDockMode = Orientation.BOTH
The default value is null
.
See also
SCREEN_NAVIGATOR_CONTENT_EVENT_DISPATCHER_FIELD | Constant |
protected static const SCREEN_NAVIGATOR_CONTENT_EVENT_DISPATCHER_FIELD:String = "activeScreen"
The field used to access the "content event dispatcher" of a
ScreenNavigator
component, which happens to be the
currently active screen.
See also