From f785b8031b5a2abc73c2a19090ca566927be1e05 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Tue, 28 Nov 2023 17:04:51 +0800 Subject: [PATCH] Fixed bug number 10190. --- .../UIFlowMenuCommonConfirmEventCallback.c | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmEventCallback.c index c960761ca..d2c811464 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmEventCallback.c @@ -30,6 +30,15 @@ static void set_indev_keypad_group(lv_obj_t* obj) lv_indev_t* indev = lv_plugin_find_indev_by_type(LV_INDEV_TYPE_KEYPAD); lv_indev_set_group(indev, gp); } +static lv_obj_t *Confirm_label = NULL; +static void set_msbox_hidden(bool hidden) +{ + lv_obj_set_hidden(msgbox, hidden); + if (Confirm_label) + { + lv_obj_set_hidden(Confirm_label, hidden); + } +} // -------------------------------------------------------------------------- // Common Function // -------------------------------------------------------------------------- @@ -189,7 +198,6 @@ static void init_style(void) -static lv_obj_t *Confirm_label = NULL; void UIFlowMenuCommonConfirmAPI_Open(uint32_t itemID) { @@ -213,7 +221,7 @@ void UIFlowMenuCommonConfirmAPI_Open(uint32_t itemID) msgbox = lv_msgbox_create(UIFlowMenuCommonConfirm, message_box_1_scr_uiflowmenucommonconfirm); /* remember to set duplicate obj visible */ - lv_obj_set_hidden(msgbox, false); + set_msbox_hidden(false); /* anim time won't be copied by lvgl, config it manually */ uint16_t anim_time = lv_msgbox_get_anim_time(message_box_1_scr_uiflowmenucommonconfirm); @@ -483,41 +491,41 @@ static void UIFlowMenuCommonConfirm_MessageBox_ValueChanged(lv_obj_t* obj, uint3 } else if (gBKGEvt == NVTEVT_BKW_FORMAT_CARD) { if(sf_in_card_exist() == TRUE) { - lv_obj_set_hidden(msgbox, true); + set_msbox_hidden( true); UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_FORMATING, 20000); BKG_PostEvent(NVTEVT_BKW_FORMAT_CARD); } else { - lv_obj_set_hidden(msgbox, true); + set_msbox_hidden( true); UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_NO_SD, 3000); } } else if (gBKGEvt == NVTEVT_BKW_CAMERA_FW_UPGRADE) { if(sf_cardv_battery_value_get() < 40) { - lv_obj_set_hidden(msgbox, true); + set_msbox_hidden( true); UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_UPGRADE_ERR, 3000); } else { - lv_obj_set_hidden(msgbox, true); + set_msbox_hidden( true); UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_UPGRADING, 60000); BKG_PostEvent(gBKGEvt); } } else if (gBKGEvt == NVTEVT_BKW_MODULE_FW_UPGRADE) { if(sf_cardv_battery_value_get() < 40) { - lv_obj_set_hidden(msgbox, true); + set_msbox_hidden( true); UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_UPGRADE_LOWBAT, 3000); } else { - lv_obj_set_hidden(msgbox, true); + set_msbox_hidden( true); UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_UPGRADING, 60000); BKG_PostEvent(gBKGEvt); } } else if (gBKGEvt == NVTEVT_BKW_RESET) { - lv_obj_set_hidden(msgbox, true); + set_msbox_hidden( true); UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_COMPLETED, 10000); BKG_PostEvent(gBKGEvt); } else if (gBKGEvt == NVTEVT_BKW_ENTER_WORK_MODE)