lv_obj_t * cont_gif = lv_cont_create(cont, NULL);
lv_obj_set_size(cont_gif, 170, 170); // gif size
+ lv_obj_set_style_local_bg_color(cont_gif, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
lv_obj_align(cont_gif, cont, LV_ALIGN_CENTER, 0, -30);
hal_rtc_t cur_time;
lv_wechat_ext_t * ext = wechat_actId_ext_get(ACT_ID_WECHAT_MAIN);
if(NULL == ext)
+ {
+ WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
return;
-
- WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ }
wechat_chat_list_set_slide_enable(&ext->old_ext, true);
lv_obj_del(ext->list);
ext->list = NULL;
}
-
- WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
if(NULL != ext->delete_timer_id)
{
Hal_Timer_Stop(ext->delete_timer_id);
ext->delete_timer_id = NULL;
}
- WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
if(NULL != ext->delete_bg)
{
lv_obj_del(ext->delete_bg);
WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ lv_obj_set_hidden(ext->label_no_network, true);
+ lv_obj_set_hidden(ext->label_not_bind, true);
+ lv_obj_set_hidden(ext->img_record, false);
+
uint8_t msg_count = wechat_msg_info_count_get();
if(0 == msg_count)
{
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;
- }
+ // no network
+ ext->label_no_network = lv_label_create(cont, NULL);
+ lv_obj_add_style(ext->label_no_network, LV_LABEL_PART_MAIN, &lv_watch_font26_black);
+ lv_label_set_text_id(ext->label_no_network, WATCH_TEXT_ID_DEVICE_NO_NETWORK);
+ lv_label_set_align(ext->label_no_network, LV_LABEL_ALIGN_CENTER);
+ lv_obj_align(ext->label_no_network, cont, LV_ALIGN_CENTER, 0, -10);
+
+ // not bind
+ ext->label_not_bind = lv_label_create(cont, ext->label_no_network);
+ //lv_obj_add_style(ext->label_not_bind, LV_LABEL_PART_MAIN, &lv_watch_font26_black);
+ lv_label_set_text_id(ext->label_not_bind, WATCH_TEXT_ID_DEVICE_NOT_BIND);
+ //lv_label_set_align(ext->label_not_bind, LV_LABEL_ALIGN_CENTER);
+ lv_obj_align(ext->label_not_bind, cont, LV_ALIGN_CENTER, 0, -10);
//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);
+ ext->label_no_msg = lv_label_create(cont, ext->label_no_network);
+ //lv_obj_add_style(ext->label_no_msg, LV_LABEL_PART_MAIN, &lv_watch_font26_black);
lv_label_set_text_id(ext->label_no_msg, WATCH_TEXT_ID_NO_VOICE_MSG);
//lv_label_set_align(ext->label_no_msg, LV_LABEL_ALIGN_CENTER);
lv_obj_align(ext->label_no_msg, cont, LV_ALIGN_CENTER, 0, -10);
lv_watch_obj_add_element(ext->img_record);
lv_obj_align(ext->img_record, cont, LV_ALIGN_IN_BOTTOM_MID, 0, -8);
- uint8_t msg_count = wechat_msg_info_count_get();
- if(0 == msg_count)
- {
- lv_obj_set_hidden(ext->label_no_msg, false);
- }
+ if(false == watch_modem_sim_present_check_req()
+ //|| (MMI_MODEM_SIGNAL_BAR_0 == watch_modem_get_signal_bar_req())
+ )
+ {
+ lv_obj_set_hidden(ext->label_no_network, false);
+ lv_obj_set_hidden(ext->label_not_bind, true);
+ lv_obj_set_hidden(ext->label_no_msg, true);
+ lv_obj_set_hidden(ext->img_record, true);
+ }
+ else if(true != mmi_watch_tcp_connect_state_get()
+ || true != mmi_protocol_watch_bind_state_get()
+ )
+ {
+ lv_obj_set_hidden(ext->label_no_network, true);
+ lv_obj_set_hidden(ext->label_not_bind, false);
+ lv_obj_set_hidden(ext->label_no_msg, true);
+ lv_obj_set_hidden(ext->img_record, true);
+ }
else
{
- lv_obj_set_hidden(ext->label_no_msg, true);
+ lv_obj_set_hidden(ext->label_no_network, true);
+ lv_obj_set_hidden(ext->label_not_bind, true);
+ lv_obj_set_hidden(ext->img_record, false);
- wechat_chat_list_create(cont, ext);
+ uint8_t msg_count = wechat_msg_info_count_get();
+ if(0 == msg_count)
+ {
+ lv_obj_set_hidden(ext->label_no_msg, false);
+ }
+ else
+ {
+ lv_obj_set_hidden(ext->label_no_msg, true);
+
+ wechat_chat_list_create(cont, ext);
+ }
}
//uint32_t fs_total = 0;
lv_watch_obj_ext_t old_ext;
lv_obj_t * cont;
lv_obj_t * list; // chat list
- lv_obj_t * label_no_msg; // mo msg prompt
//lv_obj_t * img_emo;
lv_obj_t * img_record; // record button
+ lv_obj_t * label_no_network; // no network prompt
+ lv_obj_t * label_not_bind; // not bind prompt
+ lv_obj_t * label_no_msg; // no msg prompt
lv_wechat_created_from_e from; // msg from
lv_wechat_ext_t * ext = wechat_actId_ext_get(ACT_ID_WECHAT_MAIN);
if(NULL == ext)
+ {
+ WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
return;
-
- WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ }
wechat_chat_list_set_slide_enable(&ext->old_ext, true);
lv_obj_del(ext->list);
ext->list = NULL;
}
-
- WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
if(NULL != ext->delete_timer_id)
{
Hal_Timer_Stop(ext->delete_timer_id);
ext->delete_timer_id = NULL;
}
- WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
if(NULL != ext->delete_bg)
{
lv_obj_del(ext->delete_bg);
WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ lv_obj_set_hidden(ext->label_no_network, true);
+ lv_obj_set_hidden(ext->label_not_bind, true);
+ lv_obj_set_hidden(ext->img_record, false);
+
uint8_t msg_count = wechat_msg_info_count_get();
if(0 == msg_count)
{
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;
- }
+ // no network
+ ext->label_no_network = lv_label_create(cont, NULL);
+ lv_obj_add_style(ext->label_no_network, LV_LABEL_PART_MAIN, &lv_watch_font26_black);
+ lv_label_set_text_id(ext->label_no_network, WATCH_TEXT_ID_DEVICE_NO_NETWORK);
+ lv_label_set_align(ext->label_no_network, LV_LABEL_ALIGN_CENTER);
+ lv_obj_align(ext->label_no_network, cont, LV_ALIGN_CENTER, 0, -10);
+
+ // not bind
+ ext->label_not_bind = lv_label_create(cont, ext->label_no_network);
+ //lv_obj_add_style(ext->label_not_bind, LV_LABEL_PART_MAIN, &lv_watch_font26_black);
+ lv_label_set_text_id(ext->label_not_bind, WATCH_TEXT_ID_DEVICE_NOT_BIND);
+ //lv_label_set_align(ext->label_not_bind, LV_LABEL_ALIGN_CENTER);
+ lv_obj_align(ext->label_not_bind, cont, LV_ALIGN_CENTER, 0, -10);
//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);
+ ext->label_no_msg = lv_label_create(cont, ext->label_no_network);
+ //lv_obj_add_style(ext->label_no_msg, LV_LABEL_PART_MAIN, &lv_watch_font26_black);
lv_label_set_text_id(ext->label_no_msg, WATCH_TEXT_ID_NO_VOICE_MSG);
//lv_label_set_align(ext->label_no_msg, LV_LABEL_ALIGN_CENTER);
lv_obj_align(ext->label_no_msg, cont, LV_ALIGN_CENTER, 0, -10);
lv_watch_obj_add_element(ext->img_record);
lv_obj_align(ext->img_record, cont, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
- uint8_t msg_count = wechat_msg_info_count_get();
- if(0 == msg_count)
- {
- lv_obj_set_hidden(ext->label_no_msg, false);
- }
+ if(false == watch_modem_sim_present_check_req()
+ //|| (MMI_MODEM_SIGNAL_BAR_0 == watch_modem_get_signal_bar_req())
+ )
+ {
+ lv_obj_set_hidden(ext->label_no_network, false);
+ lv_obj_set_hidden(ext->label_not_bind, true);
+ lv_obj_set_hidden(ext->label_no_msg, true);
+ lv_obj_set_hidden(ext->img_record, true);
+ }
+ else if(true != mmi_watch_tcp_connect_state_get()
+ || true != mmi_protocol_watch_bind_state_get()
+ )
+ {
+ lv_obj_set_hidden(ext->label_no_network, true);
+ lv_obj_set_hidden(ext->label_not_bind, false);
+ lv_obj_set_hidden(ext->label_no_msg, true);
+ lv_obj_set_hidden(ext->img_record, true);
+ }
else
{
- lv_obj_set_hidden(ext->label_no_msg, true);
+ lv_obj_set_hidden(ext->label_no_network, true);
+ lv_obj_set_hidden(ext->label_not_bind, true);
+ lv_obj_set_hidden(ext->img_record, false);
- wechat_chat_list_create(cont, ext);
+ uint8_t msg_count = wechat_msg_info_count_get();
+ if(0 == msg_count)
+ {
+ lv_obj_set_hidden(ext->label_no_msg, false);
+ }
+ else
+ {
+ lv_obj_set_hidden(ext->label_no_msg, true);
+
+ wechat_chat_list_create(cont, ext);
+ }
}
//uint32_t fs_total = 0;
static MMI_WATCH_LOCATION_STATE_E s_watch_location_gps_state = 0, s_watch_location_cell_state = 0, s_watch_location_wifi_state = 0;
static MMI_WATCH_LOCATION_DATA_T s_watch_location_data = {0};
static lv_ll_t s_watch_location_mission_ll = {0};
+static uint8_t s_watch_location_mission_ll_locked = 0;
static void * s_watch_location_timer_id = NULL;
static uint8_t s_watch_location_times_check_count = 0;
void mmi_watch_location_mission_list_init(void)
{
+ s_watch_location_mission_ll_locked = 0;
_lv_ll_init(&s_watch_location_mission_ll, sizeof(MMI_WATCH_LOCATION_TYPE_E));
}
+/*
void mmi_watch_location_mission_list_node_remove(MMI_WATCH_LOCATION_TYPE_E location_type)
{
if(true == _lv_ll_is_empty(&s_watch_location_mission_ll))
node = _lv_ll_get_prev(&s_watch_location_mission_ll, node);
}
}
+*/
-void mmi_watch_location_mission_list_node_add(MMI_WATCH_LOCATION_TYPE_E location_type)
+bool mmi_watch_location_mission_list_node_add(MMI_WATCH_LOCATION_TYPE_E location_type)
{
+ if(1 == s_watch_location_mission_ll_locked)
+ {
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: location ll locked\n", __FUNCTION__, __LINE__);
+ return false;
+ }
+
MMI_WATCH_LOCATION_TYPE_E * node = _lv_ll_get_head(&s_watch_location_mission_ll);
- LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d\n", __FUNCTION__, __LINE__, (NULL != node) ? 1 : 0);
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: location ll head=0x%x\n", __FUNCTION__, __LINE__, (NULL != node) ? node : 0);
while(NULL != node)
{
if(location_type == * node)
{
- LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
- return ; // exist
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: location type exist\n", __FUNCTION__, __LINE__);
+ return false;
}
node = _lv_ll_get_next(&s_watch_location_mission_ll, node);
}
- LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: location type add\n", __FUNCTION__, __LINE__);
MMI_WATCH_LOCATION_TYPE_E * new_node = _lv_ll_ins_head(&s_watch_location_mission_ll);
* new_node = location_type;
+
+ return true;
}
void mmi_watch_location_mission_list_data_send(void)
if(true == _lv_ll_is_empty(&s_watch_location_mission_ll))
return;
+ s_watch_location_mission_ll_locked = 1;
MMI_WATCH_LOCATION_TYPE_E * node = _lv_ll_get_tail(&s_watch_location_mission_ll);
LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
break;
}
- MMI_WATCH_LOCATION_TYPE_E * old_node = node;
- node = _lv_ll_get_prev(&s_watch_location_mission_ll, node);
- _lv_ll_remove(&s_watch_location_mission_ll, old_node);
- lv_mem_free(old_node);
- old_node = NULL;
+ MMI_WATCH_LOCATION_TYPE_E * pre_node = _lv_ll_get_prev(&s_watch_location_mission_ll, node);
+ _lv_ll_remove(&s_watch_location_mission_ll, node);
+ lv_mem_free(node);
+ node = pre_node;
}
}
{
LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ s_watch_location_mission_ll_locked = 0;
s_watch_location_state = 0;
if(NULL != s_watch_location_timer_id)
{
return;
}
- mmi_watch_location_mission_list_node_add(location_type);
- mmi_watch_location_mission_start();
+ if(true == mmi_watch_location_mission_list_node_add(location_type))
+ {
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ mmi_watch_location_mission_start();
+ }
}
void mmi_watch_location_mission_timed_location_action(void)