/* * 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" #include "esp_log.h" void setup_scr_screen_fortune_text(lv_ui *ui) { // ESP_LOGI("setup_scr", ">>> %s", __func__); //Write codes screen_fortune_text ui->screen_fortune_text = lv_obj_create(NULL); lv_obj_set_size(ui->screen_fortune_text, 502, 410); lv_obj_set_scrollbar_mode(ui->screen_fortune_text, LV_SCROLLBAR_MODE_OFF); //Write style for screen_fortune_text, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_fortune_text, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_fortune_text, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_fortune_text, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_fortune_text_img_zodiacs ui->screen_fortune_text_img_zodiacs = lv_image_create(ui->screen_fortune_text); lv_obj_set_pos(ui->screen_fortune_text_img_zodiacs, 60, 65); lv_obj_set_size(ui->screen_fortune_text_img_zodiacs, 382, 280); lv_obj_add_flag(ui->screen_fortune_text_img_zodiacs, LV_OBJ_FLAG_CLICKABLE); lv_image_set_src(ui->screen_fortune_text_img_zodiacs, &_image_zodiacs_RGB888_382x280); lv_image_set_pivot(ui->screen_fortune_text_img_zodiacs, 50,50); lv_image_set_rotation(ui->screen_fortune_text_img_zodiacs, 0); //Write style for screen_fortune_text_img_zodiacs, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_image_recolor_opa(ui->screen_fortune_text_img_zodiacs, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_image_opa(ui->screen_fortune_text_img_zodiacs, 255, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_fortune_text_label_fotune ui->screen_fortune_text_label_fotune = lv_label_create(ui->screen_fortune_text); lv_obj_set_pos(ui->screen_fortune_text_label_fotune, 175, 129); lv_obj_set_size(ui->screen_fortune_text_label_fotune, 164, 159); lv_label_set_text_static(ui->screen_fortune_text_label_fotune, "凡事皆顺意好运常围绕,小财入账生活多美好\n\n"); lv_label_set_long_mode(ui->screen_fortune_text_label_fotune, LV_LABEL_LONG_WRAP); //Write style for screen_fortune_text_label_fotune, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_border_width(ui->screen_fortune_text_label_fotune, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_fortune_text_label_fotune, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_fortune_text_label_fotune, lv_color_hex(0x18cc84), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_fortune_text_label_fotune, &lv_font_montserrat_14, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_fortune_text_label_fotune, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_letter_space(ui->screen_fortune_text_label_fotune, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_line_space(ui->screen_fortune_text_label_fotune, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_fortune_text_label_fotune, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_fortune_text_label_fotune, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_top(ui->screen_fortune_text_label_fotune, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_fortune_text_label_fotune, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_bottom(ui->screen_fortune_text_label_fotune, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_left(ui->screen_fortune_text_label_fotune, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_fortune_text_label_fotune, 0, LV_PART_MAIN|LV_STATE_DEFAULT); //Write codes screen_fortune_text_btn_2 ui->screen_fortune_text_btn_2 = lv_button_create(ui->screen_fortune_text); lv_obj_set_pos(ui->screen_fortune_text_btn_2, 25, 30); lv_obj_set_size(ui->screen_fortune_text_btn_2, 100, 60); ui->screen_fortune_text_btn_2_label = lv_label_create(ui->screen_fortune_text_btn_2); lv_label_set_text(ui->screen_fortune_text_btn_2_label, ""); lv_label_set_long_mode(ui->screen_fortune_text_btn_2_label, LV_LABEL_LONG_WRAP); lv_obj_align(ui->screen_fortune_text_btn_2_label, LV_ALIGN_CENTER, 0, 0); lv_obj_set_style_pad_all(ui->screen_fortune_text_btn_2, 0, LV_STATE_DEFAULT); lv_obj_set_width(ui->screen_fortune_text_btn_2_label, LV_PCT(100)); //Write style for screen_fortune_text_btn_2, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. lv_obj_set_style_bg_opa(ui->screen_fortune_text_btn_2, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_fortune_text_btn_2, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_fortune_text_btn_2, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_width(ui->screen_fortune_text_btn_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_fortune_text_btn_2, 17, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_fortune_text_btn_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_fortune_text_btn_2, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_font(ui->screen_fortune_text_btn_2, &lv_font_iconfont_25, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_opa(ui->screen_fortune_text_btn_2, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_align(ui->screen_fortune_text_btn_2, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); //Write style for screen_fortune_text_btn_2, Part: LV_PART_MAIN, State: LV_STATE_CHECKED. lv_obj_set_style_bg_opa(ui->screen_fortune_text_btn_2, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_border_width(ui->screen_fortune_text_btn_2, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_radius(ui->screen_fortune_text_btn_2, 5, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_shadow_width(ui->screen_fortune_text_btn_2, 0, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_color(ui->screen_fortune_text_btn_2, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_font(ui->screen_fortune_text_btn_2, &lv_font_iconfont_25, LV_PART_MAIN|LV_STATE_CHECKED); lv_obj_set_style_text_opa(ui->screen_fortune_text_btn_2, 255, LV_PART_MAIN|LV_STATE_CHECKED); //The custom code of screen_fortune_text. //Update current screen layout. // ESP_LOGI("setup_scr", "%s: lv_obj_update_layout", __func__); lv_obj_update_layout(ui->screen_fortune_text); //Init events for screen. // ESP_LOGI("setup_scr", "%s: events_init_screen_fortune_text", __func__); events_init_screen_fortune_text(ui); // ESP_LOGI("setup_scr", "<<< %s done", __func__); }