Closing screen ok.

This commit is contained in:
xiaojiazhu 2023-11-17 14:21:00 +08:00
parent 295ac6478e
commit 7f2b5dfcc0

View File

@ -1,5 +1,6 @@
#include "UIFlowLVGL/UIFlowLVGL.h"
#include <stdio.h>
#include <unistd.h>
#define UPDATE_TIMEER_MS 200
static lv_task_t* update_timer = NULL;
static lv_group_t* gp = NULL;
@ -16,23 +17,19 @@ static void set_indev_keypad_group(lv_obj_t* obj)
static void task_update_timer_cb(lv_task_t* task)
{
// static short closing_index = 0;
// static unsigned int time_ms = 3 * 1000;
// #define BUFF_LENGTH 32
// char buf[BUFF_LENGTH] = {0};
// lv_plugin_res_id res[] = {
// LV_PLUGIN_IMG_ID_SF_BUSY_1,
// LV_PLUGIN_IMG_ID_SF_BUSY_2,
// LV_PLUGIN_IMG_ID_SF_BUSY_3,
// LV_PLUGIN_IMG_ID_SF_BUSY_4
// };
// closing_index = closing_index % 4;
// lv_plugin_img_set_src(image_closing_scr_uiflowclose, res[closing_index]);
// snprintf(buf, BUFF_LENGTH, "%ss", time_ms / 1000);
// lv_label_set_text(label_1_scr_uiflowclose, buf);
// // lv_plugin_label_set_text();
// time_ms -= UPDATE_TIMEER_MS;
// closing_index ++;
static short closing_index = 0;
static unsigned int time_ms = 3 * 1000;
lv_plugin_res_id res[] = {
LV_PLUGIN_IMG_ID_SF_BUSY_1,
LV_PLUGIN_IMG_ID_SF_BUSY_2,
LV_PLUGIN_IMG_ID_SF_BUSY_3,
LV_PLUGIN_IMG_ID_SF_BUSY_4
};
closing_index = closing_index % 4;
lv_plugin_img_set_src(image_closing_scr_uiflowclose, res[closing_index]);
lv_label_set_text_fmt(label_1_scr_uiflowclose, "%ds", time_ms / 1000);
time_ms -= UPDATE_TIMEER_MS;
closing_index ++;
}
void OpenClosingScreen(void)
{