Files
P4-USB-transfer/main/ui/generated/setup_scr_screen_time.c
zhengxinandCursor 851e347cf5 初始提交卡包 USB 工程
纳入固件源码、屏幕组件、nand_xfer 工具和文档。忽略本机构建产物、sdkconfig,以及含本机路径的依赖锁。

Co-authored-by: Cursor <[email protected]>
2026-10-13 21:54:50 +08:00

114 lines
7.1 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"
int screen_time_digital_clock_now_min_value = 56;
int screen_time_digital_clock_now_hour_value = 20;
int screen_time_digital_clock_now_sec_value = 0;
void setup_scr_screen_time(lv_ui *ui)
{
//Write codes screen_time
ui->screen_time = lv_obj_create(NULL);
lv_obj_set_size(ui->screen_time, 502, 410);
lv_obj_set_scrollbar_mode(ui->screen_time, LV_SCROLLBAR_MODE_OFF);
//Write style for screen_time, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_bg_opa(ui->screen_time, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui->screen_time, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_bg_grad_dir(ui->screen_time, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
//Write codes screen_time_digital_clock_now
static bool screen_time_digital_clock_now_timer_enabled = false;
ui->screen_time_digital_clock_now = lv_label_create(ui->screen_time);
lv_obj_set_pos(ui->screen_time_digital_clock_now, 3, 145);
lv_obj_set_size(ui->screen_time_digital_clock_now, 495, 190);
lv_label_set_text(ui->screen_time_digital_clock_now, "20:56");
if (!screen_time_digital_clock_now_timer_enabled) {
lv_timer_create(screen_time_digital_clock_now_timer, 1000, NULL);
screen_time_digital_clock_now_timer_enabled = true;
}
//Write style for screen_time_digital_clock_now, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_radius(ui->screen_time_digital_clock_now, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_color(ui->screen_time_digital_clock_now, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->screen_time_digital_clock_now, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui->screen_time_digital_clock_now, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_letter_space(ui->screen_time_digital_clock_now, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_align(ui->screen_time_digital_clock_now, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->screen_time_digital_clock_now, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_top(ui->screen_time_digital_clock_now, 7, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_right(ui->screen_time_digital_clock_now, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_bottom(ui->screen_time_digital_clock_now, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_left(ui->screen_time_digital_clock_now, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->screen_time_digital_clock_now, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
//Write codes screen_time_label_date
ui->screen_time_label_date = lv_label_create(ui->screen_time);
lv_obj_set_pos(ui->screen_time_label_date, 36, 105);
lv_obj_set_size(ui->screen_time_label_date, 270, 35);
lv_label_set_text(ui->screen_time_label_date, "2026年08月12日");
lv_label_set_long_mode(ui->screen_time_label_date, LV_LABEL_LONG_WRAP);
//Write style for screen_time_label_date, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->screen_time_label_date, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->screen_time_label_date, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_color(ui->screen_time_label_date, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->screen_time_label_date, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui->screen_time_label_date, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_letter_space(ui->screen_time_label_date, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_line_space(ui->screen_time_label_date, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_align(ui->screen_time_label_date, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->screen_time_label_date, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_top(ui->screen_time_label_date, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_right(ui->screen_time_label_date, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_bottom(ui->screen_time_label_date, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_left(ui->screen_time_label_date, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->screen_time_label_date, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
//Write codes screen_time_label_week
ui->screen_time_label_week = lv_label_create(ui->screen_time);
lv_obj_set_pos(ui->screen_time_label_week, 320, 105);
lv_obj_set_size(ui->screen_time_label_week, 100, 35);
lv_label_set_text(ui->screen_time_label_week, "星期一");
lv_label_set_long_mode(ui->screen_time_label_week, LV_LABEL_LONG_WRAP);
//Write style for screen_time_label_week, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->screen_time_label_week, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->screen_time_label_week, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_color(ui->screen_time_label_week, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->screen_time_label_week, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui->screen_time_label_week, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_letter_space(ui->screen_time_label_week, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_line_space(ui->screen_time_label_week, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_align(ui->screen_time_label_week, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->screen_time_label_week, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_top(ui->screen_time_label_week, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_right(ui->screen_time_label_week, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_bottom(ui->screen_time_label_week, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_left(ui->screen_time_label_week, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->screen_time_label_week, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
//The custom code of screen_time.
//Update current screen layout.
lv_obj_update_layout(ui->screen_time);
//Init events for screen.
events_init_screen_time(ui);
}