/* * Copyright 2024 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_init(lv_ui *ui) { //Write codes screen_init ui->screen_init = lv_obj_create(NULL); lv_obj_set_size(ui->screen_init, 320, 240); lv_obj_set_scrollbar_mode(ui->screen_init, LV_SCROLLBAR_MODE_OFF); //Write style for screen_init, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_init, 206, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_init, lv_color_hex(0x006aff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_init, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_init_img_1 ui->screen_init_img_1 = lv_img_create(ui->screen_init); lv_obj_add_flag(ui->screen_init_img_1, LV_OBJ_FLAG_CLICKABLE); lv_img_set_src(ui->screen_init_img_1, &_logo_alpha_188x80); lv_img_set_pivot(ui->screen_init_img_1, 50,50); lv_img_set_angle(ui->screen_init_img_1, 0); lv_obj_set_pos(ui->screen_init_img_1, 66, 36); lv_obj_set_size(ui->screen_init_img_1, 188, 80); //Write style for screen_init_img_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_img_recolor_opa(ui->screen_init_img_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_img_opa(ui->screen_init_img_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_init_img_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_clip_corner(ui->screen_init_img_1, true, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_init_label_1 ui->screen_init_label_1 = lv_label_create(ui->screen_init); lv_label_set_text(ui->screen_init_label_1, "Welcome"); lv_label_set_long_mode(ui->screen_init_label_1, LV_LABEL_LONG_WRAP); lv_obj_set_pos(ui->screen_init_label_1, 83, 134); lv_obj_set_size(ui->screen_init_label_1, 154, 24); //Write style for screen_init_label_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_init_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_init_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_init_label_1, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_init_label_1, &lv_font_montserratMedium_26, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_init_label_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_init_label_1, 2, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_init_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_init_label_1, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_init_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_init_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_init_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_init_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_init_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_init_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_init_bar_1 ui->screen_init_bar_1 = lv_bar_create(ui->screen_init); lv_obj_set_style_anim_time(ui->screen_init_bar_1, 1000, 0); lv_bar_set_mode(ui->screen_init_bar_1, LV_BAR_MODE_NORMAL); lv_bar_set_range(ui->screen_init_bar_1, 0, 100); lv_bar_set_value(ui->screen_init_bar_1, 50, LV_ANIM_OFF); lv_obj_set_pos(ui->screen_init_bar_1, 83, 182); lv_obj_set_size(ui->screen_init_bar_1, 154, 20); //Write style for screen_init_bar_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_init_bar_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_init_bar_1, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_init_bar_1, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_init_bar_1, 10, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_init_bar_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write style for screen_init_bar_1, Part: LV_PART_INDICATOR, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_init_bar_1, 176, LV_PART_INDICATOR|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_init_bar_1, lv_color_hex(0xff8f00), LV_PART_INDICATOR|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_init_bar_1, LV_GRAD_DIR_NONE, LV_PART_INDICATOR|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_init_bar_1, 10, LV_PART_INDICATOR|LV_STATE_DEFAULT); //The custom code of screen_init. //Update current screen layout. lv_obj_update_layout(ui->screen_init); }