acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

lv_example_flex_6.c (738B)

      1 #include "../../lv_examples.h"
      2 #if LV_USE_FLEX && LV_BUILD_EXAMPLES
      3 
      4 /**
      5  * RTL base direction changes order of the items.
      6  * Also demonstrate how horizontal scrolling works with RTL.
      7  */
      8 void lv_example_flex_6(void)
      9 {
     10     lv_obj_t * cont = lv_obj_create(lv_scr_act());
     11     lv_obj_set_style_base_dir(cont, LV_BASE_DIR_RTL, 0);
     12     lv_obj_set_size(cont, 300, 220);
     13     lv_obj_center(cont);
     14     lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW_WRAP);
     15 
     16     uint32_t i;
     17     for(i = 0; i < 20; i++) {
     18         lv_obj_t * obj = lv_obj_create(cont);
     19         lv_obj_set_size(obj, 70, LV_SIZE_CONTENT);
     20 
     21         lv_obj_t * label = lv_label_create(obj);
     22         lv_label_set_text_fmt(label, "%"LV_PRIu32, i);
     23         lv_obj_center(label);
     24     }
     25 }
     26 #endif