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_5.py (987B)
1 def row_gap_anim(obj, v): 2 obj.set_style_pad_row(v, 0) 3 4 5 def column_gap_anim(obj, v): 6 obj.set_style_pad_column(v, 0) 7 8 # 9 # Demonstrate the effect of column and row gap style properties 10 # 11 12 cont = lv.obj(lv.scr_act()) 13 cont.set_size(300, 220) 14 cont.center() 15 cont.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) 16 17 for i in range(9): 18 obj = lv.obj(cont) 19 obj.set_size(70, lv.SIZE.CONTENT) 20 21 label = lv.label(obj) 22 label.set_text(str(i)) 23 label.center() 24 25 a_row = lv.anim_t() 26 a_row.init() 27 a_row.set_var(cont) 28 a_row.set_values(0, 10) 29 a_row.set_repeat_count(lv.ANIM_REPEAT.INFINITE) 30 31 a_row.set_time(500) 32 a_row.set_playback_time(500) 33 a_row.set_custom_exec_cb(lambda a,val: row_gap_anim(cont,val)) 34 lv.anim_t.start(a_row) 35 36 a_col = lv.anim_t() 37 a_col.init() 38 a_col.set_var(cont) 39 a_col.set_values(0, 10) 40 a_col.set_repeat_count(lv.ANIM_REPEAT.INFINITE) 41 42 a_col.set_time(3000) 43 a_col.set_playback_time(3000) 44 a_col.set_custom_exec_cb(lambda a,val: column_gap_anim(cont,val)) 45 46 lv.anim_t.start(a_col) 47