// 配网界面 - 显示配网图片
// KEY2单击后进入此界面，开启BLE等待APP连接

#include "../ui.h"
#include "ui_ScreenPeiwang.h"

lv_obj_t *ui_ScreenPeiwang = NULL;
static lv_obj_t *peiwang_img = NULL;

void ui_ScreenPeiwang_screen_init(void) {
    ui_ScreenPeiwang = lv_obj_create(NULL);
    lv_obj_clear_flag(ui_ScreenPeiwang, LV_OBJ_FLAG_SCROLLABLE);
    lv_obj_set_style_bg_color(ui_ScreenPeiwang, lv_color_hex(0x000000), LV_PART_MAIN);
    lv_obj_set_style_bg_opa(ui_ScreenPeiwang, 255, LV_PART_MAIN);

    // 配网图片（260x260），居中显示
    peiwang_img = lv_img_create(ui_ScreenPeiwang);
    lv_img_set_src(peiwang_img, &ui_img_peiwang_new2_png);
    lv_obj_set_align(peiwang_img, LV_ALIGN_CENTER);
    lv_obj_clear_flag(peiwang_img, LV_OBJ_FLAG_SCROLLABLE);

}

void ui_ScreenPeiwang_screen_destroy(void) {
    if (ui_ScreenPeiwang) lv_obj_del(ui_ScreenPeiwang);
    ui_ScreenPeiwang = NULL;
    peiwang_img = NULL;
}
