void wechat_msg_sending_result_screen_timeout(void *para)
{
- lv_wechat_msg_sending_ext_t * sending_ext = (lv_wechat_msg_sending_ext_t *)para;
-
WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
-
- if(NULL != sending_ext->result_timer_id)
- {
- Hal_Timer_Stop(sending_ext->result_timer_id);
- sending_ext->result_timer_id = NULL;
- }
+
+ wechat_msg_sending_screen_prepare_destory(NULL);
//delete sending screen
//lv_watch_del_interface(ACT_ID_WECHAT_SENDING);
- wechat_msg_sending_screen_prepare_destory(NULL);
+ lv_obj_t * obj = lv_watch_get_activity_obj(ACT_ID_WECHAT_SENDING);
+ if(NULL != obj)
+ {
+ //WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ lv_obj_del(obj);
+ }
//return main list screen
wechat_main_screen_refresh();
sending_ext->sending_anim.var = NULL;
}
- sending_ext->result_timer_id = Hal_Timer_Start(1000 * 2, wechat_msg_sending_result_screen_timeout, sending_ext, FALSE);
+ sending_ext->result_timer_id = Hal_Timer_Start(1500, wechat_msg_sending_result_screen_timeout, sending_ext, FALSE);
}
void wechat_msg_sending_screen_prepare_destory(lv_obj_t * activity_obj)
{
- printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
lv_watch_png_cache_all_free();
lv_wechat_msg_sending_ext_t * sending_ext = (lv_wechat_msg_sending_ext_t *)wechat_actId_ext_get(ACT_ID_WECHAT_SENDING);
if(NULL != sending_ext)
{
+ //WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
if(NULL != sending_ext->sending_timer_id)
{
Hal_Timer_Stop(sending_ext->sending_timer_id);
sending_ext->sending_timer_id = NULL;
}
+ //WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
if(NULL != sending_ext->result_timer_id)
{
Hal_Timer_Stop(sending_ext->result_timer_id);
sending_ext->result_timer_id = NULL;
}
+ //WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
if(NULL != sending_ext->sending_anim.var)
{
lv_anim_del(sending_ext->sending_anim.var, NULL);
sending_ext->sending_anim.var = NULL;
}
}
-
- lv_obj_t * obj = lv_watch_get_activity_obj(ACT_ID_WECHAT_SENDING);
- if(NULL != obj)
- {
- lv_obj_del(obj);
- }
}
lv_obj_t * wechat_msg_sending_screen_create(lv_obj_t * activity_obj)
lv_wechat_msg_sending_ext_t * sending_ext = (lv_wechat_msg_sending_ext_t *)lv_obj_allocate_ext_attr(obj, sizeof(lv_wechat_msg_sending_ext_t));
if(NULL == sending_ext)
return NULL;
+
+ wechat_chat_list_set_slide_enable(&sending_ext->old_ext, false); /*prevent to slide out while recording*/
+ sending_ext->result_timer_id = NULL;
sending_ext->send_result = wechat_msg_send_to_server();
sending_ext->sending_timer_id = Hal_Timer_Start(1000 * 3, wechat_msg_sending_screen_timeout, sending_ext, FALSE);
return;
}
- wechat_chat_list_set_slide_enable(&ext->old_ext, false); /*prevent to slide out while recording*/
- lv_obj_t * activity_obj = NULL;
+ lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_WECHAT_RECORDING);
switch(ext->event)
{
case MCI_EVENT_EOS:
- wechat_chat_list_set_slide_enable(&ext->old_ext, true); /*reset slide_enable at the end of recording*/
//lv_watch_del_interface(ACT_ID_WECHAT_RECORDING);
- activity_obj = lv_watch_get_activity_obj(ACT_ID_WECHAT_RECORDING);
if(NULL != activity_obj)
{
lv_obj_del(activity_obj);
Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_5);
lv_fs_remove(s_wechat_msg_item_info.msg_data_full_file_name);
//lv_watch_del_interface(ACT_ID_WECHAT_RECORDING);
- activity_obj = lv_watch_get_activity_obj(ACT_ID_WECHAT_RECORDING);
if(NULL != activity_obj)
{
lv_obj_del(activity_obj);
lv_wechat_msg_recording_ext_t * recording_ext = lv_obj_allocate_ext_attr(obj, sizeof(lv_wechat_msg_recording_ext_t));
LV_ASSERT_MEM(recording_ext);
+ wechat_chat_list_set_slide_enable(&recording_ext->old_ext, false); /*prevent to slide out while recording*/
+
lv_obj_t * cont = lv_cont_create(obj, NULL);
lv_obj_set_size(cont, lv_obj_get_width(obj), lv_obj_get_height(obj));
lv_obj_align(cont, obj, LV_ALIGN_CENTER, 0, 0);
s_wechat_msg_item_info.msg_time.tm_hour, s_wechat_msg_item_info.msg_time.tm_min, s_wechat_msg_item_info.msg_time.tm_sec);
WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: msg_from=%d, file_name=%s\n", __FUNCTION__, __LINE__,
- s_wechat_msg_item_info.msg_from, s_wechat_msg_item_info.msg_data_full_file_name);
+ s_wechat_msg_item_info.msg_from, s_wechat_msg_item_info.msg_data_full_file_name);
//recording
if(AUDIO_CTRL_PRIORITY_5 == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_5, wechat_msg_recording_audio_ctrl_callback))
/*sliding to the right, not click button*/
return;
}
-
- wechat_chat_list_set_slide_enable(&ext->old_ext, false); /*prevent to slide out while recording*/
uint32_t fs_total = 0, fs_free = 0;
lv_fs_free_space('C', &fs_total, &fs_free);
if(NULL == recording_ext)
return NULL;
- wechat_chat_list_set_slide_enable(&ext->old_ext, true); /*reset slide_enable at the end of recording*/
-
lv_indev_t * indev = lv_indev_get_act();
if(indev)
{
}
}
-void wechat_no_network_create(lv_obj_t * obj)
-{
- lv_obj_t * img = lv_img_create(obj, NULL);
- //lv_obj_set_size(img, lv_obj_get_width(obj), lv_obj_get_height(obj));
- lv_img_set_src(img, ICON_WECHAT_NO_NETWORK);
- lv_obj_align(img, obj, LV_ALIGN_CENTER, 0, 0);
- lv_obj_set_click(img, false);
-}
+//void wechat_no_network_create(lv_obj_t * obj)
+//{
+// lv_obj_t * img = lv_img_create(obj, NULL);
+// //lv_obj_set_size(img, lv_obj_get_width(obj), lv_obj_get_height(obj));
+// lv_img_set_src(img, ICON_WECHAT_NO_NETWORK);
+// lv_obj_align(img, obj, LV_ALIGN_CENTER, 0, 0);
+// lv_obj_set_click(img, false);
+//}
void wechat_main_screen_refresh(void)
{
WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ wechat_chat_list_set_slide_enable(&ext->old_ext, true);
+
wechat_msg_voice_item_playing_stop(ext);
wechat_chat_list_msg_item_style_reset(ext);
ext->from = from;
ext->delete_timer_id = NULL;
- if(false == watch_modem_sim_present_check_req())
- //|| (MMI_MODEM_SIGNAL_BAR_0 == watch_modem_get_signal_bar_req()))
- {
- wechat_no_network_create(obj);
- return obj;
- }
-
lv_obj_t * cont = lv_cont_create(obj, NULL);
lv_obj_set_size(cont, lv_obj_get_width(obj), lv_obj_get_height(obj));
lv_obj_align(cont, obj, LV_ALIGN_CENTER, 0, 0);
lv_watch_obj_add_element(cont);
ext->cont = cont;
+ if(false == watch_modem_sim_present_check_req()
+ //|| (MMI_MODEM_SIGNAL_BAR_0 == watch_modem_get_signal_bar_req())
+ )
+ {
+ // no network
+ lv_obj_t * label = lv_label_create(cont, NULL);
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font26_black);
+ lv_label_set_text_id(label, WATCH_TEXT_ID_DEVICE_NO_NETWORK);
+ lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
+ lv_obj_align(label, cont, LV_ALIGN_CENTER, 0, -10);
+
+ return obj;
+ }
+ else if(true != mmi_watch_tcp_connect_state_get()
+ || true != mmi_protocol_watch_bind_state_get()
+ )
+ {
+ // not bind
+ lv_obj_t * label = lv_label_create(cont, NULL);
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font26_black);
+ lv_label_set_text_id(label, WATCH_TEXT_ID_DEVICE_NOT_BIND);
+ lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
+ lv_obj_align(label, cont, LV_ALIGN_CENTER, 0, -10);
+
+ return obj;
+ }
+
//create no msg label
ext->label_no_msg = lv_label_create(cont, NULL);
lv_obj_add_style(ext->label_no_msg, LV_LABEL_PART_MAIN, &lv_watch_font26_black);