# This file was generated by SquareLine Studio # SquareLine Studio version: SquareLine Studio 1.5.0 # LVGL version: 9.1.0 # Project name: Smart_Gadget import lvgl as lv import ui_images dispp = lv.display_get_default() theme = lv.theme_simple_init(dispp) dispp.set_theme(theme) # font_Number = lv.binfont_create("A:ui_font_Number.bin") font_Number = lv.font_montserrat_18 def ui_theme_set(idx): return def SetFlag( obj, flag, value): if (value): obj.add_flag(flag) else: obj.remove_flag(flag) return _ui_comp_table = {} _ui_comp_prev = None _ui_name_prev = None _ui_child_prev = None _ui_comp_table.clear() def _ui_comp_del_event(e): target = e.get_target() _ui_comp_table[id(target)].remove() def ui_comp_get_child(comp, child_name): return _ui_comp_table[id(comp)][child_name] def ui_comp_get_root_from_child(child, compname): for component in _ui_comp_table: if _ui_comp_table[component]["_CompName"]==compname: for part in _ui_comp_table[component]: if id(_ui_comp_table[component][part]) == id(child): return _ui_comp_table[component] return None def SetBarProperty(target, id, val): if id == 'Value_with_anim': target.set_value(val, lv.ANIM.ON) if id == 'Value': target.set_value(val, lv.ANIM.OFF) return def SetPanelProperty(target, id, val): if id == 'Position_X': target.set_x(val) if id == 'Position_Y': target.set_y(val) if id == 'Width': target.set_width(val) if id == 'Height': target.set_height(val) return def SetDropdownProperty(target, id, val): if id == 'Selected': target.set_selected(val) return def SetImageProperty(target, id, val, val2): if id == 'Image': target.set_src(val) if id == 'Angle': target.set_rotation(val2) if id == 'Zoom': target.set_scale(val2) return def SetLabelProperty(target, id, val): if id == 'Text': target.set_text(val) return def SetRollerProperty(target, id, val): if id == 'Selected': target.set_selected(val, lv.ANIM.OFF) if id == 'Selected_with_anim': target.set_selected(val, lv.ANIM.ON) return def SetSliderProperty(target, id, val): if id == 'Value_with_anim': target.set_value(val, lv.ANIM.ON) if id == 'Value': target.set_value(val, lv.ANIM.OFF) return def ChangeScreen( src, fademode, speed, delay): print("Change screen to: "+str([name for name in globals() if globals()[name] is src])) lv.screen_load_anim(src, fademode, speed, delay, False) return def DeleteScreen(src): return def IncrementArc( trg, val): trg.set_value(trg.get_value()+val) trg.send_event(lv.EVENT.VALUE_CHANGED, None) return def IncrementBar( trg, val, anim): trg.set_value(trg.get_value()+val,anim) return def IncrementSlider( trg, val, anim): trg.set_value(trg.get_value()+val,anim) trg.send_event(lv.EVENT.VALUE_CHANGED, None) return def KeyboardSetTarget( keyboard, textarea): keyboard.set_textarea(textarea) return def ModifyFlag( obj, flag, value): if (value=="TOGGLE"): if ( obj.has_flag(flag) ): obj.remove_flag(flag) else: obj.add_flag(flag) return if (value=="ADD"): obj.add_flag(flag) else: obj.remove_flag(flag) return def ModifyState( obj, state, value): if (value=="TOGGLE"): if ( obj.has_state(state) ): obj.remove_state(state) else: obj.add_state(state) return if (value=="ADD"): obj.add_state(state) else: obj.remove_state(state) return def TextAreaMoveCursor( trg, val): if val=="UP" : trg.cursor_up() if val=="RIGHT" : trg.cursor_right() if val=="DOWN" : trg.cursor_down() if val=="LEFT" : trg.cursor_left() trg.add_state(lv.STATE.FOCUSED) return def set_opacity(obj, v): obj.set_style_opa(v, lv.STATE.DEFAULT|lv.PART.MAIN) return def SetTextValueArc( trg, src, prefix, postfix): trg.set_text(prefix+str(src.get_value())+postfix) return def SetTextValueSlider( trg, src, prefix, postfix): trg.set_text(prefix+str(src.get_value())+postfix) return def SetTextValueChecked( trg, src, txton, txtoff): if src.has_state(lv.STATE.CHECKED): trg.set_text(txton) else: trg.set_text(txtoff) return def StepSpinbox( trg, val): if val==1 : trg.increment() if val==-1 : trg.decrement() trg.send_event(lv.EVENT.VALUE_CHANGED, None) return def SwitchTheme(val): ui_theme_set(val) return def upanim_Animation(TargetObject, delay): PropertyAnimation_0 = lv.anim_t() PropertyAnimation_0.init() PropertyAnimation_0.set_path_cb(lv.anim_t.path_ease_out) PropertyAnimation_0.set_time(200) PropertyAnimation_0.set_var(TargetObject) PropertyAnimation_0.set_custom_exec_cb(lambda a, v: TargetObject.set_y(v)) PropertyAnimation_0.set_delay(delay + 0) PropertyAnimation_0.set_repeat_count(0) PropertyAnimation_0.set_repeat_delay(0) #+ 200 PropertyAnimation_0.set_playback_delay(0) PropertyAnimation_0.set_playback_time(0) PropertyAnimation_0.set_early_apply(False) PropertyAnimation_0.set_values(-30, 0) PropertyAnimation_0.set_get_value_cb(lambda a: TargetObject.get_y_aligned()) lv.anim_t.start(PropertyAnimation_0) PropertyAnimation_1 = lv.anim_t() PropertyAnimation_1.init() PropertyAnimation_1.set_path_cb(lv.anim_t.path_linear) PropertyAnimation_1.set_time(100) PropertyAnimation_1.set_var(TargetObject) PropertyAnimation_1.set_custom_exec_cb(lambda a, v: TargetObject.set_style_opa(v,0)) PropertyAnimation_1.set_delay(delay + 0) PropertyAnimation_1.set_repeat_count(0) PropertyAnimation_1.set_repeat_delay(0) #+ 200 PropertyAnimation_1.set_playback_delay(0) PropertyAnimation_1.set_playback_time(0) PropertyAnimation_1.set_early_apply(True) PropertyAnimation_1.set_values(0, 255) lv.anim_t.start(PropertyAnimation_1) print ("upanim_Animation called") return def hour_Animation(TargetObject, delay): PropertyAnimation_0 = lv.anim_t() PropertyAnimation_0.init() PropertyAnimation_0.set_path_cb(lv.anim_t.path_ease_out) PropertyAnimation_0.set_time(1000) PropertyAnimation_0.set_var(TargetObject) PropertyAnimation_0.set_custom_exec_cb(lambda a, v: TargetObject.set_rotation(v)) PropertyAnimation_0.set_delay(delay + 0) PropertyAnimation_0.set_repeat_count(0) PropertyAnimation_0.set_repeat_delay(0) #+ 1000 PropertyAnimation_0.set_playback_delay(0) PropertyAnimation_0.set_playback_time(0) PropertyAnimation_0.set_early_apply(False) PropertyAnimation_0.set_values(0, 2800) lv.anim_t.start(PropertyAnimation_0) PropertyAnimation_1 = lv.anim_t() PropertyAnimation_1.init() PropertyAnimation_1.set_path_cb(lv.anim_t.path_linear) PropertyAnimation_1.set_time(300) PropertyAnimation_1.set_var(TargetObject) PropertyAnimation_1.set_custom_exec_cb(lambda a, v: TargetObject.set_style_opa(v,0)) PropertyAnimation_1.set_delay(delay + 0) PropertyAnimation_1.set_repeat_count(0) PropertyAnimation_1.set_repeat_delay(0) #+ 1000 PropertyAnimation_1.set_playback_delay(0) PropertyAnimation_1.set_playback_time(0) PropertyAnimation_1.set_early_apply(True) PropertyAnimation_1.set_values(0, 255) lv.anim_t.start(PropertyAnimation_1) print ("hour_Animation called") return def min_Animation(TargetObject, delay): PropertyAnimation_0 = lv.anim_t() PropertyAnimation_0.init() PropertyAnimation_0.set_path_cb(lv.anim_t.path_ease_out) PropertyAnimation_0.set_time(1000) PropertyAnimation_0.set_var(TargetObject) PropertyAnimation_0.set_custom_exec_cb(lambda a, v: TargetObject.set_rotation(v)) PropertyAnimation_0.set_delay(delay + 0) PropertyAnimation_0.set_repeat_count(0) PropertyAnimation_0.set_repeat_delay(0) #+ 1000 PropertyAnimation_0.set_playback_delay(0) PropertyAnimation_0.set_playback_time(0) PropertyAnimation_0.set_early_apply(False) PropertyAnimation_0.set_values(0, 2100) lv.anim_t.start(PropertyAnimation_0) PropertyAnimation_1 = lv.anim_t() PropertyAnimation_1.init() PropertyAnimation_1.set_path_cb(lv.anim_t.path_linear) PropertyAnimation_1.set_time(200) PropertyAnimation_1.set_var(TargetObject) PropertyAnimation_1.set_custom_exec_cb(lambda a, v: TargetObject.set_style_opa(v,0)) PropertyAnimation_1.set_delay(delay + 0) PropertyAnimation_1.set_repeat_count(0) PropertyAnimation_1.set_repeat_delay(0) #+ 1000 PropertyAnimation_1.set_playback_delay(0) PropertyAnimation_1.set_playback_time(0) PropertyAnimation_1.set_early_apply(True) PropertyAnimation_1.set_values(0, 255) lv.anim_t.start(PropertyAnimation_1) print ("min_Animation called") return def sec_Animation(TargetObject, delay): PropertyAnimation_0 = lv.anim_t() PropertyAnimation_0.init() PropertyAnimation_0.set_path_cb(lv.anim_t.path_linear) PropertyAnimation_0.set_time(60000) PropertyAnimation_0.set_var(TargetObject) PropertyAnimation_0.set_custom_exec_cb(lambda a, v: TargetObject.set_rotation(v)) PropertyAnimation_0.set_delay(delay + 0) PropertyAnimation_0.set_repeat_count(lv.ANIM_REPEAT_INFINITE) PropertyAnimation_0.set_repeat_delay(0) #+ 60000 PropertyAnimation_0.set_playback_delay(0) PropertyAnimation_0.set_playback_time(0) PropertyAnimation_0.set_early_apply(False) PropertyAnimation_0.set_values(0, 3600) lv.anim_t.start(PropertyAnimation_0) PropertyAnimation_1 = lv.anim_t() PropertyAnimation_1.init() PropertyAnimation_1.set_path_cb(lv.anim_t.path_linear) PropertyAnimation_1.set_time(1000) PropertyAnimation_1.set_var(TargetObject) PropertyAnimation_1.set_custom_exec_cb(lambda a, v: TargetObject.set_style_opa(v,0)) PropertyAnimation_1.set_delay(delay + 0) PropertyAnimation_1.set_repeat_count(0) PropertyAnimation_1.set_repeat_delay(0) #+ 60000 PropertyAnimation_1.set_playback_delay(0) PropertyAnimation_1.set_playback_time(0) PropertyAnimation_1.set_early_apply(True) PropertyAnimation_1.set_values(0, 255) lv.anim_t.start(PropertyAnimation_1) print ("sec_Animation called") return def scrolldot_Animation(TargetObject, delay): PropertyAnimation_0 = lv.anim_t() PropertyAnimation_0.init() PropertyAnimation_0.set_path_cb(lv.anim_t.path_ease_out) PropertyAnimation_0.set_time(300) PropertyAnimation_0.set_var(TargetObject) PropertyAnimation_0.set_custom_exec_cb(lambda a, v: TargetObject.set_y(v)) PropertyAnimation_0.set_delay(delay + 0) PropertyAnimation_0.set_repeat_count(0) PropertyAnimation_0.set_repeat_delay(0) #+ 300 PropertyAnimation_0.set_playback_delay(0) PropertyAnimation_0.set_playback_time(0) PropertyAnimation_0.set_early_apply(True) PropertyAnimation_0.set_values(30, -8) lv.anim_t.start(PropertyAnimation_0) print ("scrolldot_Animation called") return # COMPONENTS # COMPONENT Alarm Comp def ui_Alarm_Comp_create(comp_parent): cui_Alarm_Comp = lv.obj(comp_parent) cui_Alarm_Comp.set_height(80) cui_Alarm_Comp.set_width(lv.pct(94)) cui_Alarm_Comp.set_x(0) cui_Alarm_Comp.set_y(43) cui_Alarm_Comp.set_align( lv.ALIGN.TOP_MID) SetFlag(cui_Alarm_Comp, lv.obj.FLAG.SCROLLABLE, False) cui_Alarm_Comp.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_border_color(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_border_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_border_width( 1, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_border_side( lv.BORDER_SIDE.BOTTOM, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_pad_left( 10, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_pad_right( 10, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_pad_top( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_pad_bottom( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Num2 = lv.label(cui_Alarm_Comp) cui_Alarm_Num2.set_text("7:00") cui_Alarm_Num2.set_width(lv.SIZE_CONTENT) # 1 cui_Alarm_Num2.set_height(lv.SIZE_CONTENT) # 1 cui_Alarm_Num2.set_align( lv.ALIGN.LEFT_MID) cui_Alarm_Num2.set_style_text_color(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Num2.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_Alarm_Num2.set_style_text_font( font_Number, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Period = ui_Small_Label_create(cui_Alarm_Comp) cui_Period.set_text("Wake Up!") cui_Period.set_x(-5) cui_Period.set_y(-6) cui_Period.set_align( lv.ALIGN.BOTTOM_RIGHT) cui_Switch1 = lv.switch(cui_Alarm_Comp) cui_Switch1.set_width(61) cui_Switch1.set_height(32) cui_Switch1.set_x(-4) cui_Switch1.set_y(11) cui_Switch1.set_align( lv.ALIGN.TOP_RIGHT) cui_Switch1.set_style_radius( 50, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Switch1.set_style_bg_color(lv.color_hex(0x9D9ED5), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Switch1.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_Switch1.set_style_radius( 50, lv.PART.INDICATOR | lv.STATE.DEFAULT ) cui_Switch1.set_style_bg_color(lv.color_hex(0x293062), lv.PART.INDICATOR | lv.STATE.CHECKED ) cui_Switch1.set_style_bg_opa(255, lv.PART.INDICATOR| lv.STATE.CHECKED ) cui_Switch1.set_style_radius( 50, lv.PART.KNOB | lv.STATE.DEFAULT ) cui_Switch1.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.KNOB | lv.STATE.DEFAULT ) cui_Switch1.set_style_bg_opa(255, lv.PART.KNOB| lv.STATE.DEFAULT ) cui_Switch1.set_style_pad_left( -3, lv.PART.KNOB | lv.STATE.DEFAULT ) cui_Switch1.set_style_pad_right( -3, lv.PART.KNOB | lv.STATE.DEFAULT ) cui_Switch1.set_style_pad_top( -3, lv.PART.KNOB | lv.STATE.DEFAULT ) cui_Switch1.set_style_pad_bottom( -3, lv.PART.KNOB | lv.STATE.DEFAULT ) _ui_comp_table[id(cui_Alarm_Comp)]= {"Alarm_Comp" : cui_Alarm_Comp,"Alarm_Num2" : cui_Alarm_Num2,"Period" : cui_Period,"Switch1" : cui_Switch1, "_CompName" : "Alarm Comp"} return cui_Alarm_Comp # COMPONENT Clock Dot def ui_Clock_Dot_create(comp_parent): cui_Clock_Dot = lv.obj(comp_parent) cui_Clock_Dot.set_width(6) cui_Clock_Dot.set_height(6) cui_Clock_Dot.set_x(-10) cui_Clock_Dot.set_y(50) cui_Clock_Dot.set_align( lv.ALIGN.TOP_RIGHT) SetFlag(cui_Clock_Dot, lv.obj.FLAG.SCROLLABLE, False) cui_Clock_Dot.set_style_radius( 50, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Clock_Dot.set_style_bg_color(lv.color_hex(0xB3B4E5), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Clock_Dot.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) _ui_comp_table[id(cui_Clock_Dot)]= {"Clock_Dot" : cui_Clock_Dot, "_CompName" : "Clock Dot"} return cui_Clock_Dot # COMPONENT Scrolldots def ui_Scrolldots_create(comp_parent): cui_Scrolldots = lv.obj(comp_parent) cui_Scrolldots.set_width(65) cui_Scrolldots.set_height(12) cui_Scrolldots.set_x(0) cui_Scrolldots.set_y(-8) cui_Scrolldots.set_align( lv.ALIGN.BOTTOM_MID) SetFlag(cui_Scrolldots, lv.obj.FLAG.SCROLLABLE, False) cui_Scrolldots.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Scrolldots.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d1 = lv.obj(cui_Scrolldots) cui_d1.set_width(8) cui_d1.set_height(8) cui_d1.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d1, lv.obj.FLAG.SCROLLABLE, False) cui_d1.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d1.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d1.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d2 = lv.obj(cui_Scrolldots) cui_d2.set_width(4) cui_d2.set_height(4) cui_d2.set_x(15) cui_d2.set_y(0) cui_d2.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d2, lv.obj.FLAG.SCROLLABLE, False) cui_d2.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d2.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d2.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d3 = lv.obj(cui_Scrolldots) cui_d3.set_width(4) cui_d3.set_height(4) cui_d3.set_x(25) cui_d3.set_y(0) cui_d3.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d3, lv.obj.FLAG.SCROLLABLE, False) cui_d3.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d3.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d3.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d4 = lv.obj(cui_Scrolldots) cui_d4.set_width(4) cui_d4.set_height(4) cui_d4.set_x(35) cui_d4.set_y(0) cui_d4.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d4, lv.obj.FLAG.SCROLLABLE, False) cui_d4.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d4.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d4.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d5 = lv.obj(cui_Scrolldots) cui_d5.set_width(4) cui_d5.set_height(4) cui_d5.set_x(45) cui_d5.set_y(0) cui_d5.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d5, lv.obj.FLAG.SCROLLABLE, False) cui_d5.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d5.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d5.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d6 = lv.obj(cui_Scrolldots) cui_d6.set_width(4) cui_d6.set_height(4) cui_d6.set_x(55) cui_d6.set_y(0) cui_d6.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d6, lv.obj.FLAG.SCROLLABLE, False) cui_d6.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d6.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d6.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) _ui_comp_table[id(cui_Scrolldots)]= {"Scrolldots" : cui_Scrolldots,"d1" : cui_d1,"d2" : cui_d2,"d3" : cui_d3,"d4" : cui_d4,"d5" : cui_d5,"d6" : cui_d6, "_CompName" : "Scrolldots"} return cui_Scrolldots # COMPONENT Small Label def ui_Small_Label_create(comp_parent): cui_Small_Label = lv.label(comp_parent) cui_Small_Label.set_text("12") cui_Small_Label.set_width(lv.SIZE_CONTENT) # 1 cui_Small_Label.set_height(lv.SIZE_CONTENT) # 1 cui_Small_Label.set_x(0) cui_Small_Label.set_y(72) cui_Small_Label.set_align( lv.ALIGN.TOP_MID) cui_Small_Label.set_style_text_color(lv.color_hex(0x000746), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Small_Label.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_Small_Label.set_style_text_font( lv.font_montserrat_18, lv.PART.MAIN | lv.STATE.DEFAULT ) _ui_comp_table[id(cui_Small_Label)]= {"Small_Label" : cui_Small_Label, "_CompName" : "Small Label"} return cui_Small_Label # COMPONENTS # COMPONENT Alarm Comp def ui_Alarm_Comp_create(comp_parent): cui_Alarm_Comp = lv.obj(comp_parent) cui_Alarm_Comp.set_height(80) cui_Alarm_Comp.set_width(lv.pct(94)) cui_Alarm_Comp.set_x(0) cui_Alarm_Comp.set_y(43) cui_Alarm_Comp.set_align( lv.ALIGN.TOP_MID) SetFlag(cui_Alarm_Comp, lv.obj.FLAG.SCROLLABLE, False) cui_Alarm_Comp.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_border_color(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_border_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_border_width( 1, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_border_side( lv.BORDER_SIDE.BOTTOM, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_pad_left( 10, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_pad_right( 10, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_pad_top( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Comp.set_style_pad_bottom( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Num2 = lv.label(cui_Alarm_Comp) cui_Alarm_Num2.set_text("7:00") cui_Alarm_Num2.set_width(lv.SIZE_CONTENT) # 1 cui_Alarm_Num2.set_height(lv.SIZE_CONTENT) # 1 cui_Alarm_Num2.set_align( lv.ALIGN.LEFT_MID) cui_Alarm_Num2.set_style_text_color(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Alarm_Num2.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_Alarm_Num2.set_style_text_font( font_Number, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Period = ui_Small_Label_create(cui_Alarm_Comp) cui_Period.set_text("Wake Up!") cui_Period.set_x(-5) cui_Period.set_y(-6) cui_Period.set_align( lv.ALIGN.BOTTOM_RIGHT) cui_Switch1 = lv.switch(cui_Alarm_Comp) cui_Switch1.set_width(61) cui_Switch1.set_height(32) cui_Switch1.set_x(-4) cui_Switch1.set_y(11) cui_Switch1.set_align( lv.ALIGN.TOP_RIGHT) cui_Switch1.set_style_radius( 50, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Switch1.set_style_bg_color(lv.color_hex(0x9D9ED5), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Switch1.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_Switch1.set_style_radius( 50, lv.PART.INDICATOR | lv.STATE.DEFAULT ) cui_Switch1.set_style_bg_color(lv.color_hex(0x293062), lv.PART.INDICATOR | lv.STATE.CHECKED ) cui_Switch1.set_style_bg_opa(255, lv.PART.INDICATOR| lv.STATE.CHECKED ) cui_Switch1.set_style_radius( 50, lv.PART.KNOB | lv.STATE.DEFAULT ) cui_Switch1.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.KNOB | lv.STATE.DEFAULT ) cui_Switch1.set_style_bg_opa(255, lv.PART.KNOB| lv.STATE.DEFAULT ) cui_Switch1.set_style_pad_left( -3, lv.PART.KNOB | lv.STATE.DEFAULT ) cui_Switch1.set_style_pad_right( -3, lv.PART.KNOB | lv.STATE.DEFAULT ) cui_Switch1.set_style_pad_top( -3, lv.PART.KNOB | lv.STATE.DEFAULT ) cui_Switch1.set_style_pad_bottom( -3, lv.PART.KNOB | lv.STATE.DEFAULT ) _ui_comp_table[id(cui_Alarm_Comp)]= {"Alarm_Comp" : cui_Alarm_Comp,"Alarm_Num2" : cui_Alarm_Num2,"Period" : cui_Period,"Switch1" : cui_Switch1, "_CompName" : "Alarm Comp"} return cui_Alarm_Comp # COMPONENT Clock Dot def ui_Clock_Dot_create(comp_parent): cui_Clock_Dot = lv.obj(comp_parent) cui_Clock_Dot.set_width(6) cui_Clock_Dot.set_height(6) cui_Clock_Dot.set_x(-10) cui_Clock_Dot.set_y(50) cui_Clock_Dot.set_align( lv.ALIGN.TOP_RIGHT) SetFlag(cui_Clock_Dot, lv.obj.FLAG.SCROLLABLE, False) cui_Clock_Dot.set_style_radius( 50, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Clock_Dot.set_style_bg_color(lv.color_hex(0xB3B4E5), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Clock_Dot.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) _ui_comp_table[id(cui_Clock_Dot)]= {"Clock_Dot" : cui_Clock_Dot, "_CompName" : "Clock Dot"} return cui_Clock_Dot # COMPONENT Scrolldots def ui_Scrolldots_create(comp_parent): cui_Scrolldots = lv.obj(comp_parent) cui_Scrolldots.set_width(65) cui_Scrolldots.set_height(12) cui_Scrolldots.set_x(0) cui_Scrolldots.set_y(-8) cui_Scrolldots.set_align( lv.ALIGN.BOTTOM_MID) SetFlag(cui_Scrolldots, lv.obj.FLAG.SCROLLABLE, False) cui_Scrolldots.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Scrolldots.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d1 = lv.obj(cui_Scrolldots) cui_d1.set_width(8) cui_d1.set_height(8) cui_d1.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d1, lv.obj.FLAG.SCROLLABLE, False) cui_d1.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d1.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d1.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d2 = lv.obj(cui_Scrolldots) cui_d2.set_width(4) cui_d2.set_height(4) cui_d2.set_x(15) cui_d2.set_y(0) cui_d2.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d2, lv.obj.FLAG.SCROLLABLE, False) cui_d2.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d2.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d2.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d3 = lv.obj(cui_Scrolldots) cui_d3.set_width(4) cui_d3.set_height(4) cui_d3.set_x(25) cui_d3.set_y(0) cui_d3.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d3, lv.obj.FLAG.SCROLLABLE, False) cui_d3.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d3.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d3.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d4 = lv.obj(cui_Scrolldots) cui_d4.set_width(4) cui_d4.set_height(4) cui_d4.set_x(35) cui_d4.set_y(0) cui_d4.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d4, lv.obj.FLAG.SCROLLABLE, False) cui_d4.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d4.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d4.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d5 = lv.obj(cui_Scrolldots) cui_d5.set_width(4) cui_d5.set_height(4) cui_d5.set_x(45) cui_d5.set_y(0) cui_d5.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d5, lv.obj.FLAG.SCROLLABLE, False) cui_d5.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d5.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d5.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_d6 = lv.obj(cui_Scrolldots) cui_d6.set_width(4) cui_d6.set_height(4) cui_d6.set_x(55) cui_d6.set_y(0) cui_d6.set_align( lv.ALIGN.LEFT_MID) SetFlag(cui_d6, lv.obj.FLAG.SCROLLABLE, False) cui_d6.set_style_radius( 20, lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d6.set_style_bg_color(lv.color_hex(0xB4B6E6), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_d6.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) _ui_comp_table[id(cui_Scrolldots)]= {"Scrolldots" : cui_Scrolldots,"d1" : cui_d1,"d2" : cui_d2,"d3" : cui_d3,"d4" : cui_d4,"d5" : cui_d5,"d6" : cui_d6, "_CompName" : "Scrolldots"} return cui_Scrolldots # COMPONENT Small Label def ui_Small_Label_create(comp_parent): cui_Small_Label = lv.label(comp_parent) cui_Small_Label.set_text("12") cui_Small_Label.set_width(lv.SIZE_CONTENT) # 1 cui_Small_Label.set_height(lv.SIZE_CONTENT) # 1 cui_Small_Label.set_x(0) cui_Small_Label.set_y(72) cui_Small_Label.set_align( lv.ALIGN.TOP_MID) cui_Small_Label.set_style_text_color(lv.color_hex(0x000746), lv.PART.MAIN | lv.STATE.DEFAULT ) cui_Small_Label.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) cui_Small_Label.set_style_text_font( lv.font_montserrat_18, lv.PART.MAIN | lv.STATE.DEFAULT ) _ui_comp_table[id(cui_Small_Label)]= {"Small_Label" : cui_Small_Label, "_CompName" : "Small Label"} return cui_Small_Label def ___initial_actions0_eventhandler(event_struct): event = event_struct.code if event == lv.EVENT.SCREEN_LOAD_START and True: sec_Animation(ui_Sec, 0) return ui____initial_actions0 = lv.obj() ui____initial_actions0.add_event_cb(___initial_actions0_eventhandler, lv.EVENT.ALL, None) def Splash_eventhandler(event_struct): event = event_struct.code if event == lv.EVENT.SCREEN_LOADED and True: upanim_Animation(ui_SLS_Logo, 100) upanim_Animation(ui_Smart_Gadget, 200) upanim_Animation(ui_Demo, 300) ChangeScreen( ui_Clock, lv.SCR_LOAD_ANIM.FADE_ON, 200, 1400) return ui_Splash = lv.obj() SetFlag(ui_Splash, lv.obj.FLAG.SCROLLABLE, False) ui_Splash.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Splash.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Demo = ui_Small_Label_create(ui_Splash) ui_Demo.set_text("Demo") ui_Demo.set_x(0) ui_Demo.set_y(75) ui_Demo.set_align( lv.ALIGN.CENTER) ui_Demo.set_style_text_color(lv.color_hex(0x9C9CD9), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Demo.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Smart_Gadget = ui_Small_Label_create(ui_Splash) ui_Smart_Gadget.set_text("Smart Gadget") ui_Smart_Gadget.set_x(0) ui_Smart_Gadget.set_y(50) ui_Smart_Gadget.set_align( lv.ALIGN.CENTER) ui_Smart_Gadget.set_style_text_color(lv.color_hex(0x000746), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Smart_Gadget.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_SLS_Logo = lv.image(ui_Splash) ui_SLS_Logo.set_src(ui_images.ui_img_sls_logo_png) ui_SLS_Logo.set_width(lv.SIZE_CONTENT) # 1 ui_SLS_Logo.set_height(lv.SIZE_CONTENT) # 1 ui_SLS_Logo.set_x(0) ui_SLS_Logo.set_y(-50) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_SLS_Logo.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_SLS_Logo.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_SLS_Logo.set_align( lv.ALIGN.CENTER) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_SLS_Logo, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_SLS_Logo, lv.obj.FLAG.SCROLLABLE, False) ui_Splash.add_event_cb(Splash_eventhandler, lv.EVENT.ALL, None) def Clock_eventhandler(event_struct): event = event_struct.code if event == lv.EVENT.SCREEN_LOAD_START and True: upanim_Animation(ui_Clock_Panel, 100) upanim_Animation(ui_Clock_Number, 300) upanim_Animation(ui_Date, 200) scrolldot_Animation(ui_Scrolldots, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.LEFT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Call, lv.SCR_LOAD_ANIM.FADE_ON, 10, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.RIGHT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Alarm, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) if event == lv.EVENT.SCREEN_LOAD_START and True: hour_Animation(ui_Hour, 200) min_Animation(ui_Min, 400) return ui_Clock = lv.obj() SetFlag(ui_Clock, lv.obj.FLAG.SCROLLABLE, False) ui_Clock.set_style_bg_image_src( ui_images.ui_img_pattern_png, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Clock.set_style_bg_image_tiled( True, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Clock_Panel = lv.obj(ui_Clock) ui_Clock_Panel.set_width(180) ui_Clock_Panel.set_height(180) ui_Clock_Panel.set_x(0) ui_Clock_Panel.set_y(40) ui_Clock_Panel.set_align( lv.ALIGN.CENTER) SetFlag(ui_Clock_Panel, lv.obj.FLAG.SCROLLABLE, False) ui_Clock_Panel.set_style_radius( 500, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Clock_Panel.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Clock_Panel.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Dot1 = ui_Clock_Dot_create(ui_Clock_Panel) ui_Dot1.set_x(-40) ui_Dot1.set_y(15) ui_Dot1.set_align( lv.ALIGN.TOP_RIGHT) ui_Dot2 = ui_Clock_Dot_create(ui_Clock_Panel) ui_Dot2.set_x(-10) ui_Dot2.set_y(50) ui_Dot3 = ui_Clock_Dot_create(ui_Clock_Panel) ui_Dot3.set_x(40) ui_Dot3.set_y(15) ui_Dot3.set_align( lv.ALIGN.TOP_LEFT) ui_Dot4 = ui_Clock_Dot_create(ui_Clock_Panel) ui_Dot4.set_x(10) ui_Dot4.set_y(50) ui_Dot4.set_align( lv.ALIGN.TOP_LEFT) ui_Dot5 = ui_Clock_Dot_create(ui_Clock_Panel) ui_Dot5.set_x(10) ui_Dot5.set_y(-50) ui_Dot5.set_align( lv.ALIGN.BOTTOM_LEFT) ui_Dot6 = ui_Clock_Dot_create(ui_Clock_Panel) ui_Dot6.set_x(40) ui_Dot6.set_y(-15) ui_Dot6.set_align( lv.ALIGN.BOTTOM_LEFT) ui_Dot7 = ui_Clock_Dot_create(ui_Clock_Panel) ui_Dot7.set_x(-10) ui_Dot7.set_y(-50) ui_Dot7.set_align( lv.ALIGN.BOTTOM_RIGHT) ui_Dot8 = ui_Clock_Dot_create(ui_Clock_Panel) ui_Dot8.set_x(-40) ui_Dot8.set_y(-15) ui_Dot8.set_align( lv.ALIGN.BOTTOM_RIGHT) ui_Clock_Number1 = ui_Small_Label_create(ui_Clock_Panel) ui_Clock_Number1.set_x(0) ui_Clock_Number1.set_y(0) ui_Clock_Number2 = ui_Small_Label_create(ui_Clock_Panel) ui_Clock_Number2.set_text("6") ui_Clock_Number2.set_x(0) ui_Clock_Number2.set_y(0) ui_Clock_Number2.set_align( lv.ALIGN.BOTTOM_MID) ui_Clock_Number3 = ui_Small_Label_create(ui_Clock_Panel) ui_Clock_Number3.set_text("9") ui_Clock_Number3.set_x(0) ui_Clock_Number3.set_y(0) ui_Clock_Number3.set_align( lv.ALIGN.LEFT_MID) ui_Clock_Number4 = ui_Small_Label_create(ui_Clock_Panel) ui_Clock_Number4.set_text("3") ui_Clock_Number4.set_x(0) ui_Clock_Number4.set_y(0) ui_Clock_Number4.set_align( lv.ALIGN.RIGHT_MID) ui_Min = lv.image(ui_Clock_Panel) ui_Min.set_src(ui_images.ui_img_clock_min_png) ui_Min.set_width(lv.SIZE_CONTENT) # 1 ui_Min.set_height(lv.SIZE_CONTENT) # 1 if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Min.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Min.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Min.set_align( lv.ALIGN.CENTER) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Min, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Min, lv.obj.FLAG.SCROLLABLE, False) ui_Hour = lv.image(ui_Clock_Panel) ui_Hour.set_src(ui_images.ui_img_clock_hour_png) ui_Hour.set_width(lv.SIZE_CONTENT) # 1 ui_Hour.set_height(lv.SIZE_CONTENT) # 1 if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Hour.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Hour.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Hour.set_align( lv.ALIGN.CENTER) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Hour, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Hour, lv.obj.FLAG.SCROLLABLE, False) ui_Sec = lv.image(ui_Clock_Panel) ui_Sec.set_src(ui_images.ui_img_clock_sec_png) ui_Sec.set_width(lv.SIZE_CONTENT) # 1 ui_Sec.set_height(lv.SIZE_CONTENT) # 1 if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Sec.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Sec.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Sec.set_align( lv.ALIGN.CENTER) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Sec, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Sec, lv.obj.FLAG.SCROLLABLE, False) ui_Sec.set_rotation(150) ui_Clock_Center = lv.obj(ui_Clock_Panel) ui_Clock_Center.set_width(8) ui_Clock_Center.set_height(8) ui_Clock_Center.set_align( lv.ALIGN.CENTER) SetFlag(ui_Clock_Center, lv.obj.FLAG.SCROLLABLE, False) ui_Clock_Center.set_style_radius( 10, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Clock_Center.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Clock_Center.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Clock_Center.set_style_border_color(lv.color_hex(0x1937D2), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Clock_Center.set_style_border_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Clock_Center.set_style_border_width( 2, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Clock_Number = lv.label(ui_Clock) ui_Clock_Number.set_text("09:25") ui_Clock_Number.set_width(lv.SIZE_CONTENT) # 1 ui_Clock_Number.set_height(lv.SIZE_CONTENT) # 1 ui_Clock_Number.set_x(0) ui_Clock_Number.set_y(15) ui_Clock_Number.set_align( lv.ALIGN.TOP_MID) ui_Clock_Number.set_style_text_color(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Clock_Number.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Clock_Number.set_style_text_font( font_Number, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Date = ui_Small_Label_create(ui_Clock) ui_Date.set_text("Mon 28 Oct") ui_Date.set_x(0) ui_Date.set_y(76) ui_Date.set_style_text_color(lv.color_hex(0x9C9CD9), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Date.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Scrolldots = ui_Scrolldots_create(ui_Clock) ui_Scrolldots.set_x(0) ui_Scrolldots.set_y(-8) ui_comp_get_child(ui_Scrolldots, "d1").set_style_bg_color(lv.color_hex(0x101C52), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_comp_get_child(ui_Scrolldots, "d1").set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Clock.add_event_cb(Clock_eventhandler, lv.EVENT.ALL, None) def Call_eventhandler(event_struct): event = event_struct.code if event == lv.EVENT.SCREEN_LOADED and True: upanim_Animation(ui_Avatar, 100) upanim_Animation(ui_Elena, 200) upanim_Animation(ui_Incoming, 300) upanim_Animation(ui_Call_Incon1, 200) upanim_Animation(ui_Call_Incon2, 300) scrolldot_Animation(ui_Scrolldots1, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.LEFT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Chat, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.RIGHT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Clock, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) return ui_Call = lv.obj() SetFlag(ui_Call, lv.obj.FLAG.SCROLLABLE, False) ui_Call.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Call.set_style_bg_image_src( ui_images.ui_img_pattern_png, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call.set_style_bg_image_tiled( True, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Elena = ui_Small_Label_create(ui_Call) ui_Elena.set_text("Elena Smith Bergman") ui_Elena.set_x(0) ui_Elena.set_y(0) ui_Elena.set_align( lv.ALIGN.CENTER) ui_Elena.set_style_text_color(lv.color_hex(0x000746), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Elena.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Incoming = ui_Small_Label_create(ui_Call) ui_Incoming.set_text("Incoming Call") ui_Incoming.set_x(0) ui_Incoming.set_y(25) ui_Incoming.set_align( lv.ALIGN.CENTER) ui_Incoming.set_style_text_color(lv.color_hex(0x9C9CD9), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Incoming.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Call_Incon1 = lv.obj(ui_Call) ui_Call_Incon1.set_width(60) ui_Call_Incon1.set_height(60) ui_Call_Incon1.set_x(-50) ui_Call_Incon1.set_y(-42) ui_Call_Incon1.set_align( lv.ALIGN.BOTTOM_MID) SetFlag(ui_Call_Incon1, lv.obj.FLAG.SCROLLABLE, False) ui_Call_Incon1.set_style_radius( 60, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon1.set_style_bg_color(lv.color_hex(0xE63431), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon1.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Call_Incon1.set_style_shadow_color(lv.color_hex(0xE63431), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon1.set_style_shadow_opa(150, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Call_Incon1.set_style_shadow_width( 30, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon1.set_style_shadow_spread( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon1.set_style_shadow_offset_x( 3, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon1.set_style_shadow_offset_y( 6, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon1.set_style_bg_color(lv.color_hex(0xFF5855), lv.PART.MAIN | lv.STATE.PRESSED ) ui_Call_Incon1.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.PRESSED ) ui_Phone1 = lv.image(ui_Call_Incon1) ui_Phone1.set_src(ui_images.ui_img_phone_png) ui_Phone1.set_width(lv.SIZE_CONTENT) # 1 ui_Phone1.set_height(lv.SIZE_CONTENT) # 1 if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Phone1.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Phone1.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Phone1.set_align( lv.ALIGN.CENTER) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Phone1, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Phone1, lv.obj.FLAG.SCROLLABLE, False) ui_Phone1.set_rotation(1360) ui_Call_Incon2 = lv.obj(ui_Call) ui_Call_Incon2.set_width(60) ui_Call_Incon2.set_height(60) ui_Call_Incon2.set_x(50) ui_Call_Incon2.set_y(-42) ui_Call_Incon2.set_align( lv.ALIGN.BOTTOM_MID) SetFlag(ui_Call_Incon2, lv.obj.FLAG.SCROLLABLE, False) ui_Call_Incon2.set_style_radius( 60, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon2.set_style_bg_color(lv.color_hex(0x10D262), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon2.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Call_Incon2.set_style_shadow_color(lv.color_hex(0x10D262), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon2.set_style_shadow_opa(150, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Call_Incon2.set_style_shadow_width( 30, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon2.set_style_shadow_spread( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon2.set_style_shadow_offset_x( 3, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon2.set_style_shadow_offset_y( 6, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Call_Incon2.set_style_bg_color(lv.color_hex(0x31EF81), lv.PART.MAIN | lv.STATE.PRESSED ) ui_Call_Incon2.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.PRESSED ) ui_Phone2 = lv.image(ui_Call_Incon2) ui_Phone2.set_src(ui_images.ui_img_phone_png) ui_Phone2.set_width(lv.SIZE_CONTENT) # 1 ui_Phone2.set_height(lv.SIZE_CONTENT) # 1 if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Phone2.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Phone2.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Phone2.set_align( lv.ALIGN.CENTER) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Phone2, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Phone2, lv.obj.FLAG.SCROLLABLE, False) ui_Avatar = lv.image(ui_Call) ui_Avatar.set_src(ui_images.ui_img_avatar_png) ui_Avatar.set_width(lv.SIZE_CONTENT) # 1 ui_Avatar.set_height(lv.SIZE_CONTENT) # 1 ui_Avatar.set_x(0) ui_Avatar.set_y(20) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Avatar.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Avatar.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Avatar.set_align( lv.ALIGN.TOP_MID) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Avatar, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Avatar, lv.obj.FLAG.SCROLLABLE, False) ui_Avatar.set_style_radius( 300, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Avatar.set_style_shadow_color(lv.color_hex(0xD5D2D5), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Avatar.set_style_shadow_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Avatar.set_style_shadow_width( 30, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Avatar.set_style_shadow_spread( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Avatar.set_style_shadow_offset_x( 3, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Avatar.set_style_shadow_offset_y( 6, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Scrolldots1 = ui_Scrolldots_create(ui_Call) ui_Scrolldots1.set_x(0) ui_Scrolldots1.set_y(-8) ui_comp_get_child(ui_Scrolldots1, "d1").set_width(4) ui_comp_get_child(ui_Scrolldots1, "d1").set_height(4) ui_comp_get_child(ui_Scrolldots1, "d2").set_width(8) ui_comp_get_child(ui_Scrolldots1, "d2").set_height(8) ui_comp_get_child(ui_Scrolldots1, "d2").set_x(11) ui_comp_get_child(ui_Scrolldots1, "d2").set_y(0) ui_comp_get_child(ui_Scrolldots1, "d2").set_style_bg_color(lv.color_hex(0x101C52), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_comp_get_child(ui_Scrolldots1, "d2").set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Call.add_event_cb(Call_eventhandler, lv.EVENT.ALL, None) def Chat_eventhandler(event_struct): event = event_struct.code if event == lv.EVENT.SCREEN_LOADED and True: upanim_Animation(ui_Chat_date, 100) upanim_Animation(ui_C1, 200) upanim_Animation(ui_C2, 300) upanim_Animation(ui_C3, 400) scrolldot_Animation(ui_Scrolldots2, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.RIGHT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Call, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.LEFT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Music_Player, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) return ui_Chat = lv.obj() SetFlag(ui_Chat, lv.obj.FLAG.SCROLLABLE, False) ui_Chat.set_style_bg_image_src( ui_images.ui_img_pattern_png, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat.set_style_bg_image_tiled( True, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_container = lv.obj(ui_Chat) ui_Chat_container.set_width(lv.pct(100)) ui_Chat_container.set_height(lv.pct(100)) ui_Chat_container.set_align( lv.ALIGN.CENTER) ui_Chat_container.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_container.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Chat_date = ui_Small_Label_create(ui_Chat_container) ui_Chat_date.set_text("Yesterday 07:25 PM") ui_Chat_date.set_x(0) ui_Chat_date.set_y(17) ui_Chat_date.set_align( lv.ALIGN.TOP_MID) ui_Chat_date.set_style_text_color(lv.color_hex(0x000746), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_date.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_C1 = lv.obj(ui_Chat_container) ui_C1.set_height(100) ui_C1.set_width(lv.pct(100)) ui_C1.set_x(0) ui_C1.set_y(60) SetFlag(ui_C1, lv.obj.FLAG.SCROLLABLE, False) ui_C1.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C1.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_C1.set_style_pad_left( 12, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C1.set_style_pad_right( 12, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C1.set_style_pad_top( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C1.set_style_pad_bottom( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel1 = lv.obj(ui_C1) ui_Chat_Panel1.set_width(169) ui_Chat_Panel1.set_height(81) SetFlag(ui_Chat_Panel1, lv.obj.FLAG.SCROLLABLE, False) ui_Chat_Panel1.set_style_radius( 12, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel1.set_style_bg_color(lv.color_hex(0x9C9CD9), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel1.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Chat_Panel1.set_style_pad_left( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel1.set_style_pad_right( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel1.set_style_pad_top( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel1.set_style_pad_bottom( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat1 = ui_Small_Label_create(ui_Chat_Panel1) ui_Chat1.set_text("Let's get some dinner, how about pizza?") ui_Chat1.set_width(lv.pct(100)) ui_Chat1.set_height(lv.SIZE_CONTENT) # 1 ui_Chat1.set_x(0) ui_Chat1.set_y(0) ui_Chat1.set_align( lv.ALIGN.TOP_LEFT) ui_Chat1.set_style_text_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat1.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Chat_Icon1 = lv.image(ui_C1) ui_Chat_Icon1.set_src(ui_images.ui_img_chatbox_png) ui_Chat_Icon1.set_width(lv.SIZE_CONTENT) # 1 ui_Chat_Icon1.set_height(lv.SIZE_CONTENT) # 1 ui_Chat_Icon1.set_x(0) ui_Chat_Icon1.set_y(80) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Chat_Icon1.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Chat_Icon1.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Chat_Icon1.set_align( lv.ALIGN.TOP_LEFT) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Chat_Icon1, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Chat_Icon1, lv.obj.FLAG.SCROLLABLE, False) ui_Chat_Icon1.set_style_image_recolor(lv.color_hex(0x9C9CD9), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Icon1.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_C2 = lv.obj(ui_Chat_container) ui_C2.set_height(100) ui_C2.set_width(lv.pct(100)) ui_C2.set_x(0) ui_C2.set_y(160) SetFlag(ui_C2, lv.obj.FLAG.SCROLLABLE, False) ui_C2.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C2.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_C2.set_style_pad_left( 12, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C2.set_style_pad_right( 12, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C2.set_style_pad_top( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C2.set_style_pad_bottom( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel2 = lv.obj(ui_C2) ui_Chat_Panel2.set_width(169) ui_Chat_Panel2.set_height(81) ui_Chat_Panel2.set_align( lv.ALIGN.TOP_RIGHT) SetFlag(ui_Chat_Panel2, lv.obj.FLAG.SCROLLABLE, False) ui_Chat_Panel2.set_style_radius( 12, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel2.set_style_bg_color(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel2.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Chat_Panel2.set_style_pad_left( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel2.set_style_pad_right( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel2.set_style_pad_top( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel2.set_style_pad_bottom( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat2 = ui_Small_Label_create(ui_Chat_Panel2) ui_Chat2.set_text("Sounds good! What about James?") ui_Chat2.set_width(lv.pct(100)) ui_Chat2.set_height(lv.SIZE_CONTENT) # 1 ui_Chat2.set_x(0) ui_Chat2.set_y(0) ui_Chat2.set_align( lv.ALIGN.TOP_LEFT) ui_Chat2.set_style_text_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat2.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Chat_Icon2 = lv.image(ui_C2) ui_Chat_Icon2.set_src(ui_images.ui_img_chatbox2_png) ui_Chat_Icon2.set_width(lv.SIZE_CONTENT) # 1 ui_Chat_Icon2.set_height(lv.SIZE_CONTENT) # 1 ui_Chat_Icon2.set_x(0) ui_Chat_Icon2.set_y(80) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Chat_Icon2.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Chat_Icon2.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Chat_Icon2.set_align( lv.ALIGN.TOP_RIGHT) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Chat_Icon2, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Chat_Icon2, lv.obj.FLAG.SCROLLABLE, False) ui_Chat_Icon2.set_style_image_recolor(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Icon2.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Delifered = ui_Small_Label_create(ui_C2) ui_Delifered.set_text("Delivered") ui_Delifered.set_x(47) ui_Delifered.set_y(83) ui_Delifered.set_align( lv.ALIGN.TOP_LEFT) ui_Delifered.set_style_text_color(lv.color_hex(0x9C9CD9), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Delifered.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_C3 = lv.obj(ui_Chat_container) ui_C3.set_height(100) ui_C3.set_width(lv.pct(100)) ui_C3.set_x(0) ui_C3.set_y(270) SetFlag(ui_C3, lv.obj.FLAG.SCROLLABLE, False) ui_C3.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C3.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_C3.set_style_pad_left( 12, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C3.set_style_pad_right( 12, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C3.set_style_pad_top( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_C3.set_style_pad_bottom( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel3 = lv.obj(ui_C3) ui_Chat_Panel3.set_width(169) ui_Chat_Panel3.set_height(81) SetFlag(ui_Chat_Panel3, lv.obj.FLAG.SCROLLABLE, False) ui_Chat_Panel3.set_style_radius( 12, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel3.set_style_bg_color(lv.color_hex(0x9C9CD9), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel3.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Chat_Panel3.set_style_pad_left( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel3.set_style_pad_right( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel3.set_style_pad_top( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Panel3.set_style_pad_bottom( 8, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat3 = ui_Small_Label_create(ui_Chat_Panel3) ui_Chat3.set_text("He likes it too! Where do we meet?") ui_Chat3.set_width(lv.pct(100)) ui_Chat3.set_height(lv.SIZE_CONTENT) # 1 ui_Chat3.set_x(0) ui_Chat3.set_y(0) ui_Chat3.set_align( lv.ALIGN.TOP_LEFT) ui_Chat3.set_style_text_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat3.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Chat_Icon3 = lv.image(ui_C3) ui_Chat_Icon3.set_src(ui_images.ui_img_chatbox_png) ui_Chat_Icon3.set_width(lv.SIZE_CONTENT) # 1 ui_Chat_Icon3.set_height(lv.SIZE_CONTENT) # 1 ui_Chat_Icon3.set_x(0) ui_Chat_Icon3.set_y(80) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Chat_Icon3.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Chat_Icon3.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Chat_Icon3.set_align( lv.ALIGN.TOP_LEFT) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Chat_Icon3, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Chat_Icon3, lv.obj.FLAG.SCROLLABLE, False) ui_Chat_Icon3.set_style_image_recolor(lv.color_hex(0x9C9CD9), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Chat_Icon3.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Scrolldots2 = ui_Scrolldots_create(ui_Chat) ui_Scrolldots2.set_x(0) ui_Scrolldots2.set_y(-8) ui_comp_get_child(ui_Scrolldots2, "d1").set_width(4) ui_comp_get_child(ui_Scrolldots2, "d1").set_height(4) ui_comp_get_child(ui_Scrolldots2, "d2").set_x(10) ui_comp_get_child(ui_Scrolldots2, "d2").set_y(0) ui_comp_get_child(ui_Scrolldots2, "d3").set_width(8) ui_comp_get_child(ui_Scrolldots2, "d3").set_height(8) ui_comp_get_child(ui_Scrolldots2, "d3").set_x(21) ui_comp_get_child(ui_Scrolldots2, "d3").set_y(0) ui_comp_get_child(ui_Scrolldots2, "d3").set_style_bg_color(lv.color_hex(0x101C52), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_comp_get_child(ui_Scrolldots2, "d3").set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Chat.add_event_cb(Chat_eventhandler, lv.EVENT.ALL, None) def Music_Player_eventhandler(event_struct): event = event_struct.code if event == lv.EVENT.SCREEN_LOADED and True: upanim_Animation(ui_Album, 100) upanim_Animation(ui_Music_Title, 200) upanim_Animation(ui_Author, 300) upanim_Animation(ui_Play_btn, 200) upanim_Animation(ui_Forward, 300) upanim_Animation(ui_Backward, 400) scrolldot_Animation(ui_Scrolldots3, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.RIGHT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Chat, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.LEFT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Weather, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) return ui_Music_Player = lv.obj() SetFlag(ui_Music_Player, lv.obj.FLAG.SCROLLABLE, False) ui_Music_Player.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Music_Player.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Music_Player.set_style_bg_image_src( ui_images.ui_img_pattern_png, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Music_Player.set_style_bg_image_tiled( True, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Music_Title = ui_Small_Label_create(ui_Music_Player) ui_Music_Title.set_text("Wood and forest") ui_Music_Title.set_x(0) ui_Music_Title.set_y(0) ui_Music_Title.set_align( lv.ALIGN.CENTER) ui_Music_Title.set_style_text_color(lv.color_hex(0x000746), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Music_Title.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Author = ui_Small_Label_create(ui_Music_Player) ui_Author.set_text("Alan Smith") ui_Author.set_x(0) ui_Author.set_y(25) ui_Author.set_align( lv.ALIGN.CENTER) ui_Author.set_style_text_color(lv.color_hex(0x9C9CD9), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Author.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Play_btn = lv.obj(ui_Music_Player) ui_Play_btn.set_width(60) ui_Play_btn.set_height(60) ui_Play_btn.set_x(0) ui_Play_btn.set_y(-42) ui_Play_btn.set_align( lv.ALIGN.BOTTOM_MID) SetFlag(ui_Play_btn, lv.obj.FLAG.SCROLLABLE, False) ui_Play_btn.set_style_radius( 60, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Play_btn.set_style_bg_color(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Play_btn.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Play_btn.set_style_shadow_color(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Play_btn.set_style_shadow_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Play_btn.set_style_shadow_width( 30, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Play_btn.set_style_shadow_spread( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Play_btn.set_style_shadow_offset_x( 3, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Play_btn.set_style_shadow_offset_y( 6, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Play_btn.set_style_bg_color(lv.color_hex(0x515EB5), lv.PART.MAIN | lv.STATE.PRESSED ) ui_Play_btn.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.PRESSED ) ui_Play = lv.image(ui_Play_btn) ui_Play.set_src(ui_images.ui_img_play_png) ui_Play.set_width(lv.SIZE_CONTENT) # 1 ui_Play.set_height(lv.SIZE_CONTENT) # 1 ui_Play.set_x(2) ui_Play.set_y(0) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Play.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Play.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Play.set_align( lv.ALIGN.CENTER) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Play, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Play, lv.obj.FLAG.SCROLLABLE, False) ui_Album = lv.image(ui_Music_Player) ui_Album.set_src(ui_images.ui_img_album_png) ui_Album.set_width(lv.SIZE_CONTENT) # 1 ui_Album.set_height(lv.SIZE_CONTENT) # 1 ui_Album.set_x(0) ui_Album.set_y(20) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Album.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Album.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Album.set_align( lv.ALIGN.TOP_MID) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Album, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Album, lv.obj.FLAG.SCROLLABLE, False) ui_Album.set_style_radius( 300, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Album.set_style_shadow_color(lv.color_hex(0xD5D2D5), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Album.set_style_shadow_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Album.set_style_shadow_width( 30, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Album.set_style_shadow_spread( 0, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Album.set_style_shadow_offset_x( 3, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Album.set_style_shadow_offset_y( 6, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Backward = lv.image(ui_Music_Player) ui_Backward.set_src(ui_images.ui_img_backward_png) ui_Backward.set_width(lv.SIZE_CONTENT) # 1 ui_Backward.set_height(lv.SIZE_CONTENT) # 1 ui_Backward.set_x(30) ui_Backward.set_y(-60) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Backward.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Backward.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Backward.set_align( lv.ALIGN.BOTTOM_LEFT) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Backward, lv.obj.FLAG.CLICKABLE, True) SetFlag(ui_Backward, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Backward, lv.obj.FLAG.SCROLLABLE, False) ui_Backward.set_style_image_recolor(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Backward.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Backward.set_style_image_recolor(lv.color_hex(0x515EB5), lv.PART.MAIN | lv.STATE.PRESSED ) ui_Backward.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.PRESSED ) ui_Forward = lv.image(ui_Music_Player) ui_Forward.set_src(ui_images.ui_img_forward_png) ui_Forward.set_width(lv.SIZE_CONTENT) # 1 ui_Forward.set_height(lv.SIZE_CONTENT) # 1 ui_Forward.set_x(-30) ui_Forward.set_y(-60) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Forward.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Forward.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Forward.set_align( lv.ALIGN.BOTTOM_RIGHT) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Forward, lv.obj.FLAG.CLICKABLE, True) SetFlag(ui_Forward, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Forward, lv.obj.FLAG.SCROLLABLE, False) ui_Forward.set_style_image_recolor(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Forward.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Forward.set_style_image_recolor(lv.color_hex(0x515EB5), lv.PART.MAIN | lv.STATE.PRESSED ) ui_Forward.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.PRESSED ) ui_Scrolldots3 = ui_Scrolldots_create(ui_Music_Player) ui_Scrolldots3.set_x(0) ui_Scrolldots3.set_y(-8) ui_comp_get_child(ui_Scrolldots3, "d1").set_width(4) ui_comp_get_child(ui_Scrolldots3, "d1").set_height(4) ui_comp_get_child(ui_Scrolldots3, "d2").set_x(10) ui_comp_get_child(ui_Scrolldots3, "d2").set_y(0) ui_comp_get_child(ui_Scrolldots3, "d3").set_x(20) ui_comp_get_child(ui_Scrolldots3, "d3").set_y(0) ui_comp_get_child(ui_Scrolldots3, "d4").set_width(8) ui_comp_get_child(ui_Scrolldots3, "d4").set_height(8) ui_comp_get_child(ui_Scrolldots3, "d4").set_x(31) ui_comp_get_child(ui_Scrolldots3, "d4").set_y(0) ui_comp_get_child(ui_Scrolldots3, "d4").set_style_bg_color(lv.color_hex(0x101C52), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_comp_get_child(ui_Scrolldots3, "d4").set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Music_Player.add_event_cb(Music_Player_eventhandler, lv.EVENT.ALL, None) def Weather_eventhandler(event_struct): event = event_struct.code if event == lv.EVENT.SCREEN_LOADED and True: upanim_Animation(ui_Cloud, 100) upanim_Animation(ui_Pary_Cloud, 200) upanim_Animation(ui_Celsius, 300) upanim_Animation(ui_New_York, 400) upanim_Animation(ui_Weather_Icons, 300) scrolldot_Animation(ui_Scrolldots4, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.RIGHT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Music_Player, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.LEFT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Alarm, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) return ui_Weather = lv.obj() SetFlag(ui_Weather, lv.obj.FLAG.SCROLLABLE, False) ui_Weather.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Weather.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Weather.set_style_bg_image_src( ui_images.ui_img_pattern_png, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Weather.set_style_bg_image_tiled( True, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Pary_Cloud = ui_Small_Label_create(ui_Weather) ui_Pary_Cloud.set_text("Partly cloudy") ui_Pary_Cloud.set_x(0) ui_Pary_Cloud.set_y(-67) ui_Pary_Cloud.set_align( lv.ALIGN.CENTER) ui_Pary_Cloud.set_style_text_color(lv.color_hex(0x000746), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Pary_Cloud.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_New_York = ui_Small_Label_create(ui_Weather) ui_New_York.set_text("New York") ui_New_York.set_x(0) ui_New_York.set_y(37) ui_New_York.set_align( lv.ALIGN.CENTER) ui_New_York.set_style_text_color(lv.color_hex(0x9C9CD9), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_New_York.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Cloud = lv.image(ui_Weather) ui_Cloud.set_src(ui_images.ui_img_cloud_png) ui_Cloud.set_width(lv.SIZE_CONTENT) # 1 ui_Cloud.set_height(lv.SIZE_CONTENT) # 1 ui_Cloud.set_x(-2) ui_Cloud.set_y(19) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_Cloud.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_Cloud.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_Cloud.set_align( lv.ALIGN.TOP_MID) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_Cloud, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_Cloud, lv.obj.FLAG.SCROLLABLE, False) ui_Cloud.set_style_image_recolor(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Cloud.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Celsius = lv.label(ui_Weather) ui_Celsius.set_text("26°") ui_Celsius.set_width(lv.SIZE_CONTENT) # 1 ui_Celsius.set_height(lv.SIZE_CONTENT) # 1 ui_Celsius.set_x(0) ui_Celsius.set_y(125) ui_Celsius.set_align( lv.ALIGN.TOP_MID) ui_Celsius.set_style_text_color(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Celsius.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Celsius.set_style_text_font( font_Number, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Weather_Icons = lv.obj(ui_Weather) ui_Weather_Icons.set_height(56) ui_Weather_Icons.set_width(lv.pct(100)) ui_Weather_Icons.set_x(0) ui_Weather_Icons.set_y(-33) ui_Weather_Icons.set_align( lv.ALIGN.BOTTOM_MID) SetFlag(ui_Weather_Icons, lv.obj.FLAG.SCROLLABLE, False) ui_Weather_Icons.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Weather_Icons.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_w1 = lv.image(ui_Weather_Icons) ui_w1.set_src(ui_images.ui_img_weather_1_png) ui_w1.set_width(lv.SIZE_CONTENT) # 1 ui_w1.set_height(lv.SIZE_CONTENT) # 1 ui_w1.set_x(40) ui_w1.set_y(0) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_w1.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_w1.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_w1.set_align( lv.ALIGN.TOP_LEFT) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_w1, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_w1, lv.obj.FLAG.SCROLLABLE, False) ui_w1.set_style_image_recolor(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_w1.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_w2 = lv.image(ui_Weather_Icons) ui_w2.set_src(ui_images.ui_img_weather_2_png) ui_w2.set_width(lv.SIZE_CONTENT) # 1 ui_w2.set_height(lv.SIZE_CONTENT) # 1 if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_w2.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_w2.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_w2.set_align( lv.ALIGN.TOP_MID) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_w2, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_w2, lv.obj.FLAG.SCROLLABLE, False) ui_w2.set_style_image_recolor(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_w2.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_w3 = lv.image(ui_Weather_Icons) ui_w3.set_src(ui_images.ui_img_weather_3_png) ui_w3.set_width(lv.SIZE_CONTENT) # 1 ui_w3.set_height(lv.SIZE_CONTENT) # 1 ui_w3.set_x(-40) ui_w3.set_y(0) if (lv.image.ALIGN.CENTER == lv.image.ALIGN.STRETCH ): ui_w3.set_inner_align(lv.image.ALIGN.TILE) # LVGL9.1 bug fix patch CENTER, 1, 1 ui_w3.set_inner_align(lv.image.ALIGN.CENTER) # LVGL9.1 bug fix patch 1, 1 ui_w3.set_align( lv.ALIGN.TOP_RIGHT) # LVGL9.1 bug fix patch CENTER, 1, 1 SetFlag(ui_w3, lv.obj.FLAG.ADV_HITTEST, True) SetFlag(ui_w3, lv.obj.FLAG.SCROLLABLE, False) ui_w3.set_style_image_recolor(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_w3.set_style_image_recolor_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_W1_Num = ui_Small_Label_create(ui_Weather_Icons) ui_W1_Num.set_text("65°") ui_W1_Num.set_x(35) ui_W1_Num.set_y(25) ui_W1_Num.set_align( lv.ALIGN.TOP_LEFT) ui_W2_Num = ui_Small_Label_create(ui_Weather_Icons) ui_W2_Num.set_text("24km/h") ui_W2_Num.set_x(0) ui_W2_Num.set_y(25) ui_W2_Num.set_align( lv.ALIGN.TOP_MID) ui_W3_Num = ui_Small_Label_create(ui_Weather_Icons) ui_W3_Num.set_text("18%") ui_W3_Num.set_x(-30) ui_W3_Num.set_y(25) ui_W3_Num.set_align( lv.ALIGN.TOP_RIGHT) ui_Scrolldots4 = ui_Scrolldots_create(ui_Weather) ui_Scrolldots4.set_x(0) ui_Scrolldots4.set_y(-8) ui_comp_get_child(ui_Scrolldots4, "d1").set_width(4) ui_comp_get_child(ui_Scrolldots4, "d1").set_height(4) ui_comp_get_child(ui_Scrolldots4, "d2").set_x(10) ui_comp_get_child(ui_Scrolldots4, "d2").set_y(0) ui_comp_get_child(ui_Scrolldots4, "d3").set_x(20) ui_comp_get_child(ui_Scrolldots4, "d3").set_y(0) ui_comp_get_child(ui_Scrolldots4, "d4").set_x(30) ui_comp_get_child(ui_Scrolldots4, "d4").set_y(0) ui_comp_get_child(ui_Scrolldots4, "d5").set_width(8) ui_comp_get_child(ui_Scrolldots4, "d5").set_height(8) ui_comp_get_child(ui_Scrolldots4, "d5").set_x(41) ui_comp_get_child(ui_Scrolldots4, "d5").set_y(0) ui_comp_get_child(ui_Scrolldots4, "d5").set_style_bg_color(lv.color_hex(0x101C52), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_comp_get_child(ui_Scrolldots4, "d5").set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Weather.add_event_cb(Weather_eventhandler, lv.EVENT.ALL, None) def Alarm_eventhandler(event_struct): event = event_struct.code if event == lv.EVENT.SCREEN_LOADED and True: upanim_Animation(ui_Set_alarm, 100) upanim_Animation(ui_Alarm_Comp, 200) upanim_Animation(ui_Alarm_Comp1, 300) upanim_Animation(ui_Alarm_Comp2, 400) upanim_Animation(ui_Alarm_Comp3, 500) scrolldot_Animation(ui_Scrolldots5, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.RIGHT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Weather, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) if event == lv.EVENT.GESTURE and True and lv.indev_active().get_gesture_dir() == lv.DIR.LEFT : indev = lv.indev_active() indev.wait_release() ChangeScreen( ui_Clock, lv.SCR_LOAD_ANIM.FADE_ON, 0, 0) return ui_Alarm = lv.obj() SetFlag(ui_Alarm, lv.obj.FLAG.SCROLLABLE, False) ui_Alarm.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Alarm.set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Alarm.set_style_bg_image_src( ui_images.ui_img_pattern_png, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Alarm.set_style_bg_image_tiled( True, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Alarm_container = lv.obj(ui_Alarm) ui_Alarm_container.set_width(lv.pct(100)) ui_Alarm_container.set_height(lv.pct(100)) ui_Alarm_container.set_align( lv.ALIGN.CENTER) ui_Alarm_container.set_style_bg_color(lv.color_hex(0xFFFFFF), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Alarm_container.set_style_bg_opa(0, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Set_alarm = ui_Small_Label_create(ui_Alarm_container) ui_Set_alarm.set_text("Set alarm") ui_Set_alarm.set_x(0) ui_Set_alarm.set_y(17) ui_Set_alarm.set_align( lv.ALIGN.TOP_MID) ui_Set_alarm.set_style_text_color(lv.color_hex(0x000746), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Set_alarm.set_style_text_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Alarm_Comp = ui_Alarm_Comp_create(ui_Alarm_container) ui_Alarm_Comp.set_x(0) ui_Alarm_Comp.set_y(43) ui_Alarm_Comp1 = ui_Alarm_Comp_create(ui_Alarm_container) ui_Alarm_Comp1.set_x(0) ui_Alarm_Comp1.set_y(128) ui_comp_get_child(ui_Alarm_Comp1, "Alarm_Num2").set_text("8:00") ui_comp_get_child(ui_Alarm_Comp1, "Period").set_text("Breakfast") ui_comp_get_child(ui_Alarm_Comp1, "Switch1").add_state(lv.STATE.CHECKED * True | lv.STATE.PRESSED * False | lv.STATE.FOCUSED * False |lv.STATE.DISABLED * False | lv.STATE.EDITED * False | lv.STATE.USER_1 * False | lv.STATE.USER_2 * False | lv.STATE.USER_3 * False | lv.STATE.USER_4 * False) ui_comp_get_child(ui_Alarm_Comp1, "Switch1").remove_state(lv.STATE.CHECKED * (not True) | lv.STATE.PRESSED * (not False) | lv.STATE.FOCUSED * (not False) | lv.STATE.DISABLED * (not False) | lv.STATE.EDITED * (not False) | lv.STATE.USER_1 * (not False) | lv.STATE.USER_2 * (not False) | lv.STATE.USER_3 * (not False) | lv.STATE.USER_4 * (not False)) ui_Alarm_Comp2 = ui_Alarm_Comp_create(ui_Alarm_container) ui_Alarm_Comp2.set_x(0) ui_Alarm_Comp2.set_y(213) ui_comp_get_child(ui_Alarm_Comp2, "Alarm_Num2").set_text("9:30") ui_comp_get_child(ui_Alarm_Comp2, "Period").set_text("Yoga") ui_Alarm_Comp3 = ui_Alarm_Comp_create(ui_Alarm_container) ui_Alarm_Comp3.set_x(0) ui_Alarm_Comp3.set_y(298) ui_Alarm_Comp3.set_style_border_color(lv.color_hex(0x293062), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Alarm_Comp3.set_style_border_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Alarm_Comp3.set_style_border_width( 1, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_Alarm_Comp3.set_style_border_side( lv.BORDER_SIDE.NONE, lv.PART.MAIN | lv.STATE.DEFAULT ) ui_comp_get_child(ui_Alarm_Comp3, "Alarm_Num2").set_text("11:00") ui_comp_get_child(ui_Alarm_Comp3, "Period").set_text("Sleep") ui_Scrolldots5 = ui_Scrolldots_create(ui_Alarm) ui_Scrolldots5.set_x(0) ui_Scrolldots5.set_y(-8) ui_comp_get_child(ui_Scrolldots5, "d1").set_width(4) ui_comp_get_child(ui_Scrolldots5, "d1").set_height(4) ui_comp_get_child(ui_Scrolldots5, "d2").set_x(10) ui_comp_get_child(ui_Scrolldots5, "d2").set_y(0) ui_comp_get_child(ui_Scrolldots5, "d3").set_x(20) ui_comp_get_child(ui_Scrolldots5, "d3").set_y(0) ui_comp_get_child(ui_Scrolldots5, "d4").set_x(30) ui_comp_get_child(ui_Scrolldots5, "d4").set_y(0) ui_comp_get_child(ui_Scrolldots5, "d5").set_x(40) ui_comp_get_child(ui_Scrolldots5, "d5").set_y(0) ui_comp_get_child(ui_Scrolldots5, "d6").set_width(8) ui_comp_get_child(ui_Scrolldots5, "d6").set_height(8) ui_comp_get_child(ui_Scrolldots5, "d6").set_x(50) ui_comp_get_child(ui_Scrolldots5, "d6").set_y(0) ui_comp_get_child(ui_Scrolldots5, "d6").set_style_bg_color(lv.color_hex(0x101C52), lv.PART.MAIN | lv.STATE.DEFAULT ) ui_comp_get_child(ui_Scrolldots5, "d6").set_style_bg_opa(255, lv.PART.MAIN| lv.STATE.DEFAULT ) ui_Alarm.add_event_cb(Alarm_eventhandler, lv.EVENT.ALL, None) lv.screen_load(ui____initial_actions0) lv.screen_load(ui_Splash)