FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ConnectedAnimationService

    struct · ferroui-controls · v0.5.0

    struct ConnectedAnimationService
    

    Coordinates connected animations across views. Each TopLevel window has its own independent instance so animations cannot bleed across windows.

    Typical usage:

    1. On the source view, call prepare_to_animate to capture the element.
    2. Navigate to the destination view.
    3. On the destination view, call get_animation then try_start on the returned animation to run the animation.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<ConnectedAnimationService>
    

    Returns a strong reference to this object.

    Source

    get_for_top_level

    fn get_for_top_level(top_level: &TopLevel) -> Ref<ConnectedAnimationService>
    

    Gets the ConnectedAnimationService for the specified top_level. Each top-level window has its own isolated instance.

    Source

    get_for_current_view

    fn get_for_current_view() -> Ref<ConnectedAnimationService>
    

    GetForCurrentView: the service of the thread. Animations prepared with it can fly in any window of the thread (each flight uses the window of its elements).

    Source

    default_duration

    fn default_duration(self: &Self) -> Duration
    

    Gets the default duration applied to all animations whose configuration does not specify one. Defaults to 300 ms.

    Source

    set_default_duration

    fn set_default_duration(self: &Self, value: Duration)
    

    Sets the default duration applied to all animations whose configuration does not specify one.

    Source

    default_easing_function

    fn default_easing_function(self: &Self) -> Option<Easing>
    

    Gets the default easing function applied when the active ConnectedAnimationConfiguration does not specify one. When None a configuration-specific default is used.

    Source

    set_default_easing_function

    fn set_default_easing_function(self: &Self, value: Option<Easing>)
    

    Sets the default easing function.

    Source

    prepare_to_animate

    fn prepare_to_animate(self: &Self, key: &str, source: &Visual) -> Rc<ConnectedAnimation>
    

    Captures source and registers a pending animation under key. Call this on the source view before navigating away.

    key is the unique string that pairs this call with the matching get_animation call on the destination view; source is the element to animate from. Returns the prepared ConnectedAnimation.

    Panics

    Panics if key is empty.

    Source

    get_animation

    fn get_animation(self: &Self, key: &str) -> Option<Rc<ConnectedAnimation>>
    

    Retrieves a pending animation registered under key. Returns None if no animation exists or if it has already been consumed. Call this on the destination view after navigating, then call try_start on the returned animation.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.