Skip to content

ASpinnerV2#

Circular infinite progress indicator.

Header:#include <AUI/View/ASpinnerV2.h>
CMake:aui_link(my_target PUBLIC aui::views)

Detailed Description#

Rotates its contents as it renders. Unlike ASpinner, ASpinnerV2 allows to take more control over the animation - ASpinnerV2 draws at lower framerate which is better from perspective of resource usage. Generally, use ASpinnerV2 instead of ASpinner.

ASpinner's default style is a circular arc constantly and smoothly rotating around. ASpinnerV2's default style is a segmented circle which visually substains the "stepness" of the animation.

ASpinnerV2 is configured through ass :

1
2
3
4
5
6
7
{
    t<ASpinnerV2>(),
    BackgroundImage { ":uni/svg/spinner_v2.svg", 0x993c3c43_argb },
    Margin { 4_dp },
    FixedSize { 16_dp },
    ASpinnerV2::Configuration { .period = 1000ms, .steps = 8 },
},

Examples#

examples/ui/infinite_lazy_list/src/main.cpp

Infinite Lazy List - Usage of AUI_DECLARATIVE_FOR to make an infinite lazy list.

        };
    });

    return Vertical {
        AUI_DECLARATIVE_FOR(i, *state->items, AVerticalLayout) { return Label{} & i->value; },
        Centered {
          _new<ASpinnerV2>() AUI_LET {
                  AObject::connect(it->redrawn, AObject::GENERIC_OBSERVER, [state] {
                      // when a spinner appears, we indicate that we need more items.
                      state->needMore = true;

Public Types#

Configuration#


struct ASpinnerV2::Configuration

Empty structure.