/* * Copyright 2025 NXP * NXP Confidential and 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_langinfopage(lv_ui *ui) { //Write codes langinfopage ui->langinfopage = lv_obj_create(NULL); lv_obj_set_size(ui->langinfopage, 480, 480); lv_obj_set_scrollbar_mode(ui->langinfopage, LV_SCROLLBAR_MODE_OFF); //Write style for langinfopage, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->langinfopage, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->langinfopage, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->langinfopage, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes langinfopage_returnbg ui->langinfopage_returnbg = lv_img_create(ui->langinfopage); lv_obj_add_flag(ui->langinfopage_returnbg, LV_OBJ_FLAG_CLICKABLE); lv_img_set_src(ui->langinfopage_returnbg, LVGL_PATH(returnbg.png)); lv_img_set_pivot(ui->langinfopage_returnbg, 50,50); lv_img_set_angle(ui->langinfopage_returnbg, 0); lv_obj_set_pos(ui->langinfopage_returnbg, 23, 27); lv_obj_set_size(ui->langinfopage_returnbg, 14, 26); //Write style for langinfopage_returnbg, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_img_opa(ui->langinfopage_returnbg, 255, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes langinfopage_retrunbtn ui->langinfopage_retrunbtn = lv_btn_create(ui->langinfopage); //ui->langinfopage_retrunbtn_label = lv_label_create(ui->langinfopage_retrunbtn); //lv_label_set_text(ui->langinfopage_retrunbtn_label, ""); //lv_label_set_long_mode(ui->langinfopage_retrunbtn_label, LV_LABEL_LONG_WRAP); //lv_obj_align(ui->langinfopage_retrunbtn_label, LV_ALIGN_CENTER, 0, 0); lv_obj_set_style_pad_all(ui->langinfopage_retrunbtn, 0, LV_STATE_DEFAULT); //lv_obj_set_width(ui->langinfopage_retrunbtn_label, LV_PCT(100)); lv_obj_set_pos(ui->langinfopage_retrunbtn, 8, 8); lv_obj_set_size(ui->langinfopage_retrunbtn, 60, 60); //Write style for langinfopage_retrunbtn, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->langinfopage_retrunbtn, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_width(ui->langinfopage_retrunbtn, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->langinfopage_retrunbtn, 5, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->langinfopage_retrunbtn, 0, LV_PART_MAIN|LV_STATE_DEFAULT); // lv_obj_set_style_text_color(ui->langinfopage_retrunbtn, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); // lv_obj_set_style_text_font(ui->langinfopage_retrunbtn, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT); // lv_obj_set_style_text_opa(ui->langinfopage_retrunbtn, 255, LV_PART_MAIN|LV_STATE_DEFAULT); // lv_obj_set_style_text_align(ui->langinfopage_retrunbtn, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes langinfopage_label_1 ui->langinfopage_label_1 = lv_label_create(ui->langinfopage); lv_label_set_text(ui->langinfopage_label_1,Menu_List[GET_nvs_Sys_Info_language()][MENU_LIST_SetLanguange]); lv_label_set_long_mode(ui->langinfopage_label_1, LV_LABEL_LONG_DOT); lv_obj_set_pos(ui->langinfopage_label_1, 46, 30); lv_obj_set_size(ui->langinfopage_label_1, 200, 24); //Write style for langinfopage_label_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->langinfopage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->langinfopage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->langinfopage_label_1, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->langinfopage_label_1, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->langinfopage_label_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->langinfopage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->langinfopage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->langinfopage_label_1, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->langinfopage_label_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->langinfopage_label_1, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->langinfopage_label_1, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->langinfopage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->langinfopage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->langinfopage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->langinfopage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->langinfopage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //The custom code of langinfopage. //Write codes langinfopage_chinesebtn ui->langinfopage_chinesebtn = lv_btn_create(ui->langinfopage); lv_obj_set_pos(ui->langinfopage_chinesebtn, 25, 70); lv_obj_set_size(ui->langinfopage_chinesebtn, 430, 50); //Write style state: LV_STATE_DEFAULT for style_langinfopage_chinesebtn_main_main_default static lv_style_t style_langinfopage_chinesebtn_main_main_default; lv_style_reset(&style_langinfopage_chinesebtn_main_main_default); lv_style_set_radius(&style_langinfopage_chinesebtn_main_main_default, 10); lv_style_set_bg_color(&style_langinfopage_chinesebtn_main_main_default, lv_color_make(0x21, 0x21, 0x21)); lv_style_set_bg_grad_color(&style_langinfopage_chinesebtn_main_main_default, lv_color_make(0x21, 0x21, 0x21)); lv_style_set_bg_grad_dir(&style_langinfopage_chinesebtn_main_main_default, LV_GRAD_DIR_VER); lv_style_set_bg_opa(&style_langinfopage_chinesebtn_main_main_default, 255); lv_style_set_shadow_color(&style_langinfopage_chinesebtn_main_main_default, lv_color_make(0x21, 0x95, 0xf6)); lv_style_set_shadow_opa(&style_langinfopage_chinesebtn_main_main_default, 0); lv_style_set_border_color(&style_langinfopage_chinesebtn_main_main_default, lv_color_make(0xff, 0xff, 0xff)); lv_style_set_border_width(&style_langinfopage_chinesebtn_main_main_default, 0); lv_style_set_border_opa(&style_langinfopage_chinesebtn_main_main_default, 255); lv_obj_add_style(ui->langinfopage_chinesebtn, &style_langinfopage_chinesebtn_main_main_default, LV_PART_MAIN|LV_STATE_DEFAULT); ui->langinfopage_chinesebtn_label = lv_label_create(ui->langinfopage_chinesebtn); lv_label_set_text(ui->langinfopage_chinesebtn_label, "中文"); lv_obj_set_style_text_color(ui->langinfopage_chinesebtn_label, lv_color_make(0xff, 0xff, 0xff), LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->langinfopage_chinesebtn_label, &lv_font_simsun_16, LV_STATE_DEFAULT); lv_obj_set_style_pad_all(ui->langinfopage_chinesebtn, 0, LV_STATE_DEFAULT); lv_obj_align(ui->langinfopage_chinesebtn_label, LV_ALIGN_CENTER, 0, 0); //Write codes langinfopage_chineseselectimg ui->langinfopage_chineseselectimg = lv_img_create(ui->langinfopage); lv_obj_set_pos(ui->langinfopage_chineseselectimg, 418, 83); lv_obj_set_size(ui->langinfopage_chineseselectimg, 25, 25); //Write style state: LV_STATE_DEFAULT for style_langinfopage_chineseselectimg_main_main_default static lv_style_t style_langinfopage_chineseselectimg_main_main_default; lv_style_reset(&style_langinfopage_chineseselectimg_main_main_default); lv_style_set_img_recolor(&style_langinfopage_chineseselectimg_main_main_default, lv_color_make(0xff, 0xff, 0xff)); lv_style_set_img_recolor_opa(&style_langinfopage_chineseselectimg_main_main_default, 0); if(GET_nvs_Sys_Info_language()==LANG_CH) { lv_style_set_img_opa(&style_langinfopage_chineseselectimg_main_main_default, 255); } else { lv_style_set_img_opa(&style_langinfopage_chineseselectimg_main_main_default, 0); } lv_obj_add_style(ui->langinfopage_chineseselectimg, &style_langinfopage_chineseselectimg_main_main_default, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_add_flag(ui->langinfopage_chineseselectimg, LV_OBJ_FLAG_CLICKABLE); lv_img_set_src(ui->langinfopage_chineseselectimg,LVGL_PATH(dui.png)); lv_img_set_pivot(ui->langinfopage_chineseselectimg, 0,0); lv_img_set_angle(ui->langinfopage_chineseselectimg, 0); //Write codes langinfopage_englishbtn ui->langinfopage_englishbtn = lv_btn_create(ui->langinfopage); lv_obj_set_pos(ui->langinfopage_englishbtn, 25, 125); lv_obj_set_size(ui->langinfopage_englishbtn, 430, 50); //Write style state: LV_STATE_DEFAULT for style_langinfopage_englishbtn_main_main_default static lv_style_t style_langinfopage_englishbtn_main_main_default; lv_style_reset(&style_langinfopage_englishbtn_main_main_default); lv_style_set_radius(&style_langinfopage_englishbtn_main_main_default, 10); lv_style_set_bg_color(&style_langinfopage_englishbtn_main_main_default, lv_color_make(0x21, 0x21, 0x21)); lv_style_set_bg_grad_color(&style_langinfopage_englishbtn_main_main_default, lv_color_make(0x21, 0x21, 0x21)); lv_style_set_bg_grad_dir(&style_langinfopage_englishbtn_main_main_default, LV_GRAD_DIR_VER); lv_style_set_bg_opa(&style_langinfopage_englishbtn_main_main_default, 255); lv_style_set_shadow_color(&style_langinfopage_englishbtn_main_main_default, lv_color_make(0x21, 0x95, 0xf6)); lv_style_set_shadow_opa(&style_langinfopage_englishbtn_main_main_default, 0); lv_style_set_border_color(&style_langinfopage_englishbtn_main_main_default, lv_color_make(0xff, 0xff, 0xff)); lv_style_set_border_width(&style_langinfopage_englishbtn_main_main_default, 0); lv_style_set_border_opa(&style_langinfopage_englishbtn_main_main_default, 255); lv_obj_add_style(ui->langinfopage_englishbtn, &style_langinfopage_englishbtn_main_main_default, LV_PART_MAIN|LV_STATE_DEFAULT); ui->langinfopage_englishbtn_label = lv_label_create(ui->langinfopage_englishbtn); lv_label_set_text(ui->langinfopage_englishbtn_label, "English"); lv_obj_set_style_text_color(ui->langinfopage_englishbtn_label, lv_color_make(0xff, 0xff, 0xff), LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->langinfopage_englishbtn_label, &lv_font_simsun_16, LV_STATE_DEFAULT); lv_obj_set_style_pad_all(ui->langinfopage_englishbtn, 0, LV_STATE_DEFAULT); lv_obj_align(ui->langinfopage_englishbtn_label, LV_ALIGN_CENTER, 0, 0); //Write codes langinfopage_egnlishselectimg ui->langinfopage_egnlishselectimg = lv_img_create(ui->langinfopage); lv_obj_set_pos(ui->langinfopage_egnlishselectimg, 418, 138); lv_obj_set_size(ui->langinfopage_egnlishselectimg, 25, 25); //Write style state: LV_STATE_DEFAULT for style_langinfopage_egnlishselectimg_main_main_default static lv_style_t style_langinfopage_egnlishselectimg_main_main_default; lv_style_reset(&style_langinfopage_egnlishselectimg_main_main_default); lv_style_set_img_recolor(&style_langinfopage_egnlishselectimg_main_main_default, lv_color_make(0xff, 0xff, 0xff)); lv_style_set_img_recolor_opa(&style_langinfopage_egnlishselectimg_main_main_default, 0); if(GET_nvs_Sys_Info_language()==LANG_EN) { lv_style_set_img_opa(&style_langinfopage_egnlishselectimg_main_main_default, 255); } else { lv_style_set_img_opa(&style_langinfopage_egnlishselectimg_main_main_default, 0); } lv_obj_add_style(ui->langinfopage_egnlishselectimg, &style_langinfopage_egnlishselectimg_main_main_default, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_add_flag(ui->langinfopage_egnlishselectimg, LV_OBJ_FLAG_CLICKABLE); lv_img_set_src(ui->langinfopage_egnlishselectimg,LVGL_PATH(dui.png)); lv_img_set_pivot(ui->langinfopage_egnlishselectimg, 0,0); lv_img_set_angle(ui->langinfopage_egnlishselectimg, 0); //Update current screen layout. lv_obj_update_layout(ui->langinfopage); //Init events for screen. events_init_langinfopage(ui); }