From: CCC <2393524978@qq.com> Date: Thu, 3 Aug 2023 09:42:06 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=fcded83018600377a574f35cc20b4d67c7bf8d8e;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_jrtc_client.c b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_jrtc_client.c index 972574c6..db61ad6f 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_jrtc_client.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_jrtc_client.c @@ -4,6 +4,7 @@ #include "lv_watch.h" #ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ +#if defined(__MMI_ZHSX_SUPPORT_VIDEO_CALL_WULIAN__) //#include #include "../../../../product/craneg_modem/framework/inc/jrtc.h" @@ -317,4 +318,6 @@ static uint8_t voip_jrtc_get_image(void * preview_buf) return ret; } -#endif // #if USE_LV_WATCH_VIDEOCALL != 0 +#endif +#endif + diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call.c b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call.c index 88ad6536..1f3bba46 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call.c @@ -5,6 +5,7 @@ #ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_WULIAN__ #include "mmi_video_call.h" #include @@ -53,7 +54,7 @@ void mmi_vc_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority) { return; } - voip_activity_destroy_req(); + mmi_vc_activity_destroy_req(); Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_2); } } @@ -592,7 +593,7 @@ static void voip_set_volume_when_slider_act(void) printf("%s\n", __FUNCTION__); if(lv_watch_get_activity_obj(ACT_ID_SLIDER)) { if(MMI_VIDEO_CALL_STATE_NONE != s_video_call_params.state) { - uint8_t volume = voip_get_call_volume(); + uint8_t volume = mmi_vc_get_call_volume(); printf("set nv, speaker volume is %d.\n", volume); UI_NV_Write_Req(NV_SECTION_UI_PHONE, 0, 1, &volume); } @@ -1422,6 +1423,17 @@ static lv_obj_t * mmi_vc_ui_create(lv_obj_t * activity_obj) return obj; } +void mmi_ui_msg_update_vc_call_stop(void) +{ + mmi_vc_ring_off_action(NULL, LV_EVENT_CLICKED); +} + +void mmi_vc_call_action_call_stop(void) +{ + mmi_watch_wake_up(); + mmi_ui_msg_action_vc_call_stop(); +} + void mmi_ui_msg_update_vc_call_incoming(void) { s_vc_call_ui = MMI_VC_UI_INCOMING; @@ -1752,7 +1764,7 @@ static lv_obj_t * mmi_vc_contact_list_create(lv_obj_t * obj) lv_list_set_scrollbar_mode(list, LV_SCROLLBAR_MODE_OFF); lv_page_set_scrollbar_mode(list, LV_SCROLLBAR_MODE_OFF); lv_obj_set_width(list, lv_obj_get_width(content)); - lv_coord_t height = lv_obj_get_height(content) - lv_obj_get_height(label); + lv_coord_t height = lv_obj_get_height(content) - 40; // lv_obj_get_height(label); lv_obj_set_height(list, height); lv_obj_align(list, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0); lv_obj_set_click(list, false); @@ -1899,21 +1911,15 @@ void video_call_create_event_cb(lv_obj_t * btn, lv_event_t e) } } -#endif //interface -uint8_t voip_get_call_volume(void) +uint8_t mmi_vc_get_call_volume(void) { -#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ return(s_video_call_params.speaker_volume); -#endif - - return 0; } -bool watch_voip_suspend_check(void) +bool mmi_vc_watch_suspend_check(void) { -#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ if((s_video_call_params.call_type == MODEM_VIDEO_CALL_TYPE_VIDEO) || (MMI_VIDEO_CALL_STATE_INCOMING == s_video_call_params.state) || (MMI_VIDEO_CALL_STATE_DIALING == s_video_call_params.state) @@ -1922,26 +1928,22 @@ bool watch_voip_suspend_check(void) { return false; } -#endif return true; } -bool voip_connect_check_req(void) +bool mmi_vc_connect_check_req(void) { -#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ if(mmi_vc_call_get_activity_obj()) { return true; } -#endif return false; } -void voip_activity_destroy_req(void) +void mmi_vc_activity_destroy_req(void) { -#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); lv_obj_t * activity_obj = mmi_vc_call_get_activity_obj(); @@ -1983,7 +1985,9 @@ void voip_activity_destroy_req(void) voip_set_volume_when_slider_act(); mmi_vc_call_screen_clean(); lv_watch_png_cache_all_free(); -#endif } +#endif +#endif + diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call.h b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call.h index a0fef36c..c702a1cf 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call.h @@ -24,13 +24,11 @@ extern "C" { #if 0 void voip_alarm_ind(void); #endif -bool voip_connect_check_req(void); -bool watch_voip_suspend_check(void); -void voip_activity_destroy_req(void); -uint8_t voip_get_call_volume(void); #ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_WULIAN__ + #define __VIDEO_CALL_DEBUG__ #ifdef __VIDEO_CALL_DEBUG__ @@ -209,6 +207,8 @@ void mmi_vc_call_action_incoming(char * number, MODEM_VIDEO_CALL_TYPE type); void mmi_vc_call_action_connecting(void); void mmi_vc_call_action_connected(void); +void mmi_ui_msg_update_vc_call_stop(void); +void mmi_vc_call_action_call_stop(void); void mmi_ui_msg_update_vc_call_incoming(void); int8_t mmi_video_call_dial_req(MODEM_VIDEO_CALL_TYPE calltype, char * pContactUri); @@ -220,6 +220,13 @@ void voip_fps_check(int8_t fps); void video_call_create_event_cb(lv_obj_t *btn, lv_event_t e); + +bool mmi_vc_connect_check_req(void); +bool mmi_vc_watch_suspend_check(void); +void mmi_vc_activity_destroy_req(void); +uint8_t mmi_vc_get_call_volume(void); + +#endif #endif diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_wechat/wechat_ui.c b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_wechat/wechat_ui.c index 12630634..8d2f2211 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_wechat/wechat_ui.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_wechat/wechat_ui.c @@ -124,17 +124,28 @@ void * wechat_actId_ext_get(lv_watch_Activity_Id_t actId) lv_obj_t * obj = NULL; lv_watch_get_child_obj(activity_obj, lv_watch_obj_signal, &obj); - if(NULL == obj) - return NULL; - - if(obj) + if(NULL != obj) { void * ext = lv_obj_get_ext_attr(obj); return ext; } + return NULL; } +static lv_obj_t * wechat_main_get_obj(void) +{ + lv_obj_t * watch_obj = NULL; + + lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_WECHAT_MAIN); + if(NULL != activity_obj) + { + lv_watch_get_child_obj(activity_obj, lv_watch_obj_signal, &watch_obj); + } + + return watch_obj; +} + void wechat_common_screen_prepare_destory(lv_obj_t * activity_obj) { WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); @@ -524,7 +535,7 @@ void wechat_msg_item_delete_ok_btn_event_cb(lv_obj_t * obj, lv_event_t e) //lv_obj_align(img, NULL, LV_ALIGN_IN_TOP_MID, 0, LV_VER_RES / 4); lv_obj_t * label_prompt = lv_label_create(ext->delete_bg, NULL); - lv_obj_add_style(label_prompt, LV_LABEL_PART_MAIN, &lv_watch_font30_black); + lv_obj_add_style(label_prompt, LV_LABEL_PART_MAIN, &lv_watch_font26_black); lv_label_set_text_id(label_prompt, WATCH_TEXT_ID_DEL_SUCCESS); lv_obj_align(label_prompt, ext->delete_bg, LV_ALIGN_CENTER, 0, -30); @@ -558,7 +569,7 @@ void wechat_chat_list_msg_item_delete_create(void) lv_obj_set_style_local_bg_color(ext->delete_bg, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0xB6, 0xF7, 0xFF)); lv_obj_t * label_prompt = lv_label_create(ext->delete_bg, NULL); - lv_obj_add_style(label_prompt, LV_LABEL_PART_MAIN, &lv_watch_font30_black); + lv_obj_add_style(label_prompt, LV_LABEL_PART_MAIN, &lv_watch_font26_black); lv_label_set_text_id(label_prompt, WATCH_TEXT_ID_DEL_Q); lv_obj_align(label_prompt, ext->delete_bg, LV_ALIGN_CENTER, 0, -30); @@ -572,7 +583,7 @@ void wechat_chat_list_msg_item_delete_create(void) lv_obj_set_event_cb(btn_cancel, wechat_msg_item_delete_cancel_btn_event_cb); lv_obj_t * label_cancel = lv_label_create(btn_cancel, NULL); - lv_obj_add_style(label_cancel, LV_LABEL_PART_MAIN, &lv_watch_font30); + lv_obj_add_style(label_cancel, LV_LABEL_PART_MAIN, &lv_watch_font26); lv_label_set_text_id(label_cancel, WATCH_TEXT_ID_CANCEL); lv_obj_t * btn_ok = lv_btn_create(ext->delete_bg, btn_cancel); @@ -1016,6 +1027,49 @@ void wechat_msg_recording_screen_create(void) return; } +static void wechat_out_of_memory_btn_event_cb(lv_obj_t * btn, lv_event_t e) +{ + if(LV_EVENT_CLICKED == e) + { + lv_obj_del(lv_obj_get_parent(btn)); + + //return main list screen + wechat_main_screen_refresh(); + } +} + +void wechat_list_out_of_memory_create(lv_obj_t * obj) +{ + lv_obj_t * cont_bg = lv_cont_create(obj, NULL); + lv_obj_set_size(cont_bg, LV_HOR_RES, LV_VER_RES); + lv_obj_add_style(cont_bg, LV_CONT_PART_MAIN, &lv_watch_black_tight); + + lv_obj_t * img_mem = lv_img_create(cont_bg, NULL); + lv_img_set_src(img_mem, ICON_CAMERA_MEMORY); + lv_obj_align(img_mem, NULL, LV_ALIGN_IN_TOP_MID, 0, 40); + + lv_obj_t * label = lv_label_create(cont_bg, NULL); + lv_label_set_text_id(label, WATCH_TEXT_ID_OUT_OF_MEM); + lv_label_set_long_mode(label, LV_LABEL_LONG_BREAK); + lv_obj_set_width(label, LV_HOR_RES - 40); + lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20); + lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); + lv_obj_align(label, img_mem, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); + + lv_obj_t * btn = lv_btn_create(cont_bg, NULL); + lv_obj_set_style_local_bg_color(btn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x47, 0xA6, 0xFF)); + lv_obj_set_style_local_radius(btn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 30); + lv_obj_set_style_local_bg_color(btn, LV_BTN_PART_MAIN, LV_STATE_PRESSED, LV_COLOR_MAKE(0x47, 0xA6, 0xFF)); + lv_obj_set_style_local_radius(btn, LV_BTN_PART_MAIN, LV_STATE_PRESSED, 30); + lv_obj_set_size(btn, 200, 56); + lv_obj_set_event_cb(btn, wechat_out_of_memory_btn_event_cb); + lv_obj_align(btn, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, -20); + + lv_obj_t * btn_label = lv_label_create(btn, NULL); + lv_label_set_text_id(btn_label, WATCH_TEXT_ID_GOT_IT); + lv_obj_add_style(btn_label,LV_LABEL_PART_MAIN, &lv_watch_font26); +} + void wechat_msg_record_button_event_cb(lv_obj_t * obj, lv_event_t e) { WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: event=%d\n", __FUNCTION__, __LINE__, e); @@ -1036,8 +1090,25 @@ void wechat_msg_record_button_event_cb(lv_obj_t * obj, lv_event_t e) wechat_chat_list_set_slide_enable(&ext->old_ext, false); /*prevent to slide out while recording*/ - //wechat_msg_voice_item_playing_stop(ext); - wechat_msg_recording_screen_create(); + uint32_t fs_total = 0, fs_free = 0; + lv_fs_free_space('C', &fs_total, &fs_free); + WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: space total=%dB,free=%dB\n", __FUNCTION__, __LINE__, fs_total, fs_free); + if(28 * 1024 > fs_free) // 30 * 1024 + { + lv_obj_t * obj = wechat_main_get_obj(); + wechat_list_out_of_memory_create(obj); + } + else if(NV_WATCH_WECHAT_NUM_MAX <= wechat_msg_info_count_get()) + //else if(2 <= wechat_msg_info_count_get()) + { + lv_obj_t * obj = wechat_main_get_obj(); + wechat_list_out_of_memory_create(obj); + } + else + { + //wechat_msg_voice_item_playing_stop(ext); + wechat_msg_recording_screen_create(); + } } else if(LV_EVENT_CLICKED == e || LV_EVENT_PRESS_LOST == e) { @@ -1673,8 +1744,6 @@ void wechat_main_screen_refresh(void) wechat_msg_voice_item_playing_stop(ext); - WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); - wechat_chat_list_msg_item_style_reset(ext); if(NULL != ext->list) { @@ -1774,6 +1843,11 @@ lv_obj_t * wechat_create(lv_obj_t * activity_obj, lv_wechat_created_from_e from) wechat_chat_list_create(cont, ext); } + //uint32_t fs_total = 0; + //uint32_t fs_free = 0; + //lv_fs_free_space('C', &fs_total, &fs_free); + //WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: space total = %dB, free = %dB\n", __FUNCTION__, __LINE__, fs_total, fs_free); + return obj; }