Skip to main content

sample_circular_progress

Function sample_circular_progress 

Source
pub fn sample_circular_progress(
    id: impl Into<ElementId>,
    visible: bool,
    window: &mut Window,
    cx: &mut App,
) -> CircularProgressFrame
Expand description

Sample independently of painting so a hidden indicator keeps its phase.

Keep calling this after first showing the indicator, including while hidden. The reference polls reduced motion in its frame callback: a running loop draws one last frame then stops. Changing back does not restart it. A new ID starts a fresh playback, as explicitly restarting the reference’s indicator does.

visible states whether the caller paints the returned frame. Only a visible, running sample requests the next animation frame; a hidden sample advances and observes reduced motion without keeping the window out of idle.