Description
Hello, I am facing some difficulty when i am trying to navigate some screens, suppose we have some mode to be set in out device and only one screen to show the parameters which is common for all modes, can we implement any kind of logic to use the same screen with all type of modes, the issue right now is if i give a DIR_LEFT event in the screen to navigate to one screen, and in a separate if statement if i give another DIR_LEFT navigation to a different screen from the same screen, it navigates only to the latest screen.
What MCU/Processor/Board and compiler are you using?
I am using Sensecap indicator D1s, specifically the ESP32-S3
What LVGL version are you using?
LVGL version 8.3
What do you want to achieve?
To know what kind of logic can be applied other than creating a duplicate screen with a different name.
What have you tried so far?
Tried some if statements, and if else statements, but in my code the if else statement is not working,
Code Snippet
void ui_event_screen_sensor(lv_event_t * e) {
lv_event_code_t event_code = lv_event_get_code(e);
// lv_obj_t *target = lv_event_get_target(e);
// lv_obj_t * cur_screen = lv_scr_act();
lv_indev_wait_release(lv_indev_get_act());
if (event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_LEFT)
{
if (ui_screen_last == ui_ScreenMain);
{
_ui_screen_change(ui_Screen1, LV_SCR_LOAD_ANIM_MOVE_LEFT, 100, 0);
}
if (ui_screen_last == ui_ScreenMain);
{
_ui_screen_change(ui_Screen2, LV_SCR_LOAD_ANIM_MOVE_LEFT, 10000, 0);
}
}
}