/* * 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 #include "gui_guider.h" #include "events_init.h" #include "widgets_init.h" #include "custom.h" void setup_scr_screen_pull_down(lv_ui *ui) { //Write codes screen_pull_down ui->screen_pull_down = lv_obj_create(NULL); lv_obj_set_size(ui->screen_pull_down, 502, 410); lv_obj_set_scrollbar_mode(ui->screen_pull_down, LV_SCROLLBAR_MODE_OFF); //Write style for screen_pull_down, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_pull_down, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_pull_down, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_pull_down, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_pull_down_btn_set ui->screen_pull_down_btn_set = lv_button_create(ui->screen_pull_down); lv_obj_set_pos(ui->screen_pull_down_btn_set, 80, 135); lv_obj_set_size(ui->screen_pull_down_btn_set, 342, 60); ui->screen_pull_down_btn_set_label = lv_label_create(ui->screen_pull_down_btn_set); lv_label_set_text(ui->screen_pull_down_btn_set_label, "设 置"); lv_label_set_long_mode(ui->screen_pull_down_btn_set_label, LV_LABEL_LONG_WRAP); lv_obj_align(ui->screen_pull_down_btn_set_label, LV_ALIGN_CENTER, 0, 0); lv_obj_set_style_pad_all(ui->screen_pull_down_btn_set, 0, LV_STATE_DEFAULT); lv_obj_set_width(ui->screen_pull_down_btn_set_label, LV_PCT(100)); //Write style for screen_pull_down_btn_set, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_pull_down_btn_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_pull_down_btn_set, lv_color_hex(0x29333b), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_pull_down_btn_set, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_width(ui->screen_pull_down_btn_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_pull_down_btn_set, 15, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_pull_down_btn_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_pull_down_btn_set, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_pull_down_btn_set, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_pull_down_btn_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_pull_down_btn_set, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); //Write style for screen_pull_down_btn_set, Part: LV_PART_MAIN, State: LV_STATE_CHECKED. lv_obj_set_style_bg_opa(ui->screen_pull_down_btn_set, 255, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_bg_color(ui->screen_pull_down_btn_set, lv_color_hex(0x29333b), LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_bg_grad_dir(ui->screen_pull_down_btn_set, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_border_width(ui->screen_pull_down_btn_set, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_radius(ui->screen_pull_down_btn_set, 15, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_shadow_width(ui->screen_pull_down_btn_set, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_color(ui->screen_pull_down_btn_set, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_font(ui->screen_pull_down_btn_set, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_opa(ui->screen_pull_down_btn_set, 255, LV_PART_MAIN|LV_STATE_CHECKED); //Write codes screen_pull_down_btn_sleep ui->screen_pull_down_btn_sleep = lv_button_create(ui->screen_pull_down); lv_obj_set_pos(ui->screen_pull_down_btn_sleep, 80, 55); lv_obj_set_size(ui->screen_pull_down_btn_sleep, 342, 60); ui->screen_pull_down_btn_sleep_label = lv_label_create(ui->screen_pull_down_btn_sleep); lv_label_set_text(ui->screen_pull_down_btn_sleep_label, "休 眠"); lv_label_set_long_mode(ui->screen_pull_down_btn_sleep_label, LV_LABEL_LONG_WRAP); lv_obj_align(ui->screen_pull_down_btn_sleep_label, LV_ALIGN_CENTER, 0, 0); lv_obj_set_style_pad_all(ui->screen_pull_down_btn_sleep, 0, LV_STATE_DEFAULT); lv_obj_set_width(ui->screen_pull_down_btn_sleep_label, LV_PCT(100)); //Write style for screen_pull_down_btn_sleep, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_pull_down_btn_sleep, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_pull_down_btn_sleep, lv_color_hex(0x29333b), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_pull_down_btn_sleep, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_width(ui->screen_pull_down_btn_sleep, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_pull_down_btn_sleep, 15, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_pull_down_btn_sleep, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_pull_down_btn_sleep, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_pull_down_btn_sleep, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_pull_down_btn_sleep, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_pull_down_btn_sleep, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); //Write style for screen_pull_down_btn_sleep, Part: LV_PART_MAIN, State: LV_STATE_CHECKED. lv_obj_set_style_bg_opa(ui->screen_pull_down_btn_sleep, 255, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_bg_color(ui->screen_pull_down_btn_sleep, lv_color_hex(0x29333b), LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_bg_grad_dir(ui->screen_pull_down_btn_sleep, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_border_width(ui->screen_pull_down_btn_sleep, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_radius(ui->screen_pull_down_btn_sleep, 15, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_shadow_width(ui->screen_pull_down_btn_sleep, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_color(ui->screen_pull_down_btn_sleep, lv_color_hex(0xf9f9f9), LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_font(ui->screen_pull_down_btn_sleep, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_opa(ui->screen_pull_down_btn_sleep, 255, LV_PART_MAIN|LV_STATE_CHECKED); //Write codes screen_pull_down_btn_restart ui->screen_pull_down_btn_restart = lv_button_create(ui->screen_pull_down); lv_obj_set_pos(ui->screen_pull_down_btn_restart, 80, 215); lv_obj_set_size(ui->screen_pull_down_btn_restart, 342, 60); ui->screen_pull_down_btn_restart_label = lv_label_create(ui->screen_pull_down_btn_restart); lv_label_set_text(ui->screen_pull_down_btn_restart_label, "重 启"); lv_label_set_long_mode(ui->screen_pull_down_btn_restart_label, LV_LABEL_LONG_WRAP); lv_obj_align(ui->screen_pull_down_btn_restart_label, LV_ALIGN_CENTER, 0, 0); lv_obj_set_style_pad_all(ui->screen_pull_down_btn_restart, 0, LV_STATE_DEFAULT); lv_obj_set_width(ui->screen_pull_down_btn_restart_label, LV_PCT(100)); //Write style for screen_pull_down_btn_restart, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_pull_down_btn_restart, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_pull_down_btn_restart, lv_color_hex(0x29333b), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_pull_down_btn_restart, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_width(ui->screen_pull_down_btn_restart, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_pull_down_btn_restart, 15, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_pull_down_btn_restart, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_pull_down_btn_restart, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_pull_down_btn_restart, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_pull_down_btn_restart, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_pull_down_btn_restart, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); //Write style for screen_pull_down_btn_restart, Part: LV_PART_MAIN, State: LV_STATE_CHECKED. lv_obj_set_style_bg_opa(ui->screen_pull_down_btn_restart, 255, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_bg_color(ui->screen_pull_down_btn_restart, lv_color_hex(0x29333b), LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_bg_grad_dir(ui->screen_pull_down_btn_restart, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_border_width(ui->screen_pull_down_btn_restart, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_radius(ui->screen_pull_down_btn_restart, 15, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_shadow_width(ui->screen_pull_down_btn_restart, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_color(ui->screen_pull_down_btn_restart, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_font(ui->screen_pull_down_btn_restart, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_opa(ui->screen_pull_down_btn_restart, 255, LV_PART_MAIN|LV_STATE_CHECKED); //Write codes screen_pull_down_btn_turnoff ui->screen_pull_down_btn_turnoff = lv_button_create(ui->screen_pull_down); lv_obj_set_pos(ui->screen_pull_down_btn_turnoff, 80, 295); lv_obj_set_size(ui->screen_pull_down_btn_turnoff, 342, 60); ui->screen_pull_down_btn_turnoff_label = lv_label_create(ui->screen_pull_down_btn_turnoff); lv_label_set_text(ui->screen_pull_down_btn_turnoff_label, "关 机"); lv_label_set_long_mode(ui->screen_pull_down_btn_turnoff_label, LV_LABEL_LONG_WRAP); lv_obj_align(ui->screen_pull_down_btn_turnoff_label, LV_ALIGN_CENTER, 0, 0); lv_obj_set_style_pad_all(ui->screen_pull_down_btn_turnoff, 0, LV_STATE_DEFAULT); lv_obj_set_width(ui->screen_pull_down_btn_turnoff_label, LV_PCT(100)); //Write style for screen_pull_down_btn_turnoff, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_pull_down_btn_turnoff, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_pull_down_btn_turnoff, lv_color_hex(0x29333b), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_pull_down_btn_turnoff, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_width(ui->screen_pull_down_btn_turnoff, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_pull_down_btn_turnoff, 15, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_pull_down_btn_turnoff, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_pull_down_btn_turnoff, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_pull_down_btn_turnoff, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_pull_down_btn_turnoff, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_pull_down_btn_turnoff, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); //Write style for screen_pull_down_btn_turnoff, Part: LV_PART_MAIN, State: LV_STATE_CHECKED. lv_obj_set_style_bg_opa(ui->screen_pull_down_btn_turnoff, 255, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_bg_color(ui->screen_pull_down_btn_turnoff, lv_color_hex(0x29333b), LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_bg_grad_dir(ui->screen_pull_down_btn_turnoff, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_border_width(ui->screen_pull_down_btn_turnoff, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_radius(ui->screen_pull_down_btn_turnoff, 15, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_shadow_width(ui->screen_pull_down_btn_turnoff, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_color(ui->screen_pull_down_btn_turnoff, lv_color_hex(0xfbfbfb), LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_font(ui->screen_pull_down_btn_turnoff, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_opa(ui->screen_pull_down_btn_turnoff, 255, LV_PART_MAIN|LV_STATE_CHECKED); //Write codes screen_pull_down_img_Sleep ui->screen_pull_down_img_Sleep = lv_image_create(ui->screen_pull_down); lv_obj_set_pos(ui->screen_pull_down_img_Sleep, 95, 75); lv_obj_set_size(ui->screen_pull_down_img_Sleep, 25, 25); lv_obj_add_flag(ui->screen_pull_down_img_Sleep, LV_OBJ_FLAG_CLICKABLE); lv_image_set_src(ui->screen_pull_down_img_Sleep, &_Sleep_RGB888_25x25); lv_image_set_pivot(ui->screen_pull_down_img_Sleep, 50,50); lv_image_set_rotation(ui->screen_pull_down_img_Sleep, 0); //Write style for screen_pull_down_img_Sleep, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_image_recolor_opa(ui->screen_pull_down_img_Sleep, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_image_opa(ui->screen_pull_down_img_Sleep, 255, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_pull_down_img_set ui->screen_pull_down_img_set = lv_image_create(ui->screen_pull_down); lv_obj_set_pos(ui->screen_pull_down_img_set, 95, 155); lv_obj_set_size(ui->screen_pull_down_img_set, 25, 25); lv_obj_add_flag(ui->screen_pull_down_img_set, LV_OBJ_FLAG_CLICKABLE); lv_image_set_src(ui->screen_pull_down_img_set, &_Setting_RGB888_25x25); lv_image_set_pivot(ui->screen_pull_down_img_set, 50,50); lv_image_set_rotation(ui->screen_pull_down_img_set, 0); //Write style for screen_pull_down_img_set, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_image_recolor_opa(ui->screen_pull_down_img_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_image_opa(ui->screen_pull_down_img_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_pull_down_img_restart ui->screen_pull_down_img_restart = lv_image_create(ui->screen_pull_down); lv_obj_set_pos(ui->screen_pull_down_img_restart, 95, 235); lv_obj_set_size(ui->screen_pull_down_img_restart, 25, 25); lv_obj_add_flag(ui->screen_pull_down_img_restart, LV_OBJ_FLAG_CLICKABLE); lv_image_set_src(ui->screen_pull_down_img_restart, &_Restart_RGB888_25x25); lv_image_set_pivot(ui->screen_pull_down_img_restart, 50,50); lv_image_set_rotation(ui->screen_pull_down_img_restart, 0); //Write style for screen_pull_down_img_restart, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_image_recolor_opa(ui->screen_pull_down_img_restart, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_image_opa(ui->screen_pull_down_img_restart, 255, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_pull_down_img_turnoff ui->screen_pull_down_img_turnoff = lv_image_create(ui->screen_pull_down); lv_obj_set_pos(ui->screen_pull_down_img_turnoff, 95, 313); lv_obj_set_size(ui->screen_pull_down_img_turnoff, 25, 25); lv_obj_add_flag(ui->screen_pull_down_img_turnoff, LV_OBJ_FLAG_CLICKABLE); lv_image_set_src(ui->screen_pull_down_img_turnoff, &_Shut_Down_RGB888_25x25); lv_image_set_pivot(ui->screen_pull_down_img_turnoff, 50,50); lv_image_set_rotation(ui->screen_pull_down_img_turnoff, 0); //Write style for screen_pull_down_img_turnoff, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_image_recolor_opa(ui->screen_pull_down_img_turnoff, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_image_opa(ui->screen_pull_down_img_turnoff, 255, LV_PART_MAIN|LV_STATE_DEFAULT); //The custom code of screen_pull_down. //Update current screen layout. lv_obj_update_layout(ui->screen_pull_down); //Init events for screen. events_init_screen_pull_down(ui); }