123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- /*
- * Copyright 2025 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 "widgets_init.h"
- void ui_init_style(lv_style_t * style)
- {
- if (style->prop_cnt > 1)
- lv_style_reset(style);
- else
- lv_style_init(style);
- }
- void ui_load_scr_animation(lv_ui *ui, lv_obj_t ** new_scr, bool new_scr_del, bool * old_scr_del, ui_setup_scr_t setup_scr,
- lv_screen_load_anim_t anim_type, uint32_t time, uint32_t delay, bool is_clean, bool auto_del)
- {
- lv_obj_t * act_scr = lv_screen_active();
- #if LV_USE_GUIDER_SIMULATOR && LV_USE_FREEMASTER
- #include "gg_external_data.h"
- if(auto_del) {
- gg_edata_task_clear(act_scr);
- }
- #endif
- if (auto_del && is_clean) {
- lv_obj_clean(act_scr);
- }
- if (new_scr_del) {
- setup_scr(ui);
- }
- lv_screen_load_anim(*new_scr, anim_type, time, delay, auto_del);
- *old_scr_del = auto_del;
- }
- void ui_animation(void * var, uint32_t duration, int32_t delay, int32_t start_value, int32_t end_value, lv_anim_path_cb_t path_cb,
- uint32_t repeat_cnt, uint32_t repeat_delay, uint32_t playback_time, uint32_t playback_delay,
- lv_anim_exec_xcb_t exec_cb, lv_anim_start_cb_t start_cb, lv_anim_completed_cb_t ready_cb, lv_anim_deleted_cb_t deleted_cb)
- {
- lv_anim_t anim;
- lv_anim_init(&anim);
- lv_anim_set_var(&anim, var);
- lv_anim_set_exec_cb(&anim, exec_cb);
- lv_anim_set_values(&anim, start_value, end_value);
- lv_anim_set_time(&anim, duration);
- lv_anim_set_delay(&anim, delay);
- lv_anim_set_path_cb(&anim, path_cb);
- lv_anim_set_repeat_count(&anim, repeat_cnt);
- lv_anim_set_repeat_delay(&anim, repeat_delay);
- lv_anim_set_playback_time(&anim, playback_time);
- lv_anim_set_playback_delay(&anim, playback_delay);
- if (start_cb) {
- lv_anim_set_start_cb(&anim, start_cb);
- }
- if (ready_cb) {
- lv_anim_set_completed_cb(&anim, ready_cb);
- }
- if (deleted_cb) {
- lv_anim_set_deleted_cb(&anim, deleted_cb);
- }
- lv_anim_start(&anim);
- }
- void init_scr_del_flag(lv_ui *ui)
- {
- ui->screen_main_del = true;
- ui->SettingPage_del = true;
- ui->FactorySettingPage_del = true;
- ui->OTAPage_del = true;
- }
- void setup_bottom_layer(void)
- {
- lv_theme_apply(lv_layer_bottom());
- }
- void setup_ui(lv_ui *ui)
- {
- setup_bottom_layer();
- init_scr_del_flag(ui);
- init_keyboard(ui);
- setup_scr_screen_main(ui);
- lv_screen_load(ui->screen_main);
- }
- void video_play(lv_ui *ui)
- {
- }
- void init_keyboard(lv_ui *ui)
- {
- ui->g_kb_top_layer = lv_keyboard_create(lv_layer_top());
- lv_obj_add_event_cb(ui->g_kb_top_layer, kb_event_cb, LV_EVENT_ALL, NULL);
- lv_obj_add_flag(ui->g_kb_top_layer, LV_OBJ_FLAG_HIDDEN);
- lv_obj_set_style_text_font(ui->g_kb_top_layer, &lv_font_SourceHanSerifSC_Regular_18, LV_PART_MAIN|LV_STATE_DEFAULT);
- }
|