diff --git a/samples/modules/lvgl/screen_transparency/prj.conf b/samples/modules/lvgl/screen_transparency/prj.conf index 7c857deba03f5b..20856b0155c946 100644 --- a/samples/modules/lvgl/screen_transparency/prj.conf +++ b/samples/modules/lvgl/screen_transparency/prj.conf @@ -4,6 +4,5 @@ CONFIG_LOG=y CONFIG_LVGL=y CONFIG_LV_Z_MEM_POOL_SIZE=16384 CONFIG_LV_COLOR_DEPTH_32=y -CONFIG_LV_COLOR_SCREEN_TRANSP=y CONFIG_DISPLAY=y diff --git a/samples/modules/lvgl/screen_transparency/src/main.c b/samples/modules/lvgl/screen_transparency/src/main.c index 64494ffdaed183..b0e6164fc8b967 100644 --- a/samples/modules/lvgl/screen_transparency/src/main.c +++ b/samples/modules/lvgl/screen_transparency/src/main.c @@ -21,14 +21,13 @@ static void initialize_gui(void) lv_obj_t *label; /* Configure screen and background for transparency */ - lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_TRANSP, LV_PART_MAIN); - lv_disp_set_bg_opa(NULL, LV_OPA_TRANSP); - lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x000000), LV_PART_MAIN); + lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_TRANSP, LV_PART_MAIN); + lv_obj_set_style_bg_opa(lv_layer_bottom(), LV_OPA_TRANSP, LV_PART_MAIN); /* Create a label, set its text and align it to the center */ - label = lv_label_create(lv_scr_act()); + label = lv_label_create(lv_screen_active()); lv_label_set_text(label, "Hello, world!"); - lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xff00ff), LV_PART_MAIN); + lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xff00ff), LV_PART_MAIN); lv_obj_align(label, LV_ALIGN_CENTER, 0, 0); } @@ -60,11 +59,11 @@ int main(void) initialize_gui(); - lv_task_handler(); + lv_timer_handler(); display_blanking_off(display_dev); while (1) { - uint32_t sleep_ms = lv_task_handler(); + uint32_t sleep_ms = lv_timer_handler(); k_msleep(MIN(sleep_ms, INT32_MAX)); }