1# 2# Example of styling the bar 3# 4style_bg = lv.style_t() 5style_indic = lv.style_t() 6 7style_bg.init() 8style_bg.set_border_color(lv.palette_main(lv.PALETTE.BLUE)) 9style_bg.set_border_width(2) 10style_bg.set_pad_all(6) # To make the indicator smaller 11style_bg.set_radius(6) 12style_bg.set_anim_time(1000) 13 14style_indic.init() 15style_indic.set_bg_opa(lv.OPA.COVER) 16style_indic.set_bg_color(lv.palette_main(lv.PALETTE.BLUE)) 17style_indic.set_radius(3) 18 19bar = lv.bar(lv.scr_act()) 20bar.remove_style_all() # To have a clean start 21bar.add_style(style_bg, 0) 22bar.add_style(style_indic, lv.PART.INDICATOR) 23 24bar.set_size(200, 20) 25bar.center() 26bar.set_value(100, lv.ANIM.ON) 27 28