class Collapsible
package feathers.controls
extends FeathersControl › MeasureSprite › ValidatingSprite
implements IOpenCloseToggle
A container that displays primary content
that may be collapsed and
expanded by clicking or tapping a header
.
Events:
openfl.events.Event.OPEN | Dispatched when the content has completely opened. |
---|---|
openfl.events.Event.CLOSE | Dispatched when the content has completely closed. |
openfl.events.Event.CANCEL | Dispatched when an open or close action is cancelled before completing. |
feathers.events.FeathersEvent.OPENING | Dispatched when the content starts opening. This event may be cancelled. |
feathers.events.FeathersEvent.CLOSING | Dispatched when the content starts closing. This event may be cancelled. |
1.3.0
.See also:
Static variables
staticfinalread onlyCHILD_VARIANT_HEADER:String = "collapsible_header"
The variant used to style the header child component in a theme.
To override this default variant, set the
Collapsible.customHeaderVariant
property.
1.3.0
.See also:
Constructor
new(?text:String, ?content:DisplayObject)
Creates a new Collapsible
object with the given arguments.
1.3.0
.Variables
animateContentAlpha:Bool
Optionally fades the alpha
value of the content when opening and
closing.
In the following example, the alpha value fades on open and close:
collapsible.animateContentAlpha = true;
1.3.0
.animateOpenedProperty:Bool
Indicates if setting the opened
property causes the drawer to animate
open and closed, or if it causes the drawer to open and close instantly.
1.3.0
.See also:
customHeaderVariant:String
A custom variant to set on the header, instead of
Collapsible.CHILD_VARIANT_HEADER
.
The customHeaderVariant
will be not be used if the result of
headerFactory
already has a variant set.
1.3.0
.See also:
headerFactory:AbstractDisplayObjectFactory<Dynamic, DisplayObject>
Creates the header input, which must be of type
openfl.display.DisplayObject
.
In the following example, a custom header factory is provided:
collapsible.headerFactory = () ->
{
return new ToggleButton();
};
1.3.0
.openCloseDuration:Float
The duration, measured in seconds, of the animation when the content opens and closes.
In the following example, the duration of the animation that toggles the thumb is set to 500 milliseconds:
collapsible.openCloseDuration = 0.5;
1.3.0
.See also:
openCloseEase:IEasing = Quart.easeOut
The easing function to use when animating open or closed.
1.3.0
.See also:
text:String
The text to display in the header.
The header must implement ITextControl
to display text. The default
header is a ToggleButton
, which can display text.
The following example sets the header's text:
collapsible.text = "Header Text";
1.3.0
.Methods
closeContent(animate:Bool = true):Void
Closes the content, if it is currently open.
1.3.0
.openContent(animate:Bool = true):Void
Opens the content, if it is currently closed.
1.3.0
.