Skip to content

Commit

Permalink
Add screen bounds test
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Jan 29, 2024
1 parent c7a6661 commit 91a92d3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/LVGL_Rotation/LVGL_Rotation.ino
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,23 @@ void setup(void)
// Register lvgl helper
beginLvglHelper(amoled);

lv_align_t align[] = {LV_ALIGN_TOP_LEFT,
LV_ALIGN_TOP_MID,
LV_ALIGN_TOP_RIGHT,
LV_ALIGN_BOTTOM_LEFT,
LV_ALIGN_BOTTOM_MID,
LV_ALIGN_BOTTOM_RIGHT,
LV_ALIGN_LEFT_MID,
LV_ALIGN_RIGHT_MID
};
for (int i = 0; i < sizeof(align) / sizeof(*align); ++i) {
lv_obj_t *btn = lv_btn_create(lv_scr_act());
lv_obj_t *label = lv_label_create(btn);
lv_label_set_text_fmt(label, "%d", i);
lv_obj_center(btn);
lv_obj_align(btn, align[i], 0, 0);
}


label1 = lv_label_create(lv_scr_act());
lv_label_set_long_mode(label1, LV_LABEL_LONG_WRAP); /*Break the long lines*/
Expand Down

0 comments on commit 91a92d3

Please sign in to comment.