Skip to content

Incorrect repetition handling #49

@llMBQll

Description

@llMBQll

Normally, when an animated widget is rendered, it does not require continuous updates. The animation will be advanced internally until the widget duration expires or the animation finishes (depending on repeats property of the layout).

This, however does not work if the animated layout is the lat defined layout. In the below example the when MY_EVENT.Trigger is received, the layout will be rendered once and the animation will ONLY be advanced when new MY_EVENT.Trigger events are received.

SCREEN_BUILDER
    :new('Emulator')
    :with_layout_group({
        {
            layout = my_animated_layout,
            run_on = { 'MY_EVENT.Trigger' },
        },
    })
    :register()

If you have an animated layout that is defined last, the temporary workaround can be to add a dummy entry that can never be triggered.

SCREEN_BUILDER
    :new('Emulator')
    :with_layout_group({
        {
            layout = my_animated_layout,
            run_on = { 'MY_EVENT.Trigger' },
        },
+       {
+           layout = function() end,
+           run_on = { },
+       },
    })
    :register()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions