1def anim_x_cb(obj, v): 2 obj.set_x(v) 3 4def anim_size_cb(obj, v): 5 obj.set_size(v, v) 6 7 8# 9# Create a playback animation 10# 11obj = lv.obj(lv.scr_act()) 12obj.set_style_bg_color(lv.palette_main(lv.PALETTE.RED), 0) 13obj.set_style_radius(lv.RADIUS.CIRCLE, 0) 14 15obj.align(lv.ALIGN.LEFT_MID, 10, 0) 16 17a1 = lv.anim_t() 18a1.init() 19a1.set_var(obj) 20a1.set_values(10, 50) 21a1.set_time(1000) 22a1.set_playback_delay(100) 23a1.set_playback_time(300) 24a1.set_repeat_delay(500) 25a1.set_repeat_count(lv.ANIM_REPEAT.INFINITE) 26a1.set_path_cb(lv.anim_t.path_ease_in_out) 27a1.set_custom_exec_cb(lambda a1,val: anim_size_cb(obj,val)) 28lv.anim_t.start(a1) 29 30a2 = lv.anim_t() 31a2.init() 32a2.set_var(obj) 33a2.set_values(10, 240) 34a2.set_time(1000) 35a2.set_playback_delay(100) 36a2.set_playback_time(300) 37a2.set_repeat_delay(500) 38a2.set_repeat_count(lv.ANIM_REPEAT.INFINITE) 39a2.set_path_cb(lv.anim_t.path_ease_in_out) 40a2.set_custom_exec_cb(lambda a1,val: anim_x_cb(obj,val)) 41lv.anim_t.start(a2) 42