// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.6.0
// LVGL version: 8.3.11
// Project name: Lcd_Pro

#include "../ui.h"
#include "ui_ScreenSet.h"  // 引入ScreenSet的函数声明

lv_obj_t *ui_ScreenHome = NULL;lv_obj_t *ui_Label1 = NULL;lv_obj_t *ui_Image3 = NULL;lv_obj_t *ui_Arc1 = NULL;lv_obj_t *ui_LabelHome = NULL;
// event funtions
void ui_event_ScreenHome( lv_event_t * e) {
    lv_event_code_t event_code = lv_event_get_code(e);

if ( event_code == LV_EVENT_GESTURE &&  lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_BOTTOM  ) {
lv_indev_wait_release(lv_indev_get_act());
      // 设置返回到Home界面
      ui_ScreenSet_set_previous(&ui_ScreenHome, &ui_ScreenHome_screen_init);
      _ui_screen_change( &ui_ScreenSet, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_ScreenSet_screen_init);
}
if ( event_code == LV_EVENT_GESTURE &&  lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_LEFT  ) {
lv_indev_wait_release(lv_indev_get_act());
      _ui_screen_change( &ui_ScreenImg, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_ScreenImg_screen_init);
}
if ( event_code == LV_EVENT_GESTURE &&  lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_RIGHT  ) {
lv_indev_wait_release(lv_indev_get_act());
      _ui_screen_change( &ui_ScreenImg, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_ScreenImg_screen_init);
}
}

// build funtions

void ui_ScreenHome_screen_init(void)
{
ui_ScreenHome = lv_obj_create(NULL);
lv_obj_clear_flag( ui_ScreenHome, LV_OBJ_FLAG_SCROLLABLE );    /// Flags
lv_obj_set_style_bg_color(ui_ScreenHome, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
lv_obj_set_style_bg_opa(ui_ScreenHome, 255, LV_PART_MAIN| LV_STATE_DEFAULT);

ui_Label1 = lv_label_create(ui_ScreenHome);
lv_obj_set_width( ui_Label1, LV_SIZE_CONTENT);  /// 20
lv_obj_set_height( ui_Label1, LV_SIZE_CONTENT);   /// 20
lv_obj_set_x( ui_Label1, 5 );
lv_obj_set_y( ui_Label1, -2 );
lv_obj_set_align( ui_Label1, LV_ALIGN_CENTER );
lv_label_set_text(ui_Label1,"70%");
lv_obj_set_style_text_color(ui_Label1, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
lv_obj_set_style_text_opa(ui_Label1, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_text_align(ui_Label1, LV_TEXT_ALIGN_AUTO, LV_PART_MAIN| LV_STATE_DEFAULT);

ui_Image3 = lv_img_create(ui_ScreenHome);
lv_img_set_src(ui_Image3, &ui_img_s8_png);
lv_obj_set_width( ui_Image3, LV_SIZE_CONTENT);  /// 1
lv_obj_set_height( ui_Image3, LV_SIZE_CONTENT);   /// 1
lv_obj_set_x( ui_Image3, 2 );
lv_obj_set_y( ui_Image3, 32 );
lv_obj_set_align( ui_Image3, LV_ALIGN_CENTER );
lv_obj_add_flag( ui_Image3, LV_OBJ_FLAG_ADV_HITTEST );   /// Flags
lv_obj_clear_flag( ui_Image3, LV_OBJ_FLAG_SCROLLABLE );    /// Flags

ui_Arc1 = lv_arc_create(ui_ScreenHome);
lv_obj_set_width( ui_Arc1, 150);
lv_obj_set_height( ui_Arc1, 150);
lv_obj_set_x( ui_Arc1, -1 );
lv_obj_set_y( ui_Arc1, 1 );
lv_obj_set_align( ui_Arc1, LV_ALIGN_CENTER );
lv_arc_set_value(ui_Arc1, 50);

ui_LabelHome = lv_label_create(ui_ScreenHome);
lv_obj_set_width( ui_LabelHome, LV_SIZE_CONTENT);  /// 1
lv_obj_set_height( ui_LabelHome, LV_SIZE_CONTENT);   /// 1
lv_obj_set_x( ui_LabelHome, 3 );
lv_obj_set_y( ui_LabelHome, 95 );
lv_obj_set_align( ui_LabelHome, LV_ALIGN_CENTER );
lv_label_set_text(ui_LabelHome,"Home");
lv_obj_set_style_text_color(ui_LabelHome, lv_color_hex(0x03F7F2), LV_PART_MAIN | LV_STATE_DEFAULT );
lv_obj_set_style_text_opa(ui_LabelHome, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui_LabelHome, &lv_font_montserrat_26, LV_PART_MAIN| LV_STATE_DEFAULT);

lv_obj_add_event_cb(ui_ScreenHome, ui_event_ScreenHome, LV_EVENT_ALL, NULL);

}

void ui_ScreenHome_screen_destroy(void)
{
   if (ui_ScreenHome) lv_obj_del(ui_ScreenHome);

// NULL screen variables
ui_ScreenHome= NULL;
ui_Label1= NULL;
ui_Image3= NULL;
ui_Arc1= NULL;
ui_LabelHome= NULL;

}
