TransitionManager¶
- component fbx.ui.controller.TransitionManager¶
TransitionManager is an utility component able to animate transition between two items.
Transition manager handles multiple effect types:
"slideUp"
,"slideDown"
,"slideLeft"
, or"slideRight"
slide an item that pushes the other out, either upwards, downwards, leftwards or rightwards;
"circleLeft"
, or"circleRight"
slide and rotate objects like in a carousel;
"fade"
fade from one item to the other;
"scaleDown"
or"scaleUp"
scale from one item to the other, making a zoom in/out effect;
"appear"
simply make the new item appear.
TransitionManager instance defines the visual space taken by animated items.
Note
See “test/transitionmanager.qml” for an example of this component in action.
- property duration¶
Time (in milliseconds) taken to animate the transition between former and future items.
- property baseUrl¶
Base URL to use when relative URLs are passed to
switchToUrl()
.
- method switchToItem(item, animation)¶
- Parameters
item (
Item
) – Item to animate toanimation (
string
) – Animation name
- Returns
An UID assigned to this item
This animates from currently displayed item to the one passed. Passed item must already exist. It will be reparented to the transitionmanager or its children.
- method switchToComponent(component, args, animation)¶
- Parameters
component (
object
) – Component to create object from and animate toargs (
object
) – Component initial propertiesanimation (
string
) – Animation name
- Returns
This animates from currently displayed item to an iten that will be created from passed component.
When component is instanciated, passed args are set as initial properties of the new item. Deletion of item will be automatic.
Deferred may fail if component cannot be instanciated, or if animation cannot be run. It successes when switch is over.
- method switchToUrl(url, args, animation)¶
- Parameters
url (
string
) – Component URL to create object from and animate to. Absolute or relative tobaseUrl
.args (
object
) – Component initial propertiesanimation (
string
) – Animation name
- Returns
This animates from currently displayed item to an iten that will be created from passed component URL.
When component is instanciated, passed args are set as initial properties of the new item. Deletion of item will be automatic.
Deferred may fail if URL cannot be loaded, component cannot be instanciated, or if animation cannot be run. It successes when switch is over.
- signal didSwitchItems()¶
If item was supplied to transition manager through
switchToItem()
, user may reparent the item to somewhere else in the widget hierarchy, or destroy it. Item is available inpreviousItem
.
- signal willSwitchItems()¶
Item will soon be reparented to transition manager. User should not edit its visual properties from now on.
- property previousItem¶
Item that is being dismissed. This property is only available while didSwitchItems is called.
- property currentItem¶
Item that is currently being displayed by the transition manager.
- property nextItem¶
Item that is going to be displayed. This property is only available while willSwitchItems is called.