纳入固件源码、屏幕组件、nand_xfer 工具和文档。忽略本机构建产物、sdkconfig,以及含本机路径的依赖锁。 Co-authored-by: Cursor <cursoragent@cursor.com>
210 lines
15 KiB
C
210 lines
15 KiB
C
/*
|
|
* Copyright 2026 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_home_weather(lv_ui *ui)
|
|
{
|
|
//Write codes screen_home_weather
|
|
ui->screen_home_weather = lv_obj_create(NULL);
|
|
lv_obj_set_size(ui->screen_home_weather, 502, 410);
|
|
lv_obj_set_scrollbar_mode(ui->screen_home_weather, LV_SCROLLBAR_MODE_OFF);
|
|
|
|
//Write style for screen_home_weather, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_bg_opa(ui->screen_home_weather, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_color(ui->screen_home_weather, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_grad_dir(ui->screen_home_weather, LV_GRAD_DIR_HOR, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_grad_color(ui->screen_home_weather, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_main_stop(ui->screen_home_weather, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_grad_stop(ui->screen_home_weather, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_home_weather_label_temp
|
|
ui->screen_home_weather_label_temp = lv_label_create(ui->screen_home_weather);
|
|
lv_obj_set_pos(ui->screen_home_weather_label_temp, 30, 80);
|
|
lv_obj_set_size(ui->screen_home_weather_label_temp, 235, 185);
|
|
lv_label_set_text(ui->screen_home_weather_label_temp, "20");
|
|
lv_label_set_long_mode(ui->screen_home_weather_label_temp, LV_LABEL_LONG_WRAP);
|
|
|
|
//Write style for screen_home_weather_label_temp, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_border_width(ui->screen_home_weather_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(ui->screen_home_weather_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_color(ui->screen_home_weather_label_temp, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(ui->screen_home_weather_label_temp, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_opa(ui->screen_home_weather_label_temp, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_letter_space(ui->screen_home_weather_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_line_space(ui->screen_home_weather_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_align(ui->screen_home_weather_label_temp, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(ui->screen_home_weather_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_top(ui->screen_home_weather_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_right(ui->screen_home_weather_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_bottom(ui->screen_home_weather_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_left(ui->screen_home_weather_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_width(ui->screen_home_weather_label_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_home_weather_label_1hlate
|
|
ui->screen_home_weather_label_1hlate = lv_label_create(ui->screen_home_weather);
|
|
lv_obj_set_pos(ui->screen_home_weather_label_1hlate, 80, 255);
|
|
lv_obj_set_size(ui->screen_home_weather_label_1hlate, 70, 25);
|
|
lv_label_set_text(ui->screen_home_weather_label_1hlate, "现在");
|
|
lv_label_set_long_mode(ui->screen_home_weather_label_1hlate, LV_LABEL_LONG_WRAP);
|
|
|
|
//Write style for screen_home_weather_label_1hlate, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_border_width(ui->screen_home_weather_label_1hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(ui->screen_home_weather_label_1hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_color(ui->screen_home_weather_label_1hlate, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(ui->screen_home_weather_label_1hlate, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_opa(ui->screen_home_weather_label_1hlate, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_letter_space(ui->screen_home_weather_label_1hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_line_space(ui->screen_home_weather_label_1hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_align(ui->screen_home_weather_label_1hlate, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(ui->screen_home_weather_label_1hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_top(ui->screen_home_weather_label_1hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_right(ui->screen_home_weather_label_1hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_bottom(ui->screen_home_weather_label_1hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_left(ui->screen_home_weather_label_1hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_width(ui->screen_home_weather_label_1hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_home_weather_label_3hlate
|
|
ui->screen_home_weather_label_3hlate = lv_label_create(ui->screen_home_weather);
|
|
lv_obj_set_pos(ui->screen_home_weather_label_3hlate, 216, 255);
|
|
lv_obj_set_size(ui->screen_home_weather_label_3hlate, 70, 25);
|
|
lv_label_set_text(ui->screen_home_weather_label_3hlate, "13:00");
|
|
lv_label_set_long_mode(ui->screen_home_weather_label_3hlate, LV_LABEL_LONG_WRAP);
|
|
|
|
//Write style for screen_home_weather_label_3hlate, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_border_width(ui->screen_home_weather_label_3hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(ui->screen_home_weather_label_3hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_color(ui->screen_home_weather_label_3hlate, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(ui->screen_home_weather_label_3hlate, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_opa(ui->screen_home_weather_label_3hlate, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_letter_space(ui->screen_home_weather_label_3hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_line_space(ui->screen_home_weather_label_3hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_align(ui->screen_home_weather_label_3hlate, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(ui->screen_home_weather_label_3hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_top(ui->screen_home_weather_label_3hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_right(ui->screen_home_weather_label_3hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_bottom(ui->screen_home_weather_label_3hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_left(ui->screen_home_weather_label_3hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_width(ui->screen_home_weather_label_3hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_home_weather_label_5hlate
|
|
ui->screen_home_weather_label_5hlate = lv_label_create(ui->screen_home_weather);
|
|
lv_obj_set_pos(ui->screen_home_weather_label_5hlate, 352, 255);
|
|
lv_obj_set_size(ui->screen_home_weather_label_5hlate, 70, 25);
|
|
lv_label_set_text(ui->screen_home_weather_label_5hlate, "15:00");
|
|
lv_label_set_long_mode(ui->screen_home_weather_label_5hlate, LV_LABEL_LONG_WRAP);
|
|
|
|
//Write style for screen_home_weather_label_5hlate, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_border_width(ui->screen_home_weather_label_5hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(ui->screen_home_weather_label_5hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_color(ui->screen_home_weather_label_5hlate, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(ui->screen_home_weather_label_5hlate, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_opa(ui->screen_home_weather_label_5hlate, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_letter_space(ui->screen_home_weather_label_5hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_line_space(ui->screen_home_weather_label_5hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_align(ui->screen_home_weather_label_5hlate, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(ui->screen_home_weather_label_5hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_top(ui->screen_home_weather_label_5hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_right(ui->screen_home_weather_label_5hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_bottom(ui->screen_home_weather_label_5hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_left(ui->screen_home_weather_label_5hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_width(ui->screen_home_weather_label_5hlate, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_home_weather_img_1
|
|
ui->screen_home_weather_img_1 = lv_image_create(ui->screen_home_weather);
|
|
lv_obj_set_pos(ui->screen_home_weather_img_1, 313, 72);
|
|
lv_obj_set_size(ui->screen_home_weather_img_1, 130, 130);
|
|
lv_obj_add_flag(ui->screen_home_weather_img_1, LV_OBJ_FLAG_CLICKABLE);
|
|
lv_image_set_src(ui->screen_home_weather_img_1, &_fog_RGB565_130x130_RLE);
|
|
lv_image_set_pivot(ui->screen_home_weather_img_1, 50,50);
|
|
lv_image_set_rotation(ui->screen_home_weather_img_1, 0);
|
|
|
|
//Write style for screen_home_weather_img_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_image_recolor_opa(ui->screen_home_weather_img_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_image_opa(ui->screen_home_weather_img_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_home_weather_img_2
|
|
ui->screen_home_weather_img_2 = lv_image_create(ui->screen_home_weather);
|
|
lv_obj_set_pos(ui->screen_home_weather_img_2, 90, 296);
|
|
lv_obj_set_size(ui->screen_home_weather_img_2, 55, 55);
|
|
lv_obj_add_flag(ui->screen_home_weather_img_2, LV_OBJ_FLAG_CLICKABLE);
|
|
lv_image_set_src(ui->screen_home_weather_img_2, &_fog_RGB565_55x55);
|
|
lv_image_set_pivot(ui->screen_home_weather_img_2, 50,50);
|
|
lv_image_set_rotation(ui->screen_home_weather_img_2, 0);
|
|
|
|
//Write style for screen_home_weather_img_2, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_image_recolor_opa(ui->screen_home_weather_img_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_image_opa(ui->screen_home_weather_img_2, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_home_weather_img_3
|
|
ui->screen_home_weather_img_3 = lv_image_create(ui->screen_home_weather);
|
|
lv_obj_set_pos(ui->screen_home_weather_img_3, 226, 296);
|
|
lv_obj_set_size(ui->screen_home_weather_img_3, 55, 55);
|
|
lv_obj_add_flag(ui->screen_home_weather_img_3, LV_OBJ_FLAG_CLICKABLE);
|
|
lv_image_set_src(ui->screen_home_weather_img_3, &_sun_RGB565_55x55);
|
|
lv_image_set_pivot(ui->screen_home_weather_img_3, 50,50);
|
|
lv_image_set_rotation(ui->screen_home_weather_img_3, 0);
|
|
|
|
//Write style for screen_home_weather_img_3, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_image_recolor_opa(ui->screen_home_weather_img_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_image_opa(ui->screen_home_weather_img_3, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_home_weather_img_4
|
|
ui->screen_home_weather_img_4 = lv_image_create(ui->screen_home_weather);
|
|
lv_obj_set_pos(ui->screen_home_weather_img_4, 360, 296);
|
|
lv_obj_set_size(ui->screen_home_weather_img_4, 55, 55);
|
|
lv_obj_add_flag(ui->screen_home_weather_img_4, LV_OBJ_FLAG_CLICKABLE);
|
|
lv_image_set_src(ui->screen_home_weather_img_4, &_snow_RGB565_55x55);
|
|
lv_image_set_pivot(ui->screen_home_weather_img_4, 50,50);
|
|
lv_image_set_rotation(ui->screen_home_weather_img_4, 0);
|
|
|
|
//Write style for screen_home_weather_img_4, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_image_recolor_opa(ui->screen_home_weather_img_4, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_image_opa(ui->screen_home_weather_img_4, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//Write codes screen_home_weather_label_6
|
|
ui->screen_home_weather_label_6 = lv_label_create(ui->screen_home_weather);
|
|
lv_obj_set_pos(ui->screen_home_weather_label_6, 230, 50);
|
|
lv_obj_set_size(ui->screen_home_weather_label_6, 74, 93);
|
|
lv_label_set_text(ui->screen_home_weather_label_6, "°");
|
|
lv_label_set_long_mode(ui->screen_home_weather_label_6, LV_LABEL_LONG_WRAP);
|
|
|
|
//Write style for screen_home_weather_label_6, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
|
lv_obj_set_style_border_width(ui->screen_home_weather_label_6, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(ui->screen_home_weather_label_6, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_color(ui->screen_home_weather_label_6, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(ui->screen_home_weather_label_6, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_opa(ui->screen_home_weather_label_6, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_letter_space(ui->screen_home_weather_label_6, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_line_space(ui->screen_home_weather_label_6, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_align(ui->screen_home_weather_label_6, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(ui->screen_home_weather_label_6, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_top(ui->screen_home_weather_label_6, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_right(ui->screen_home_weather_label_6, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_bottom(ui->screen_home_weather_label_6, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_left(ui->screen_home_weather_label_6, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_width(ui->screen_home_weather_label_6, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
|
|
//The custom code of screen_home_weather.
|
|
|
|
|
|
//Update current screen layout.
|
|
lv_obj_update_layout(ui->screen_home_weather);
|
|
|
|
//Init events for screen.
|
|
events_init_screen_home_weather(ui);
|
|
}
|