158 lines
10 KiB
C
158 lines
10 KiB
C
/*
|
|
* Copyright 2025 NXP
|
|
* NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
|
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
|
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
|
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
|
* terms, then you may not retain, install, activate or otherwise use the software.
|
|
*/
|
|
|
|
#include "lvgl.h"
|
|
#include <stdio.h>
|
|
#include "gui_guider.h"
|
|
#include "events_init.h"
|
|
#include "widgets_init.h"
|
|
#include "custom.h"
|
|
|
|
|
|
|
|
void setup_scr_screen_burning(lv_ui *ui)
|
|
{
|
|
//Write codes screen_burning
|
|
ui->screen_burning = lv_obj_create(NULL);
|
|
lv_obj_set_size(ui->screen_burning, 128, 160);
|
|
lv_obj_set_scrollbar_mode(ui->screen_burning, LV_SCROLLBAR_MODE_OFF);
|
|
|
|
//Write style for screen_burning, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_bg_opa(ui->screen_burning, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_burning_cont_1
|
|
ui->screen_burning_cont_1 = lv_obj_create(ui->screen_burning);
|
|
lv_obj_set_pos(ui->screen_burning_cont_1, 0, 0);
|
|
lv_obj_set_size(ui->screen_burning_cont_1, 128, 160);
|
|
lv_obj_set_scrollbar_mode(ui->screen_burning_cont_1, LV_SCROLLBAR_MODE_OFF);
|
|
|
|
//Write style for screen_burning_cont_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_border_width(ui->screen_burning_cont_1, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_border_opa(ui->screen_burning_cont_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_border_color(ui->screen_burning_cont_1, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_border_side(ui->screen_burning_cont_1, LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(ui->screen_burning_cont_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(ui->screen_burning_cont_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_color(ui->screen_burning_cont_1, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_grad_dir(ui->screen_burning_cont_1, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_top(ui->screen_burning_cont_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_bottom(ui->screen_burning_cont_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_left(ui->screen_burning_cont_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_right(ui->screen_burning_cont_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_width(ui->screen_burning_cont_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_burning_bar_1
|
|
ui->screen_burning_bar_1 = lv_bar_create(ui->screen_burning_cont_1);
|
|
lv_obj_set_style_anim_time(ui->screen_burning_bar_1, 1000, 0);
|
|
lv_bar_set_mode(ui->screen_burning_bar_1, LV_BAR_MODE_NORMAL);
|
|
lv_bar_set_range(ui->screen_burning_bar_1, 0, 100);
|
|
lv_bar_set_value(ui->screen_burning_bar_1, 50, LV_ANIM_OFF);
|
|
lv_obj_set_pos(ui->screen_burning_bar_1, 7, 151);
|
|
lv_obj_set_size(ui->screen_burning_bar_1, 113, 4);
|
|
|
|
//Write style for screen_burning_bar_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_bg_opa(ui->screen_burning_bar_1, 60, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_color(ui->screen_burning_bar_1, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_grad_dir(ui->screen_burning_bar_1, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(ui->screen_burning_bar_1, 10, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_width(ui->screen_burning_bar_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write style for screen_burning_bar_1, Part: LV_PART_INDICATOR, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_bg_opa(ui->screen_burning_bar_1, 255, LV_PART_INDICATOR|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_color(ui->screen_burning_bar_1, lv_color_hex(0x2195f6), LV_PART_INDICATOR|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_grad_dir(ui->screen_burning_bar_1, LV_GRAD_DIR_NONE, LV_PART_INDICATOR|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(ui->screen_burning_bar_1, 10, LV_PART_INDICATOR|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_burning_label_1
|
|
ui->screen_burning_label_1 = lv_label_create(ui->screen_burning);
|
|
lv_label_set_text(ui->screen_burning_label_1, "已连接");
|
|
lv_label_set_long_mode(ui->screen_burning_label_1, LV_LABEL_LONG_SCROLL);
|
|
lv_obj_set_pos(ui->screen_burning_label_1, 2, 0);
|
|
lv_obj_set_size(ui->screen_burning_label_1, 124, 18);
|
|
|
|
//Write style for screen_burning_label_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_border_width(ui->screen_burning_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(ui->screen_burning_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_color(ui->screen_burning_label_1, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(ui->screen_burning_label_1, &lv_font_GB2312_16, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_opa(ui->screen_burning_label_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_letter_space(ui->screen_burning_label_1, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_line_space(ui->screen_burning_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_align(ui->screen_burning_label_1, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(ui->screen_burning_label_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_color(ui->screen_burning_label_1, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_grad_dir(ui->screen_burning_label_1, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_top(ui->screen_burning_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_right(ui->screen_burning_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_bottom(ui->screen_burning_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_left(ui->screen_burning_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_width(ui->screen_burning_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_burning_btn_1
|
|
ui->screen_burning_btn_1 = lv_btn_create(ui->screen_burning);
|
|
ui->screen_burning_btn_1_label = lv_label_create(ui->screen_burning_btn_1);
|
|
lv_label_set_text(ui->screen_burning_btn_1_label, "烧录完成");
|
|
lv_label_set_long_mode(ui->screen_burning_btn_1_label, LV_LABEL_LONG_WRAP);
|
|
lv_obj_align(ui->screen_burning_btn_1_label, LV_ALIGN_CENTER, 0, 0);
|
|
lv_obj_set_style_pad_all(ui->screen_burning_btn_1, 0, LV_STATE_DEFAULT);
|
|
lv_obj_set_width(ui->screen_burning_btn_1_label, LV_PCT(100));
|
|
lv_obj_set_pos(ui->screen_burning_btn_1, 24, 122);
|
|
lv_obj_set_size(ui->screen_burning_btn_1, 80, 22);
|
|
|
|
//Write style for screen_burning_btn_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_bg_opa(ui->screen_burning_btn_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_color(ui->screen_burning_btn_1, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_grad_dir(ui->screen_burning_btn_1, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_border_width(ui->screen_burning_btn_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(ui->screen_burning_btn_1, 5, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_width(ui->screen_burning_btn_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_color(ui->screen_burning_btn_1, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(ui->screen_burning_btn_1, &lv_font_GB2312_16, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_opa(ui->screen_burning_btn_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_align(ui->screen_burning_btn_1, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_burning_spangroup_1
|
|
ui->screen_burning_spangroup_1 = lv_spangroup_create(ui->screen_burning);
|
|
lv_spangroup_set_align(ui->screen_burning_spangroup_1, LV_TEXT_ALIGN_LEFT);
|
|
lv_spangroup_set_overflow(ui->screen_burning_spangroup_1, LV_SPAN_OVERFLOW_CLIP);
|
|
lv_spangroup_set_mode(ui->screen_burning_spangroup_1, LV_SPAN_MODE_BREAK);
|
|
//create span
|
|
ui->screen_burning_spangroup_1_span = lv_spangroup_new_span(ui->screen_burning_spangroup_1);
|
|
lv_span_set_text(ui->screen_burning_spangroup_1_span, "hello");
|
|
lv_style_set_text_color(&ui->screen_burning_spangroup_1_span->style, lv_color_hex(0x000000));
|
|
lv_style_set_text_decor(&ui->screen_burning_spangroup_1_span->style, LV_TEXT_DECOR_NONE);
|
|
lv_style_set_text_font(&ui->screen_burning_spangroup_1_span->style, &lv_font_montserratMedium_12);
|
|
lv_obj_set_pos(ui->screen_burning_spangroup_1, 17, 30);
|
|
lv_obj_set_size(ui->screen_burning_spangroup_1, 100, 82);
|
|
|
|
//Write style state: LV_STATE_DEFAULT for &style_screen_burning_spangroup_1_main_main_default
|
|
static lv_style_t style_screen_burning_spangroup_1_main_main_default;
|
|
ui_init_style(&style_screen_burning_spangroup_1_main_main_default);
|
|
|
|
lv_style_set_border_width(&style_screen_burning_spangroup_1_main_main_default, 0);
|
|
lv_style_set_radius(&style_screen_burning_spangroup_1_main_main_default, 0);
|
|
lv_style_set_bg_opa(&style_screen_burning_spangroup_1_main_main_default, 0);
|
|
lv_style_set_pad_top(&style_screen_burning_spangroup_1_main_main_default, 0);
|
|
lv_style_set_pad_right(&style_screen_burning_spangroup_1_main_main_default, 0);
|
|
lv_style_set_pad_bottom(&style_screen_burning_spangroup_1_main_main_default, 0);
|
|
lv_style_set_pad_left(&style_screen_burning_spangroup_1_main_main_default, 0);
|
|
lv_style_set_shadow_width(&style_screen_burning_spangroup_1_main_main_default, 0);
|
|
lv_obj_add_style(ui->screen_burning_spangroup_1, &style_screen_burning_spangroup_1_main_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_spangroup_refr_mode(ui->screen_burning_spangroup_1);
|
|
|
|
//The custom code of screen_burning.
|
|
|
|
|
|
//Update current screen layout.
|
|
lv_obj_update_layout(ui->screen_burning);
|
|
|
|
//Init events for screen.
|
|
events_init_screen_burning(ui);
|
|
}
|