Description
Hello again,
I created a horizontal tileview consisting of objects, that fill each tile up. On one of these objects I created another tileview, but in the vertical direction. When I start the simulation, I can scroll through the horizontal tiles until I reach the tile with the vertical tileview. Then I can scroll in the horizontal direction, but I get trapped in the vertical tileview.
Is there a way I can address the horizontal scroll movement to the horizontal tileview when I’m inside the vertical tileview ?
What MCU/Processor/Board and compiler are you using?
VS2019-Simulator on Windows 10
What LVGL version are you using?
latest
What do you want to achieve?
Continue to scroll horizontally out of the vertical tileview.
What have you tried so far?
lv_obj_set_drag
lv_obj_set_drag_dir
lv_obj_set_drag_throw
lv_obj_set_drag_parent
lv_obj_set_parent_event
on both tileview (the vertical one) and it’s top tile.
Code to reproduce
//CREATE THE HORIZONTAL TILEVIEW
static lv_point_t valid_pos[] = { {0,0},{1,0},{2,0} }; //Horizontal
lv_obj_t * tileview = lv_tileview_create(lv_scr_act(), NULL);
lv_tileview_set_valid_positions(tileview, valid_pos, 3); //Horizontal
lv_obj_set_event_cb(tileview, my_event_cb);
lv_tileview_set_edge_flash(tileview, false);
lv_obj_t* tile1 = lv_obj_create(tileview, NULL); //Horizontal
lv_obj_set_size(tile1, LV_HOR_RES, LV_VER_RES);
lv_obj_set_style_local_bg_color(tile1, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_SILVER);
lv_tileview_add_element(tileview, tile1);
lv_obj_t* tile2 = lv_obj_create(tileview, NULL); //Horizontal
lv_obj_set_size(tile2, LV_HOR_RES, LV_VER_RES);
lv_obj_set_pos(tile2, LV_HOR_RES, 0);
lv_obj_set_style_local_bg_color(tile2, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_SILVER);
lv_obj_set_drag_parent(tile2, true);
lv_tileview_add_element(tileview, tile2);
lv_obj_t* tile3 = lv_obj_create(tileview, NULL); //Horizontal
lv_obj_set_size(tile3, LV_HOR_RES, LV_VER_RES);
lv_obj_set_pos(tile3, 2 * LV_HOR_RES, 0);
lv_obj_set_style_local_bg_color(tile3, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_SILVER);
lv_tileview_add_element(tileview, tile3);
//CREATE THE VERTICAL TILEVIEW
static lv_point_t valid_pos0[] = { {0,0},{0,1} }; //Vertikal
lv_obj_t* tileview0 = lv_tileview_create(tile1, NULL);
lv_obj_set_size(tileview0, LV_HOR_RES, LV_VER_RES);
lv_tileview_set_valid_positions(tileview0, valid_pos0, 2); //Vertikal
lv_tileview_set_edge_flash(tileview0, true);
lv_obj_t* tile10 = lv_obj_create(tileview0, NULL); //Vertikal
lv_obj_set_size(tile10, LV_HOR_RES, LV_VER_RES);
lv_obj_set_style_local_bg_color(tile10, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
lv_tileview_add_element(tileview0, tile10);
lv_obj_t* tile20 = lv_obj_create(tileview0, NULL); //Vertikal
lv_obj_set_size(tile20, LV_HOR_RES, LV_VER_RES);
lv_obj_set_pos(tile20, 0, LV_VER_RES);
lv_obj_set_style_local_bg_color(tile20, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_AQUA);
lv_tileview_add_element(tileview0, tile20);