From: CCC <2393524978@qq.com> Date: Sun, 8 Oct 2023 08:10:34 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=9fe19726ac7a7ff155ee6dfb47c2de573f633c27;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_watch/framework/language/lang_ch.c b/2.sdk/sdk/gui/lv_watch/framework/language/lang_ch.c index aeb0e45c..cabf919e 100644 --- a/2.sdk/sdk/gui/lv_watch/framework/language/lang_ch.c +++ b/2.sdk/sdk/gui/lv_watch/framework/language/lang_ch.c @@ -251,7 +251,7 @@ const void * lang_text_ch[] = { "LCD测试", /*factory_mode_reset.c*/ - "确定重置全部设置并删除设备上全部数据?", + "确定重置设备并清除全部用户数据?", "正在恢复出厂设置", /*factory_mode_hwtest.c*/ diff --git a/2.sdk/sdk/gui/lv_watch/framework/language/lang_en.c b/2.sdk/sdk/gui/lv_watch/framework/language/lang_en.c index 88458779..8c118a0a 100644 --- a/2.sdk/sdk/gui/lv_watch/framework/language/lang_en.c +++ b/2.sdk/sdk/gui/lv_watch/framework/language/lang_en.c @@ -252,7 +252,7 @@ const void * lang_text_en[] = { "LCD test", /*factory_mode_reset.c*/ - "Make sure to reset all settings and delete all data on the device?", + "Make sure to reset all settings and clean user data?", "Restoring factory settings", /*factory_mode_hwtest.c*/ diff --git a/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.c b/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.c index 90a86c27..88e40539 100644 --- a/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.c +++ b/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.c @@ -360,7 +360,9 @@ void watch_ui_message_handle(uint16_t msgid, void * msg) #ifdef __MMI_ZHSX_SUPPORT_ALIPAY__ case MMI_ALIPAY_MSG_HANDLE: printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + #if USE_LV_WATCH_ALIPAY != 0 aos_watch_alipay_msg_handle(msg); + #endif break; #endif diff --git a/2.sdk/sdk/gui/lv_watch/include/ui_textid.h b/2.sdk/sdk/gui/lv_watch/include/ui_textid.h index 8a0bc790..74b93e92 100644 --- a/2.sdk/sdk/gui/lv_watch/include/ui_textid.h +++ b/2.sdk/sdk/gui/lv_watch/include/ui_textid.h @@ -250,7 +250,7 @@ enum WATCH_TEXT_ID_LCDTEST, /* "LCD测试" "LCD Test" */ /*factory_mode_reset.c*/ - WATCH_TEXT_ID_FACTORY_RESET_Q, /* "确定重置全部设置并删除设备上全部数据?" "Make sure to reset all settings ang delete all data on the device?"*/ + WATCH_TEXT_ID_FACTORY_RESET_Q, /* "确定重置设备并清除全部用户数据" "Make sure to reset all settings and clean user data?"*/ WATCH_TEXT_ID_FACTORY_RESETING, /* "正在恢复出厂设置" "Restoring factory settings"*/ /*factory_mode_hwtest.c*/ diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/alipay.c b/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/alipay.c index 8131462e..6270ccf9 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/alipay.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/alipay.c @@ -8,6 +8,9 @@ *********************/ #include "lv_watch.h" +#if USE_LV_WATCH_ALIPAY != 0 + + #include #include #include "lv_drv_conf.h" @@ -2453,3 +2456,6 @@ static void upay_parent_list_prepare_destory(lv_obj_t * activity_obj) } +#endif + + diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/alipay.h b/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/alipay.h index 892d7b5d..1894a13a 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/alipay.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/alipay.h @@ -21,6 +21,9 @@ extern "C" { #include "../../../lv_ex_conf.h" #endif + +#if USE_LV_WATCH_ALIPAY != 0 + /********************* * DEFINES *********************/ @@ -86,6 +89,8 @@ enum{ UPAY_ALIPAY_INTED = 2, }; +#endif + #ifdef __cplusplus } /* extern "C" */ diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/upay_interface.c b/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/upay_interface.c index dbeb21f9..fef87627 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/upay_interface.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/alipay/upay_interface.c @@ -8,6 +8,9 @@ *********************/ #include "lv_watch.h" +#if USE_LV_WATCH_ALIPAY != 0 + + #include #include #include "lv_drv_conf.h" @@ -326,4 +329,6 @@ void aos_watch_alipay_msg_handle(void *msg) return; } +#endif + diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/factory_mode/factory_mode_reset.c b/2.sdk/sdk/gui/lv_watch/lv_apps/factory_mode/factory_mode_reset.c index ed988289..df2064e6 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/factory_mode/factory_mode_reset.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/factory_mode/factory_mode_reset.c @@ -60,17 +60,19 @@ lv_obj_t * factorymode_reset_create(lv_obj_t * activity_obj) if(NULL == obj) return NULL; - lv_obj_t * label = lv_label_create(obj, NULL); - lv_obj_set_size(label, LV_HOR_RES, LV_VER_RES / 6); - lv_label_set_text_id(label, WATCH_TEXT_ID_FACTORY_RESET); - lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20_gray); - lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 25); + //lv_obj_t * label = lv_label_create(obj, NULL); + //lv_obj_set_size(label, LV_HOR_RES, LV_VER_RES / 6); + //lv_label_set_text_id(label, WATCH_TEXT_ID_FACTORY_RESET); + //lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20_gray); + //lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 25); lv_obj_t * label_tip = lv_label_create(obj, NULL); lv_label_set_text_id(label_tip, WATCH_TEXT_ID_FACTORY_RESET_Q); lv_label_set_long_mode(label_tip, LV_LABEL_LONG_BREAK); - lv_obj_set_width(label_tip, LV_HOR_RES * 3 / 4); - lv_obj_align(label_tip, label, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); + //lv_obj_set_width(label_tip, LV_HOR_RES * 3 / 4); + //lv_obj_align(label_tip, label, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); + lv_obj_set_width(label_tip, LV_HOR_RES * 2 / 3); + lv_obj_align(label_tip, obj, LV_ALIGN_IN_TOP_MID, 0, 50); lv_obj_add_style(label_tip, LV_LABEL_PART_MAIN, &lv_watch_font26); lv_obj_t * btn_yes = lv_imgbtn_create(obj, NULL); 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 e6bb84cc..b7464f5a 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 @@ -24,7 +24,6 @@ lv_color_t g_cbuf[canvas_width * canvas_heigh + 8] __attribute__((aligned(8))); /********************** * STATIC PROTOTYPES **********************/ -static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par); static void voip_phone_left_slide_callback(lv_obj_t * obj); static void voip_phone_right_slide_callback(lv_obj_t * obj); static void voip_phone_down_slide_callback(lv_obj_t * obj); @@ -32,7 +31,6 @@ static void voip_volume_btn_action(lv_obj_t * obj, lv_event_t e); static void voip_slider_action(lv_obj_t * slider, lv_event_t e); static void voip_phone_obj_hide_anim_end(lv_anim_t * anim); static void voip_anim_fp_dialing_ring(lv_obj_t * obj, int32_t x); -static void voip_get_time_elaps(uint32_t last_time, char * str, int8_t size); static void voip_set_volume_when_slider_act(void); static void voip_local_remote_switch_action(lv_obj_t * btn, lv_event_t e); static void canvas_button_hidden_event_cb(lv_obj_t * obj, lv_event_t e); @@ -173,7 +171,27 @@ static void voip_phone_obj_hide_anim_end(lv_anim_t * anim) mmi_vc_call_screen_clean(); } -static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par) +static void mmi_vc_get_time_elaps(uint32_t last_time, char * str, int8_t size) +{ + hal_rtc_t rtc_curr; // current rtc time + uint32_t second_curr = 0; // seconds of current time + + Hal_Rtc_Gettime(&rtc_curr); + second_curr = time_to_seconds(&rtc_curr); + + uint32_t elaps = second_curr - last_time; + uint32_t seconds = elaps % 60; + uint32_t minutes = elaps / 60; + uint32_t hours = minutes / 60; + minutes = minutes % 60; + + if(hours == 0) + snprintf(str, size, "%.2d:%.2d", minutes, seconds); + else + snprintf(str, size, "%.2d:%.2d:%.2d", hours, minutes, seconds); +} + +static lv_obj_t * mmi_vc_ring_off_content_create(lv_obj_t * par) { printf("%s %d\n", __FUNCTION__, __LINE__); if(par == NULL) { @@ -201,17 +219,19 @@ static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par) } lv_obj_add_style(content, LV_OBJ_PART_MAIN, &lv_watch_cont_opa1); - lv_obj_set_size(content, 204, 44); - if(ext->vc_ui == MMI_VC_UI_INCOMING || ext->vc_ui == MMI_VC_UI_DIALING) { - lv_obj_align(content, obj, LV_ALIGN_IN_TOP_MID, 0, 10); - } else { - lv_obj_align(content, obj, LV_ALIGN_CENTER, 0, -12); - } + //lv_obj_set_size(content, 204, 44); + //if(ext->vc_ui == MMI_VC_UI_INCOMING || ext->vc_ui == MMI_VC_UI_DIALING) { + // lv_obj_align(content, obj, LV_ALIGN_IN_TOP_MID, 0, 10); + //} else { + // lv_obj_align(content, obj, LV_ALIGN_CENTER, 0, -12); + //} + lv_obj_set_size(content, LV_HOR_RES - 40, 50); + lv_obj_align(content, obj, LV_ALIGN_CENTER, 0, -10); lv_cont_set_layout(content, LV_LAYOUT_CENTER); lv_obj_set_click(content, false); lv_obj_t * label = lv_label_create(content, NULL); - lv_obj_add_style(label, LV_OBJ_PART_MAIN, &lv_watch_font20); + lv_obj_add_style(label, LV_OBJ_PART_MAIN, &lv_watch_font26); // &lv_watch_font20); lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); if(is_rat_gsm()) @@ -224,7 +244,7 @@ static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par) { char tmp[20] = ""; char str[30] = ""; - voip_get_time_elaps(ext->connect_start_time, tmp, 20); + mmi_vc_get_time_elaps(ext->connect_start_time, tmp, 20); snprintf(str, 30, "%s(%s)", (char *)lv_lang_get_text(WATCH_TEXT_ID_RING_OFF), tmp); lv_label_set_text(label, str); } @@ -381,7 +401,7 @@ static void mmi_vc_anim_fp_connected(lv_anim_t * anim) } char str[20] = ""; - voip_get_time_elaps(ext->connect_start_time, str, 20); + mmi_vc_get_time_elaps(ext->connect_start_time, str, 20); if(obj) { lv_label_set_text(obj, str); } @@ -408,35 +428,6 @@ static void mmi_vc_connected_animation(lv_obj_t * obj) lv_anim_start(&a); } -static void voip_get_time_elaps(uint32_t last_time, char * str, int8_t size) -{ - hal_rtc_t rtc_curr; // current rtc time - uint32_t second_curr = 0; // seconds of current time - - Hal_Rtc_Gettime(&rtc_curr); - second_curr = time_to_seconds(&rtc_curr); - - uint32_t elaps = second_curr - last_time; - uint32_t seconds = elaps % 60; - uint32_t minutes = elaps / 60; - uint32_t hours = minutes / 60; - minutes = minutes % 60; - - if(hours == 0) { - if(lv_lang_act() == LANG_CH) { - snprintf(str, size, "%.2d:%.2d", minutes, seconds); - } else { - snprintf(str, size, "%.2d:%.2d", minutes, seconds); - } - } else { - if(lv_lang_act() == LANG_CH) { - snprintf(str, size, "%.2d:%.2d:%.2d", hours, minutes, seconds); - } else { - snprintf(str, size, "%.2d:%.2d:%.2d", hours, minutes, seconds); - } - } -} - void mmi_vc_ring_off_no_carrier(uint8_t isNoCarrier) { if((false == s_video_call_params.ring_off_timeout) @@ -855,11 +846,11 @@ lv_res_t mmi_video_call_phone_ring_off_create() lv_label_set_text(ext->phone_status_label, ""); } - voip_ring_off_content_create(mmi_vc_call_get_obj()); + mmi_vc_ring_off_content_create(mmi_vc_call_get_obj()); } else if(ext->vc_ui == MMI_VC_UI_CONNECTED) { - voip_ring_off_content_create(mmi_vc_call_get_obj()); + mmi_vc_ring_off_content_create(mmi_vc_call_get_obj()); } if(ext->phone_animation_obj) { @@ -1000,7 +991,7 @@ static void mmi_vc_ui_dialing(lv_obj_t * content) { lv_label_set_text(label, s_video_call_params.number); } - lv_obj_align(label, img, LV_ALIGN_OUT_BOTTOM_MID, 0, 20); + lv_obj_align(label, img, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); lv_obj_set_click(label, false); #if 0 @@ -1690,6 +1681,11 @@ static void mmi_vc_voice_btn_action(lv_obj_t * btn, lv_event_t e) return; } + if(true == mmi_video_call_is_in_call()) + { + return; + } + if(true == mmi_vc_check_mo_permission()) { uint8_t index = lv_watch_get_free_num(btn); @@ -1709,6 +1705,11 @@ static void mmi_vc_video_btn_action(lv_obj_t * btn, lv_event_t e) return; } + if(true == mmi_video_call_is_in_call()) + { + return; + } + if(true == mmi_vc_check_mo_permission()) { uint8_t index = lv_watch_get_free_num(btn); @@ -1743,14 +1744,22 @@ static void mmi_vc_dial_btn_screen(lv_obj_t * btn, lv_event_t e) lv_obj_t * voicebtn = lv_imgbtn_create(cont, NULL); lv_imgbtn_set_src(voicebtn, LV_BTN_STATE_RELEASED, ICON_VIDEO_CALL_VOICE_BTN); lv_imgbtn_set_src(voicebtn, LV_BTN_STATE_PRESSED, ICON_VIDEO_CALL_VOICE_BTN); +#ifdef USE_LV_WATCH_UI_240_240_CIRCLE + lv_obj_align(voicebtn, cont, LV_ALIGN_IN_LEFT_MID, 5, 0); +#else lv_obj_align(voicebtn, cont, LV_ALIGN_IN_TOP_MID, 0, 10); +#endif lv_obj_set_event_cb(voicebtn, mmi_vc_voice_btn_action); lv_watch_set_free_num(voicebtn, index); lv_obj_t * videobtn = lv_imgbtn_create(cont, NULL); lv_imgbtn_set_src(videobtn, LV_BTN_STATE_RELEASED, ICON_VIDEO_CALL_VIDEO_BTN); lv_imgbtn_set_src(videobtn, LV_BTN_STATE_PRESSED, ICON_VIDEO_CALL_VIDEO_BTN); +#ifdef USE_LV_WATCH_UI_240_240_CIRCLE + lv_obj_align(videobtn, cont, LV_ALIGN_IN_RIGHT_MID, -5, 0); +#else lv_obj_align(videobtn, cont, LV_ALIGN_IN_BOTTOM_MID, 0, -10); +#endif lv_obj_set_event_cb(videobtn, mmi_vc_video_btn_action); lv_watch_set_free_num(videobtn, index); } diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_fzd.c b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_fzd.c index e872f629..b40f2ac6 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_fzd.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_fzd.c @@ -28,7 +28,6 @@ static char s_video_call_tokens[MMI_WATCH_VC_TOKENS_LEN] = {0}; /********************** * STATIC PROTOTYPES **********************/ -static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par); static void voip_phone_left_slide_callback(lv_obj_t * obj); static void voip_phone_right_slide_callback(lv_obj_t * obj); static void voip_phone_down_slide_callback(lv_obj_t * obj); @@ -36,7 +35,6 @@ static void voip_volume_btn_action(lv_obj_t * obj, lv_event_t e); static void voip_slider_action(lv_obj_t * slider, lv_event_t e); static void voip_phone_obj_hide_anim_end(lv_anim_t * anim); static void voip_anim_fp_dialing_ring(lv_obj_t * obj, int32_t x); -static void voip_get_time_elaps(uint32_t last_time, char * str, int8_t size); static void voip_set_volume_when_slider_act(void); static void voip_local_remote_switch_action(lv_obj_t * btn, lv_event_t e); static void canvas_button_hidden_event_cb(lv_obj_t * obj, lv_event_t e); @@ -58,7 +56,7 @@ void mmi_vc_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority) { return; } - mmi_vc_activity_destroy_req_fzd(); + mmi_vc_activity_destroy_req(); Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_2); } } @@ -177,7 +175,27 @@ static void voip_phone_obj_hide_anim_end(lv_anim_t * anim) mmi_vc_call_screen_clean(); } -static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par) +static void mmi_vc_get_time_elaps(uint32_t last_time, char * str, int8_t size) +{ + hal_rtc_t rtc_curr; // current rtc time + uint32_t second_curr = 0; // seconds of current time + + Hal_Rtc_Gettime(&rtc_curr); + second_curr = time_to_seconds(&rtc_curr); + + uint32_t elaps = second_curr - last_time; + uint32_t seconds = elaps % 60; + uint32_t minutes = elaps / 60; + uint32_t hours = minutes / 60; + minutes = minutes % 60; + + if(hours == 0) + snprintf(str, size, "%.2d:%.2d", minutes, seconds); + else + snprintf(str, size, "%.2d:%.2d:%.2d", hours, minutes, seconds); +} + +static lv_obj_t * mmi_vc_ring_off_content_create(lv_obj_t * par) { printf("%s %d\n", __FUNCTION__, __LINE__); if(par == NULL) { @@ -205,17 +223,19 @@ static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par) } lv_obj_add_style(content, LV_OBJ_PART_MAIN, &lv_watch_cont_opa1); - lv_obj_set_size(content, 204, 44); - if(ext->vc_ui == MMI_VC_UI_INCOMING || ext->vc_ui == MMI_VC_UI_DIALING) { - lv_obj_align(content, obj, LV_ALIGN_IN_TOP_MID, 0, 10); - } else { - lv_obj_align(content, obj, LV_ALIGN_CENTER, 0, -12); - } + //lv_obj_set_size(content, 204, 44); + //if(ext->vc_ui == MMI_VC_UI_INCOMING || ext->vc_ui == MMI_VC_UI_DIALING) { + // lv_obj_align(content, obj, LV_ALIGN_IN_TOP_MID, 0, 10); + //} else { + // lv_obj_align(content, obj, LV_ALIGN_CENTER, 0, -12); + //} + lv_obj_set_size(content, LV_HOR_RES - 40, 50); + lv_obj_align(content, obj, LV_ALIGN_CENTER, 0, -10); lv_cont_set_layout(content, LV_LAYOUT_CENTER); lv_obj_set_click(content, false); lv_obj_t * label = lv_label_create(content, NULL); - lv_obj_add_style(label, LV_OBJ_PART_MAIN, &lv_watch_font20); + lv_obj_add_style(label, LV_OBJ_PART_MAIN, &lv_watch_font26); // &lv_watch_font20); lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); if(is_rat_gsm()) @@ -228,7 +248,7 @@ static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par) { char tmp[20] = ""; char str[30] = ""; - voip_get_time_elaps(ext->connect_start_time, tmp, 20); + mmi_vc_get_time_elaps(ext->connect_start_time, tmp, 20); snprintf(str, 30, "%s(%s)", (char *)lv_lang_get_text(WATCH_TEXT_ID_RING_OFF), tmp); lv_label_set_text(label, str); } @@ -385,7 +405,7 @@ static void mmi_vc_anim_fp_connected(lv_anim_t * anim) } char str[20] = ""; - voip_get_time_elaps(ext->connect_start_time, str, 20); + mmi_vc_get_time_elaps(ext->connect_start_time, str, 20); if(obj) { lv_label_set_text(obj, str); } @@ -412,35 +432,6 @@ static void mmi_vc_connected_animation(lv_obj_t * obj) lv_anim_start(&a); } -static void voip_get_time_elaps(uint32_t last_time, char * str, int8_t size) -{ - hal_rtc_t rtc_curr; // current rtc time - uint32_t second_curr = 0; // seconds of current time - - Hal_Rtc_Gettime(&rtc_curr); - second_curr = time_to_seconds(&rtc_curr); - - uint32_t elaps = second_curr - last_time; - uint32_t seconds = elaps % 60; - uint32_t minutes = elaps / 60; - uint32_t hours = minutes / 60; - minutes = minutes % 60; - - if(hours == 0) { - if(lv_lang_act() == LANG_CH) { - snprintf(str, size, "%.2d:%.2d", minutes, seconds); - } else { - snprintf(str, size, "%.2d:%.2d", minutes, seconds); - } - } else { - if(lv_lang_act() == LANG_CH) { - snprintf(str, size, "%.2d:%.2d:%.2d", hours, minutes, seconds); - } else { - snprintf(str, size, "%.2d:%.2d:%.2d", hours, minutes, seconds); - } - } -} - void mmi_vc_ring_off_no_carrier(uint8_t isNoCarrier) { if((false == s_video_call_params.ring_off_timeout) @@ -597,7 +588,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 = mmi_vc_get_call_volume_fzd(); + 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); } @@ -858,11 +849,11 @@ lv_res_t mmi_video_call_phone_ring_off_create() lv_label_set_text(ext->phone_status_label, ""); } - voip_ring_off_content_create(mmi_vc_call_get_obj()); + mmi_vc_ring_off_content_create(mmi_vc_call_get_obj()); } else if(ext->vc_ui == MMI_VC_UI_CONNECTED) { - voip_ring_off_content_create(mmi_vc_call_get_obj()); + mmi_vc_ring_off_content_create(mmi_vc_call_get_obj()); } if(ext->phone_animation_obj) { @@ -1003,7 +994,7 @@ static void mmi_vc_ui_dialing(lv_obj_t * content) { lv_label_set_text(label, s_video_call_params.number); } - lv_obj_align(label, img, LV_ALIGN_OUT_BOTTOM_MID, 0, 20); + lv_obj_align(label, img, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); lv_obj_set_click(label, false); #if 0 @@ -1777,14 +1768,22 @@ static void mmi_vc_dial_btn_screen(lv_obj_t * btn, lv_event_t e) lv_obj_t * voicebtn = lv_imgbtn_create(cont, NULL); lv_imgbtn_set_src(voicebtn, LV_BTN_STATE_RELEASED, ICON_VIDEO_CALL_VOICE_BTN); lv_imgbtn_set_src(voicebtn, LV_BTN_STATE_PRESSED, ICON_VIDEO_CALL_VOICE_BTN); +#ifdef USE_LV_WATCH_UI_240_240_CIRCLE + lv_obj_align(voicebtn, cont, LV_ALIGN_IN_LEFT_MID, 5, 0); +#else lv_obj_align(voicebtn, cont, LV_ALIGN_IN_TOP_MID, 0, 10); +#endif lv_obj_set_event_cb(voicebtn, mmi_vc_voice_btn_action); lv_watch_set_free_num(voicebtn, index); lv_obj_t * videobtn = lv_imgbtn_create(cont, NULL); lv_imgbtn_set_src(videobtn, LV_BTN_STATE_RELEASED, ICON_VIDEO_CALL_VIDEO_BTN); lv_imgbtn_set_src(videobtn, LV_BTN_STATE_PRESSED, ICON_VIDEO_CALL_VIDEO_BTN); +#ifdef USE_LV_WATCH_UI_240_240_CIRCLE + lv_obj_align(videobtn, cont, LV_ALIGN_IN_RIGHT_MID, -5, 0); +#else lv_obj_align(videobtn, cont, LV_ALIGN_IN_BOTTOM_MID, 0, -10); +#endif lv_obj_set_event_cb(videobtn, mmi_vc_video_btn_action); lv_watch_set_free_num(videobtn, index); } @@ -2000,12 +1999,12 @@ void video_call_create_event_cb(lv_obj_t * btn, lv_event_t e) //interface -uint8_t mmi_vc_get_call_volume_fzd(void) +uint8_t mmi_vc_get_call_volume(void) { return(s_video_call_params.speaker_volume); } -bool mmi_vc_watch_suspend_check_fzd(void) +bool mmi_vc_watch_suspend_check(void) { if((s_video_call_params.call_type == MODEM_VIDEO_CALL_TYPE_VIDEO) || (MMI_VIDEO_CALL_STATE_INCOMING == s_video_call_params.state) @@ -2019,7 +2018,7 @@ bool mmi_vc_watch_suspend_check_fzd(void) return true; } -bool mmi_vc_connect_check_req_fzd(void) +bool mmi_vc_connect_check_req(void) { if(mmi_vc_call_get_activity_obj()) { @@ -2029,7 +2028,7 @@ bool mmi_vc_connect_check_req_fzd(void) return false; } -void mmi_vc_activity_destroy_req_fzd(void) +void mmi_vc_activity_destroy_req(void) { VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_fzd.h b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_fzd.h index deda382f..0f8a7c77 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_fzd.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_fzd.h @@ -238,10 +238,10 @@ bool mmi_video_call_is_in_call(void); void video_call_create_event_cb(lv_obj_t *btn, lv_event_t e); -bool mmi_vc_connect_check_req_fzd(void); -bool mmi_vc_watch_suspend_check_fzd(void); -void mmi_vc_activity_destroy_req_fzd(void); -uint8_t mmi_vc_get_call_volume_fzd(void); +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 diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.c b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.c index 30a58988..1b697b10 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.c @@ -31,7 +31,6 @@ static char s_vc_uid[MMI_WATCH_VC_UID_LEN] = {0}; /********************** * STATIC PROTOTYPES **********************/ -static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par); static void voip_phone_left_slide_callback(lv_obj_t * obj); static void voip_phone_right_slide_callback(lv_obj_t * obj); static void voip_phone_down_slide_callback(lv_obj_t * obj); @@ -39,7 +38,6 @@ static void voip_volume_btn_action(lv_obj_t * obj, lv_event_t e); static void voip_slider_action(lv_obj_t * slider, lv_event_t e); static void voip_phone_obj_hide_anim_end(lv_anim_t * anim); static void voip_anim_fp_dialing_ring(lv_obj_t * obj, int32_t x); -static void voip_get_time_elaps(uint32_t last_time, char * str, int8_t size); static void voip_set_volume_when_slider_act(void); static void voip_local_remote_switch_action(lv_obj_t * btn, lv_event_t e); static void canvas_button_hidden_event_cb(lv_obj_t * obj, lv_event_t e); @@ -61,7 +59,7 @@ void mmi_vc_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority) { return; } - mmi_vc_activity_destroy_req_tongxin(); + mmi_vc_activity_destroy_req(); Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_2); } } @@ -181,7 +179,27 @@ static void voip_phone_obj_hide_anim_end(lv_anim_t * anim) mmi_vc_call_screen_clean(); } -static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par) +static void mmi_vc_get_time_elaps(uint32_t last_time, char * str, int8_t size) +{ + hal_rtc_t rtc_curr; // current rtc time + uint32_t second_curr = 0; // seconds of current time + + Hal_Rtc_Gettime(&rtc_curr); + second_curr = time_to_seconds(&rtc_curr); + + uint32_t elaps = second_curr - last_time; + uint32_t seconds = elaps % 60; + uint32_t minutes = elaps / 60; + uint32_t hours = minutes / 60; + minutes = minutes % 60; + + if(hours == 0) + snprintf(str, size, "%.2d:%.2d", minutes, seconds); + else + snprintf(str, size, "%.2d:%.2d:%.2d", hours, minutes, seconds); +} + +static lv_obj_t * mmi_vc_ring_off_content_create(lv_obj_t * par) { printf("%s %d\n", __FUNCTION__, __LINE__); if(par == NULL) { @@ -209,17 +227,19 @@ static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par) } lv_obj_add_style(content, LV_OBJ_PART_MAIN, &lv_watch_cont_opa1); - lv_obj_set_size(content, 204, 44); - if(ext->vc_ui == MMI_VC_UI_INCOMING || ext->vc_ui == MMI_VC_UI_DIALING) { - lv_obj_align(content, obj, LV_ALIGN_IN_TOP_MID, 0, 10); - } else { - lv_obj_align(content, obj, LV_ALIGN_CENTER, 0, -12); - } + //lv_obj_set_size(content, 204, 44); + //if(ext->vc_ui == MMI_VC_UI_INCOMING || ext->vc_ui == MMI_VC_UI_DIALING) { + // lv_obj_align(content, obj, LV_ALIGN_IN_TOP_MID, 0, 10); + //} else { + // lv_obj_align(content, obj, LV_ALIGN_CENTER, 0, -12); + //} + lv_obj_set_size(content, LV_HOR_RES - 40, 50); + lv_obj_align(content, obj, LV_ALIGN_CENTER, 0, -10); lv_cont_set_layout(content, LV_LAYOUT_CENTER); lv_obj_set_click(content, false); lv_obj_t * label = lv_label_create(content, NULL); - lv_obj_add_style(label, LV_OBJ_PART_MAIN, &lv_watch_font20); + lv_obj_add_style(label, LV_OBJ_PART_MAIN, &lv_watch_font26); // &lv_watch_font20); lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); if(is_rat_gsm()) @@ -232,7 +252,7 @@ static lv_obj_t * voip_ring_off_content_create(lv_obj_t * par) { char tmp[20] = ""; char str[30] = ""; - voip_get_time_elaps(ext->connect_start_time, tmp, 20); + mmi_vc_get_time_elaps(ext->connect_start_time, tmp, 20); snprintf(str, 30, "%s(%s)", (char *)lv_lang_get_text(WATCH_TEXT_ID_RING_OFF), tmp); lv_label_set_text(label, str); } @@ -389,7 +409,7 @@ static void mmi_vc_anim_fp_connected(lv_anim_t * anim) } char str[20] = ""; - voip_get_time_elaps(ext->connect_start_time, str, 20); + mmi_vc_get_time_elaps(ext->connect_start_time, str, 20); if(obj) { lv_label_set_text(obj, str); } @@ -416,35 +436,6 @@ static void mmi_vc_connected_animation(lv_obj_t * obj) lv_anim_start(&a); } -static void voip_get_time_elaps(uint32_t last_time, char * str, int8_t size) -{ - hal_rtc_t rtc_curr; // current rtc time - uint32_t second_curr = 0; // seconds of current time - - Hal_Rtc_Gettime(&rtc_curr); - second_curr = time_to_seconds(&rtc_curr); - - uint32_t elaps = second_curr - last_time; - uint32_t seconds = elaps % 60; - uint32_t minutes = elaps / 60; - uint32_t hours = minutes / 60; - minutes = minutes % 60; - - if(hours == 0) { - if(lv_lang_act() == LANG_CH) { - snprintf(str, size, "%.2d:%.2d", minutes, seconds); - } else { - snprintf(str, size, "%.2d:%.2d", minutes, seconds); - } - } else { - if(lv_lang_act() == LANG_CH) { - snprintf(str, size, "%.2d:%.2d:%.2d", hours, minutes, seconds); - } else { - snprintf(str, size, "%.2d:%.2d:%.2d", hours, minutes, seconds); - } - } -} - void mmi_vc_ring_off_no_carrier(uint8_t isNoCarrier) { if((false == s_video_call_params.ring_off_timeout) @@ -601,7 +592,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 = mmi_vc_get_call_volume_tongxin(); + 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); } @@ -862,11 +853,11 @@ lv_res_t mmi_video_call_phone_ring_off_create() lv_label_set_text(ext->phone_status_label, ""); } - voip_ring_off_content_create(mmi_vc_call_get_obj()); + mmi_vc_ring_off_content_create(mmi_vc_call_get_obj()); } else if(ext->vc_ui == MMI_VC_UI_CONNECTED) { - voip_ring_off_content_create(mmi_vc_call_get_obj()); + mmi_vc_ring_off_content_create(mmi_vc_call_get_obj()); } if(ext->phone_animation_obj) { @@ -1007,7 +998,7 @@ static void mmi_vc_ui_dialing(lv_obj_t * content) { lv_label_set_text(label, s_video_call_params.number); } - lv_obj_align(label, img, LV_ALIGN_OUT_BOTTOM_MID, 0, 20); + lv_obj_align(label, img, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); lv_obj_set_click(label, false); #if 0 @@ -1801,14 +1792,22 @@ static void mmi_vc_dial_btn_screen(lv_obj_t * btn, lv_event_t e) lv_obj_t * voicebtn = lv_imgbtn_create(cont, NULL); lv_imgbtn_set_src(voicebtn, LV_BTN_STATE_RELEASED, ICON_VIDEO_CALL_VOICE_BTN); lv_imgbtn_set_src(voicebtn, LV_BTN_STATE_PRESSED, ICON_VIDEO_CALL_VOICE_BTN); +#ifdef USE_LV_WATCH_UI_240_240_CIRCLE + lv_obj_align(voicebtn, cont, LV_ALIGN_IN_LEFT_MID, 5, 0); +#else lv_obj_align(voicebtn, cont, LV_ALIGN_IN_TOP_MID, 0, 10); +#endif lv_obj_set_event_cb(voicebtn, mmi_vc_voice_btn_action); lv_watch_set_free_num(voicebtn, index); lv_obj_t * videobtn = lv_imgbtn_create(cont, NULL); lv_imgbtn_set_src(videobtn, LV_BTN_STATE_RELEASED, ICON_VIDEO_CALL_VIDEO_BTN); lv_imgbtn_set_src(videobtn, LV_BTN_STATE_PRESSED, ICON_VIDEO_CALL_VIDEO_BTN); +#ifdef USE_LV_WATCH_UI_240_240_CIRCLE + lv_obj_align(videobtn, cont, LV_ALIGN_IN_RIGHT_MID, -5, 0); +#else lv_obj_align(videobtn, cont, LV_ALIGN_IN_BOTTOM_MID, 0, -10); +#endif lv_obj_set_event_cb(videobtn, mmi_vc_video_btn_action); lv_watch_set_free_num(videobtn, index); } @@ -2024,12 +2023,12 @@ void video_call_create_event_cb(lv_obj_t * btn, lv_event_t e) //interface -uint8_t mmi_vc_get_call_volume_tongxin(void) +uint8_t mmi_vc_get_call_volume(void) { return(s_video_call_params.speaker_volume); } -bool mmi_vc_watch_suspend_check_tongxin(void) +bool mmi_vc_watch_suspend_check(void) { if((s_video_call_params.call_type == MODEM_VIDEO_CALL_TYPE_VIDEO) || (MMI_VIDEO_CALL_STATE_INCOMING == s_video_call_params.state) @@ -2043,7 +2042,7 @@ bool mmi_vc_watch_suspend_check_tongxin(void) return true; } -bool mmi_vc_connect_check_req_tongxin(void) +bool mmi_vc_connect_check_req(void) { if(mmi_vc_call_get_activity_obj()) { @@ -2053,7 +2052,7 @@ bool mmi_vc_connect_check_req_tongxin(void) return false; } -void mmi_vc_activity_destroy_req_tongxin(void) +void mmi_vc_activity_destroy_req(void) { VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.h b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.h index 2e787fb3..ff37094e 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.h @@ -243,10 +243,10 @@ bool mmi_video_call_is_in_call(void); void video_call_create_event_cb(lv_obj_t *btn, lv_event_t e); -bool mmi_vc_connect_check_req_tongxin(void); -bool mmi_vc_watch_suspend_check_tongxin(void); -void mmi_vc_activity_destroy_req_tongxin(void); -uint8_t mmi_vc_get_call_volume_tongxin(void); +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 diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/restart_and_reset/restart_and_reset.c b/2.sdk/sdk/gui/lv_watch/lv_apps/restart_and_reset/restart_and_reset.c index f1e524b8..bd72d28a 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/restart_and_reset/restart_and_reset.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/restart_and_reset/restart_and_reset.c @@ -152,17 +152,18 @@ lv_obj_t * restart_create(lv_obj_t * activity_obj) if(NULL == obj) return NULL; - label = lv_label_create(obj, NULL); - lv_obj_set_size(label, LV_HOR_RES, LV_VER_RES / 6); - lv_label_set_text_id(label, WATCH_TEXT_ID_RESTART); - lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20_gray); - lv_obj_align(label, obj, LV_ALIGN_IN_TOP_MID, 0, 25); + //label = lv_label_create(obj, NULL); + //lv_obj_set_size(label, LV_HOR_RES, LV_VER_RES / 6); + //lv_label_set_text_id(label, WATCH_TEXT_ID_RESTART); + //lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20_gray); + //lv_obj_align(label, obj, LV_ALIGN_IN_TOP_MID, 0, 25); content = lv_cont_create(obj, NULL); lv_obj_add_style(content, LV_CONT_PART_MAIN, &lv_watch_style_transp); lv_cont_set_fit(content, LV_FIT_TIGHT); lv_cont_set_layout(content, LV_LAYOUT_CENTER); - lv_obj_align(content, label, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); + //lv_obj_align(content, label, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); + lv_obj_align(content, obj, LV_ALIGN_IN_TOP_MID, 0, 50); lv_obj_set_click(content, false); lv_watch_obj_add_element(content);