diff --git a/samples/display/lvgl/README.rst b/samples/display/lvgl/README.rst index 3ceb0df94392c3..adbd3af52e63cc 100644 --- a/samples/display/lvgl/README.rst +++ b/samples/display/lvgl/README.rst @@ -7,7 +7,10 @@ Overview ******** This sample application displays "Hello World" in the center of the screen -and a counter at the bottom which increments every second. +and a counter at the bottom which increments every second. If an input driver +is supported, such as the touch panel controller on mimxrt10{50,60,64}_evk +boards, "Hello World" is enclosed in a button that changes to the toggled state +when touched. Requirements ************ diff --git a/samples/display/lvgl/prj.conf b/samples/display/lvgl/prj.conf index 64efb35cb77b59..fb4814a9af2a67 100644 --- a/samples/display/lvgl/prj.conf +++ b/samples/display/lvgl/prj.conf @@ -7,3 +7,5 @@ CONFIG_LOG=y CONFIG_LVGL=y CONFIG_LVGL_OBJ_LABEL=y +CONFIG_LVGL_OBJ_CONTAINER=y +CONFIG_LVGL_OBJ_BUTTON=y diff --git a/samples/display/lvgl/src/main.c b/samples/display/lvgl/src/main.c index ebe89eb7726687..1231456973b41a 100644 --- a/samples/display/lvgl/src/main.c +++ b/samples/display/lvgl/src/main.c @@ -30,7 +30,17 @@ void main(void) return; } - hello_world_label = lv_label_create(lv_scr_act(), NULL); + if (IS_ENABLED(CONFIG_LVGL_POINTER_KSCAN)) { + lv_obj_t *hello_world_button; + + hello_world_button = lv_btn_create(lv_scr_act(), NULL); + lv_obj_align(hello_world_button, NULL, LV_ALIGN_CENTER, 0, 0); + lv_btn_set_fit(hello_world_button, LV_FIT_TIGHT); + hello_world_label = lv_label_create(hello_world_button, NULL); + } else { + hello_world_label = lv_label_create(lv_scr_act(), NULL); + } + lv_label_set_text(hello_world_label, "Hello world!"); lv_obj_align(hello_world_label, NULL, LV_ALIGN_CENTER, 0, 0);