From cb484d4361849a641e7f29599326ff956f61b5c6 Mon Sep 17 00:00:00 2001 From: zyj Date: Thu, 23 Nov 2023 20:17:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=A2=84=E8=A7=88=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=B8=8B=E9=94=AE=E6=98=BE=E7=A4=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 78 ++++++++++++++++++- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c index 96d3b1f1e..d2ecd68d0 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c @@ -69,6 +69,68 @@ static BOOL g_PhotoBgInitFileSys = FALSE; static BOOL g_SysStrg_Chg = FALSE; //#NT#2023/11/21#Eric - end +static lv_obj_t *g_preview_info_msgbox = NULL; +static lv_obj_t *g_preview_info_label = NULL; +static int g_preview_info_ishidden = true; +static lv_task_t* preview_info_task = NULL; +static void preview_info_task_cb(lv_task_t* task) +{ + static int count = 0; + char CamInfoStr[256] = {0}; + char tmpStr[64] = {0}; + + lv_obj_set_hidden(g_preview_info_msgbox, g_preview_info_ishidden); + + if(count % 10 == 0) + { + count = 0; + + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + + struct tm DayTime = hwclock_get_time(TIME_ID_CURRENT); + + for(int i=0;i<4;i++) + { + memset(tmpStr, 0, sizeof(tmpStr)); + switch(i) + { + case 0: + sprintf(tmpStr, "%02ld:%02ld:%04ld %02ld:%02ld:%02ld\n", + DayTime.tm_mon, DayTime.tm_mday, DayTime.tm_year, DayTime.tm_hour, DayTime.tm_min, DayTime.tm_sec); + strcat(CamInfoStr, tmpStr); + break; + case 1: + sprintf(tmpStr, "%s\n", puiPara->ServiceProvider); + strcat(CamInfoStr, tmpStr); + break; + case 2: + if(strlen(puiPara->Longitude) == 0) + strcat(CamInfoStr, "\n"); + else + { + sprintf(tmpStr, "LON %s\n", puiPara->Longitude); + strcat(CamInfoStr, tmpStr); + } + break; + case 3: + if(strlen(puiPara->Latitude) == 0) + strcat(CamInfoStr, "\n"); + else + { + sprintf(tmpStr, "LAT %s\n", puiPara->Latitude); + strcat(CamInfoStr, tmpStr); + } + break; + default: + break; + } + } + lv_label_set_text_fmt(g_preview_info_label, CamInfoStr); + } + + count++; + return; +} typedef struct _UIFlowInfoTypePhoto { @@ -1580,7 +1642,6 @@ static void UIFlowPhoto_NVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* m sf_show_send_text(obj, msg->paramArray[0]); break; } - default: break; @@ -1622,6 +1683,7 @@ static void UIFlowPhoto_Key(lv_obj_t* obj, uint32_t key) case LV_USER_KEY_NEXT: case LV_USER_KEY_ZOOMIN: { + g_preview_info_ishidden = true; KeyDownPressingTimeMs = 0; break; CHKPNT; @@ -1714,6 +1776,7 @@ void UIFlowPhtot_KeyLongPress(lv_obj_t* obj, uint32_t key) } case LV_USER_KEY_NEXT: { + g_preview_info_ishidden = false; KeyDownPressingTimeMs += LONG_PRESS_INTERVAL; if (5 * 1000 <= KeyDownPressingTimeMs) { @@ -1735,7 +1798,18 @@ void UIFlowPhotoEventCallback(lv_obj_t* obj, lv_event_t event) switch(event) { case LV_PLUGIN_EVENT_SCR_OPEN: - UIFlowPhoto_ScrOpen(obj); + UIFlowPhoto_ScrOpen(obj);//LV_ALIGN_IN_RIGHT_MID + + if(preview_info_task == NULL && g_preview_info_msgbox == NULL && g_preview_info_label == NULL){ + g_preview_info_msgbox = lv_btn_create(obj, button_msg_bg_scr_uiflowwrnmsg); + g_preview_info_ishidden = true; + lv_obj_set_hidden(g_preview_info_msgbox, g_preview_info_ishidden); + g_preview_info_label = lv_label_create(g_preview_info_msgbox, label_msg_scr_uiflowwrnmsg); + lv_obj_align(g_preview_info_label, g_preview_info_msgbox, LV_ALIGN_CENTER, 0, -30); + lv_label_set_align(g_preview_info_label, LV_LABEL_ALIGN_CENTER); + preview_info_task = lv_task_create(preview_info_task_cb, 100, LV_TASK_PRIO_MID, NULL); + } + #define PASSWORD_OPENED 1 #define PASSWORD_NOT_OPENED 0 static int passwordOpened = PASSWORD_NOT_OPENED;