From: CCC <2393524978@qq.com> Date: Fri, 18 Aug 2023 01:57:06 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=4c578277ac6418a30c9d7d9ffc1368f6a3df1fc7;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_drivers/indev/sos_key.c b/2.sdk/sdk/gui/lv_drivers/indev/sos_key.c index 2c3314ec..a80e8566 100644 --- a/2.sdk/sdk/gui/lv_drivers/indev/sos_key.c +++ b/2.sdk/sdk/gui/lv_drivers/indev/sos_key.c @@ -213,7 +213,8 @@ static void sos_key_task(void *param) } else { //long press printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); - sos_btn_action(NULL); + //sos_btn_action(NULL); + mmi_key_back_sos_btn_action(); break; } } diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/qrcode/qrcode.c b/2.sdk/sdk/gui/lv_watch/lv_apps/qrcode/qrcode.c index f489f140..184c6506 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/qrcode/qrcode.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/qrcode/qrcode.c @@ -16,7 +16,7 @@ * DEFINES *********************/ #ifdef __MMI_ZHSX_SUPPORT__ -#define QRCODE_BG_WIDTH (190) +#define QRCODE_BG_WIDTH (190+8) #define QRCODE_WIDTH (188) #else #define QRCODE_BG_WIDTH 136 diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.c b/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.c index 9a872fe0..269a3ddf 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.c @@ -194,19 +194,13 @@ static lv_obj_t * sos_no_contacts_create(lv_obj_t * activity_obj) lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); lv_obj_set_click(label, false); lv_label_set_text_id(label, WATCH_TEXT_ID_NO_NUM); - lv_obj_align(label, obj, LV_ALIGN_CENTER, 0, 0); + lv_obj_align(label, obj, LV_ALIGN_CENTER, 0, -10); return obj; } lv_obj_t * sos_create(lv_obj_t * activity_obj) { - if(true == mmi_sos_number_is_empty()) - { - activity_obj = sos_no_contacts_create(NULL); - return activity_obj; - } - lv_watch_activity_ext_t activity_ext; memset(&activity_ext, 0, sizeof(lv_watch_activity_ext_t)); activity_ext.actId = ACT_ID_SOS; @@ -237,6 +231,50 @@ lv_obj_t * sos_create(lv_obj_t * activity_obj) return activity_obj; } +lv_res_t mmi_key_back_sos_btn_action(void) +{ + lv_obj_t * phone_obj = lv_watch_get_activity_obj(ACT_ID_PHONE); + if(phone_obj) + { + /* don't process sos or shutdown */ + return LV_RES_OK; + } + + if(false == watch_modem_sim_present_check_req()) + { + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + //shutdown_create_btn_action(NULL,LV_EVENT_CLICKED); + } + else + { + lv_watch_go_home(); + lv_watch_png_cache_all_free(); + + if(true == mmi_sos_number_is_empty()) + { + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + sos_no_contacts_create(NULL); + } + else + { + if(true == mmi_watch_tcp_connect_state_get() + && true == mmi_protocol_watch_bind_state_get() + ) + { + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + mmi_protocol_action_sos(); + } + + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + lv_obj_t * obj = sos_create(NULL); + if(obj == NULL) + return LV_RES_OK; + } + } + + return LV_RES_OK; +} + lv_res_t sos_btn_action(lv_obj_t * btn) { (void)btn; @@ -257,11 +295,26 @@ lv_res_t sos_btn_action(lv_obj_t * btn) lv_watch_go_home(); lv_watch_png_cache_all_free(); - mmi_protocol_action_sos(); - - lv_obj_t * obj = sos_create(NULL); - if(obj == NULL) - return LV_RES_OK; + if(true == mmi_sos_number_is_empty()) + { + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + sos_no_contacts_create(NULL); + } + else + { + if(true == mmi_watch_tcp_connect_state_get() + && true == mmi_protocol_watch_bind_state_get() + ) + { + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + mmi_protocol_action_sos(); + } + + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + lv_obj_t * obj = sos_create(NULL); + if(obj == NULL) + return LV_RES_OK; + } } return LV_RES_OK; diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.h b/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.h index b05d2b6a..12b67960 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.h @@ -70,6 +70,7 @@ lv_obj_t * sos_create(lv_obj_t * activity_obj); #ifdef __MMI_ZHSX_SUPPORT__ void mmi_sos_number_nv_read(void); void mmi_sos_number_set(nv_watch_sos_number_t * sos_number); +lv_res_t mmi_key_back_sos_btn_action(void); #endif /**********************