Flex layouts - circular infinite scrolling

Hello!

I am using Flexbox(LV_FLEX_FLOW_ROW) behavior of objects inside the parent object.
For the test, I create two objects in a row. The timer periodically places one or another object in “focus”.
Objects move left ↔ right, depending on which object is currently visible

I want to adjust the behavior in such a way that the next object is always animated to the same side, regardless of whether it is the first or last element in the parent object, i.e. i want to achieve circular infinite scrolling.
I want to have the possibility of deleting/adding individual objects, without causing unwanted consequences when moving them.

Thanks in advance for your help

What MCU/Processor/Board and compiler are you using?

ESP32-C3, ESP-IDF v5.0

What LVGL version are you using?

v8.3.9

Simulation Code

static void TimerCB_Test(lv_timer_t* t);
lv_obj_t* cont_row;
#define NUM_OBJ     2

void lv_example_flex_1()
{
    cont_row = lv_obj_create(lv_scr_act());	
    lv_obj_set_style_border_width(cont_row, 2, LV_PART_MAIN);
    lv_obj_set_style_border_color(cont_row, lv_color_hex(0x54784AA), LV_PART_MAIN);
    lv_obj_set_style_outline_pad(cont_row, 0, LV_PART_MAIN);
    lv_obj_set_style_pad_all(cont_row, 0, LV_PART_MAIN);

    lv_obj_center(cont_row);
    lv_obj_set_size(cont_row, 95, 180); 
    lv_obj_set_scroll_snap_x(cont_row, LV_SCROLL_SNAP_CENTER);
    lv_obj_set_flex_flow(cont_row, LV_FLEX_FLOW_ROW);
    lv_obj_add_flag(cont_row, LV_OBJ_FLAG_SCROLL_ONE);

    static lv_style_t style_hiden;
    lv_style_init(&style_hiden);
    lv_style_set_bg_opa(&style_hiden, 0);
    lv_obj_add_style(cont_row, &style_hiden, LV_PART_SCROLLBAR);
    lv_obj_add_style(cont_row, &style_hiden, LV_STATE_SCROLLED | LV_PART_SCROLLBAR);
    lv_obj_set_scroll_snap_y(cont_row, LV_SCROLL_SNAP_CENTER);

    uint32_t i;

    lv_obj_t* obj;
    for (i = 0; i < NUM_OBJ; i++)
    {
        obj = lv_obj_create(cont_row);
        lv_obj_set_size(obj, 95, 176);
        lv_obj_add_flag(obj, LV_OBJ_FLAG_SNAPPABLE);
        lv_obj_set_style_border_width(obj, 2, LV_PART_MAIN);
        lv_obj_set_style_border_color(obj, lv_color_hex(0x147CDAD), LV_PART_MAIN);
        lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
        lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
        lv_obj_t* label = lv_label_create(obj);
        lv_label_set_text_fmt(label, "Object: %"LV_PRIu32, i);
        lv_obj_center(label);
        lv_obj_center(obj);
    }
    lv_timer_create(TimerCB_Test, 3000, NULL);
}

static void TimerCB_Test(lv_timer_t* t)
{
    volatile static int j = 1;
    lv_obj_t* child = lv_obj_get_child(cont_row, j);
    lv_obj_scroll_to_view(child, LV_ANIM_ON);

    if (j == 0)
        j = 1;
    else
        j = 0;
}

Screenshot and/or video

Video