jiamin
April 26, 2021, 3:00am
1
Description
when i create some obj on screen,i dont want to refresh the total screen,i want to refresh a specific area.
example:
screen(320240),i want to refresh (320 220),because i dont want refresh the top of screen(320*20) ,it’s the status area to update battery and signal.
would you give some guidance?
jiamin
April 26, 2021, 3:25am
2
when i switch to other page,i can clean the area(320*220)
would you want something like this?
you could do this things
void ui_create(void)
{
ui_cont = lv_cont_create(lv_scr_act(), NULL);
title_cont = lv_cont_create(ui_cont , NULL);
title_panel_create(ui_cont );
page_cont = lv_cont_create(ui_cont , NULL);
page_panel_create(page_cont );
}
1 Like
juneofive:
title_panel_create
Hello, how do you realize the up and down sliding of your screen? Can you give me a demo?
jiamin
April 26, 2021, 9:24am
7
i switch pages by keyboad,will refer to your sample
jiamin
April 26, 2021, 9:30am
8
would you guide me how to refresh specific area when switch pages?
jiamin
April 26, 2021, 11:01am
9
would you share sample to update battrery and signal ?
LVGL pretty much decides when to refresh objects for you. As long as the page and status bar are not overlapping, the status bar should only refresh if you update the data in one of its widgets.
jiamin
April 27, 2021, 2:31am
11
would you share a sample to update status bar and page?
you just need update the status data in a task.
void title_create(void)
{
...
...
...
title_data_update_handle = lv_task_create(title_data_update_cb,100, LV_TASK_PRIO_LOW, NULL);
}
void title_data_update_cb(lv_task_t *task)
{
lv_img_set_src(signal_img,&img_singal[sgnal_val]);
lv_bar_set_value(bar_battery, bat_val , LV_ANIM_OFF);
}
jiamin
April 27, 2021, 3:15am
14
would you give some guidance about page switch?when i switch pages,always refresh all screen.Maybe my code issue?
how do you switch pages?
would you give some guidance about page switch?when i switch pages,always refresh all screen.Maybe my code issue?
how do you switch pages?
I don’t konw how did you switch the pages,if show me your code ,mybe i could give you some advices.