From c4aad2da7bef6fd5f68bba88c935e3da56c64273 Mon Sep 17 00:00:00 2001 From: xiehongyan Date: Sat, 20 Jan 2024 15:09:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=93=9D=E7=89=99=E8=BF=9E=E6=8E=A5=E5=8D=A1?= =?UTF-8?q?=E6=AD=BB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/cardv/SrcCode/Mode/UIModePhoto.c | 2 ++ .../Resource/Plugin/lv_plugin_common.c | 8 ++++---- .../UIFlowMenuCommonConfirmEventCallback.c | 17 +++++++++++------ .../UIFlowMenuCommonItemEventCallback.c | 14 ++++++++++++++ .../sf_app/code/source/wifi/sf_wifi_svr.c | 14 +++++++++++++- 5 files changed, 44 insertions(+), 11 deletions(-) diff --git a/code/application/source/cardv/SrcCode/Mode/UIModePhoto.c b/code/application/source/cardv/SrcCode/Mode/UIModePhoto.c index 99fef1a9a..9002bcfdb 100755 --- a/code/application/source/cardv/SrcCode/Mode/UIModePhoto.c +++ b/code/application/source/cardv/SrcCode/Mode/UIModePhoto.c @@ -22,9 +22,11 @@ int PRIMARY_MODE_PHOTO = -1; ///< Photo void ModePhoto_Open(void); void ModePhoto_Close(void); +extern UINT8 is_confirm; void ModePhoto_Open(void) { + is_confirm = 0; #if (PHOTO_MODE==ENABLE) Input_ResetMask(); Ux_SetActiveApp(&CustomPhotoObjCtrl); diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Plugin/lv_plugin_common.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Plugin/lv_plugin_common.c index d18639c72..a63800990 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Plugin/lv_plugin_common.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Plugin/lv_plugin_common.c @@ -784,8 +784,8 @@ LV_PLUG_RET lv_plugin_scr_close(lv_obj_t* scr, const void * data) return LV_PLUG_SUCCESS; /* avoid recursively close */ - if(lv_plugin_scr_is_ready_to_be_closed(scr)) - return LV_PLUG_SUCCESS; + //if(lv_plugin_scr_is_ready_to_be_closed(scr)) + //return LV_PLUG_SUCCESS; /* add all screens ready to be closed LV_STATE_DISABLED */ child = NULL; @@ -796,8 +796,8 @@ LV_PLUG_RET lv_plugin_scr_close(lv_obj_t* scr, const void * data) do { next_child = lv_obj_get_child(inter_param->root_scr, child); - lv_obj_add_state(child, LV_STATE_DISABLED); - + //lv_obj_add_state(child, LV_STATE_DISABLED); + lv_obj_add_state(scr, LV_STATE_DISABLED); if(NULL == next_child) break; 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 4bda4ad3f..652af41ff 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 @@ -380,7 +380,7 @@ void UIFlowMenuCommonConfirmAPI_Open(uint32_t itemID) lv_obj_t * btnmatrix = lv_msgbox_get_btnmatrix(msgbox); if(btnmatrix){ - lv_btnmatrix_set_focused_btn(btnmatrix, 0); + lv_btnmatrix_set_focused_btn(btnmatrix, 1); /* update font of button part */ // lv_plugin_msgbox_update_font(msgbox, LV_MSGBOX_PART_BTN); @@ -389,10 +389,15 @@ void UIFlowMenuCommonConfirmAPI_Open(uint32_t itemID) lv_plugin_scr_open(UIFlowMenuCommonConfirm, NULL); } +#define confirm_from_null 0 +#define confirm_from_sf 1 +#define confirm_from_normal 2 +UINT8 is_confirm = confirm_from_null; void UIFlowMenuCommonConfirm_OnOpen(lv_obj_t* obj) { + is_confirm = confirm_from_normal; if(NULL == wait_moment_scr){ wait_moment_scr = UIFlowWaitMoment; } @@ -464,9 +469,9 @@ static void UIFlowMenuCommonConfirm_MessageBox_Key(lv_obj_t* obj, uint32_t key) } case LV_USER_KEY_SHUTTER2: { - // if(gp){ - // lv_group_send_data(gp, LV_KEY_ENTER); - // } + //if(gp){ + // lv_group_send_data(gp, LV_KEY_ENTER); + //} // break; static int todo = 8; lv_event_send(obj, LV_EVENT_CLICKED, &todo); @@ -475,7 +480,6 @@ static void UIFlowMenuCommonConfirm_MessageBox_Key(lv_obj_t* obj, uint32_t key) // UIFlowMenuCommonConfirm_MessageBox_ValueChanged(obj, &todo); break; } - } } @@ -592,6 +596,7 @@ void UIFlowMenuCommonConfirmEventCallback(lv_obj_t* obj, lv_event_t event) } case LV_PLUGIN_EVENT_SCR_CLOSE: + lv_plugin_scr_close(obj, gen_nvtmsg_data(NVTRET_CONFIRM, 0)); break; @@ -619,7 +624,7 @@ void UIFlowMenuCommonConfirmEventCallback(lv_obj_t* obj, lv_event_t event) void message_box_confirm_msg_event_callback(lv_obj_t* obj, lv_event_t event) { printf("[%s]event:%d\n", __FUNCTION__, event); - + switch(event) { diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c index 021acc7a9..6b2dbb6ea 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c @@ -1110,12 +1110,26 @@ static void UIFlowMenuCommonItem_ScrClose(lv_obj_t* obj) #endif } +extern UINT8 is_confirm; + + +#define confirm_from_null 0 +#define confirm_from_sf 1 +#define confirm_from_normal 2 static void UIFlowMenuCommonItem_ChildScrClose(lv_obj_t* obj,const LV_USER_EVENT_NVTMSG_DATA* msg) { DBG_DUMP("%s\r\n", __func__); set_indev_keypad_group(obj); + + if(is_confirm == confirm_from_sf){ + is_confirm = confirm_from_null; + Ux_PostEvent(NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_PHOTO); + return; + } + + if(msg){ if(msg->event == NVTRET_ENTER_MENU){ load_info_from_sf(); diff --git a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c index 3a15f9661..cc793bd8a 100755 --- a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c +++ b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c @@ -273,6 +273,7 @@ void sf_set_wifi_status(SF_WIFI_STATUS_E enStatus) } +extern UINT8 is_confirm; void sf_wifi_set_cam_mode(void) { int iCurrMode = System_GetState(SYS_STATE_CURRMODE); @@ -291,7 +292,18 @@ void sf_wifi_set_cam_mode(void) { iNextMode = PRIMARY_MODE_PHOTO; } - if((iNextMode != iCurrMode) || ((TRUE != sf_is_preview()))) + + if (is_confirm == 2) + { + is_confirm = 1; + Ux_PostEvent(NVTEVT_KEY_RIGHT, 1, NVTEVT_KEY_PRESS); + Ux_PostEvent(NVTEVT_KEY_RIGHT, 1, NVTEVT_KEY_RELEASE); + Ux_PostEvent(NVTEVT_KEY_ENTER, 1, NVTEVT_KEY_PRESS); + Ux_PostEvent(NVTEVT_KEY_ENTER, 1, NVTEVT_KEY_RELEASE); + return; + } + + if ((iNextMode != iCurrMode) || ((TRUE != sf_is_preview()))) { UI_SetData(FL_PreMode, iCurrMode); UI_SetData(FL_NextMode, iNextMode);