static TIMER_ID s_watch_search_timer_id = NULL;
-static TIMER_ID s_watch_falldwon_id = NULL;
-
void mmi_watch_search_timer_stop(void)
{
}
}
-void mmi_falldwon_timer_stop(void)
-{
- if(NULL != s_watch_falldwon_id)
- {
- Hal_Timer_Stop(s_watch_falldwon_id);
- s_watch_falldwon_id = NULL;
- }
-}
-
-
static void mmi_watch_search_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
{
SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: priority=%d\n", __FUNCTION__, __LINE__, priority);
}
}
-static void mmi_falldwon_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
-{
- SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: priority=%d\n", __FUNCTION__, __LINE__, priority);
-
- if(AUDIO_CTRL_PRIORITY_9 == priority)
- {
-
- }
- else if(AUDIO_CTRL_PRIORITY_9 > priority)
- {
- mmi_falldwon_destroy();
- }
-}
-
void mmi_watch_search_timeout_cb(void * para)
{
mmi_watch_search_screen_destroy();
}
-void mmi_falldwon_timeout_cb(void * para)
-{
- mmi_falldwon_destroy();
-}
-
void mmi_watch_search_timer_start(void)
{
mmi_watch_search_timer_stop();
s_watch_search_timer_id = Hal_Timer_Start(MMI_WATCH_SEARCH_DURATION, mmi_watch_search_timeout_cb, NULL, false);
}
-void mmi_falldwon_timer_start(void)
-{
- mmi_falldwon_timer_stop();
- s_watch_falldwon_id = Hal_Timer_Start(MMI_WATCH_SEARCH_DURATION, mmi_falldwon_timeout_cb, NULL, false);
-}
-
void mmi_watch_search_screen_destroy(void)
{
SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
//watch_wakeup_time_reset();
}
+void mmi_watch_search_screen_event_cb(lv_obj_t * obj, lv_event_t e)
+{
+ if(LV_EVENT_CLICKED == e)
+ {
+ mmi_watch_search_screen_destroy(); // lv_watch_del_interface(ACT_ID_WATCH_SEARCHING);
+ }
+}
-void mmi_falldwon_destroy(void)
+lv_obj_t * mmi_watch_server_search_screen_create(lv_obj_t * activity_obj)
{
SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
- //lv_watch_search_ext_t * ext = lv_obj_get_ext_attr(lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING));
+ lv_watch_png_cache_all_free();
+ if(NULL == activity_obj)
+ {
+ lv_watch_activity_ext_t activity_ext = {0};
+
+ activity_ext.actId = ACT_ID_WATCH_SEARCHING;
+ activity_ext.create = (lv_watch_activity_create_f_t)mmi_watch_server_search_screen_create;
+ activity_ext.prepare_destory = mmi_watch_search_screen_destroy;
+ activity_obj = lv_watch_creat_activity_obj(&activity_ext);
+ if(NULL == activity_obj)
+ return NULL;
+ }
+
+ lv_obj_t * obj = lv_watch_obj_create(activity_obj);
+ LV_ASSERT_MEM(obj);
- mmi_falldwon_timer_stop();
+ lv_watch_search_ext_t * searching_ext = lv_obj_allocate_ext_attr(obj, sizeof(lv_watch_search_ext_t));
- Hal_NFFS_File_Play_End();
- Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_SEARCH);
- Hal_Vibrator_Play_End();
+ 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_obj_set_style_local_bg_color(cont, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0, 0, 0)); // LV_COLOR_BLACK
+ lv_obj_set_click(cont, true);
+ lv_obj_set_event_cb(cont, mmi_watch_search_screen_event_cb);
+ //lv_obj_add_protect(cont, LV_PROTECT_PRESS_LOST);
+
+ lv_obj_t * label = lv_label_create(cont, NULL);
+#ifdef USE_LV_WATCH_UI_466_466
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font40);
+#else
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20);
+#endif
+ lv_label_set_text_id(label, WATCH_TEXT_ID_SERVER_SEARCH_PROMPT); //lv_lang_get_text(WATCH_TEXT_ID_SERVER_SEARCH_PROMPT)
+ lv_obj_align(label, cont, LV_ALIGN_CENTER, 0, 0);
+
+ //prompt
+ if (AUDIO_CTRL_PRIORITY_SEARCH == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_SEARCH, mmi_watch_search_audio_ctrl_callback))
+ {
+ uint8_t volume = 0;
+ #ifdef __MMI_USER_PROFILE_SUPPORT__
+ volume = mmi_user_profile_current_mode_remind_volume_get();
+ #else
+ volume = query_current_volume();
+ #endif
+ Hal_NFFS_File_Play_Repeat(AUDIO_WATCH_SEARCH, volume); // HAL_AUDIO_SPK_LEVEL_MAX);
+ }
+ if(true == mmi_watch_vibrate_is_permitted())
+ {
+ Hal_Vibrator_Play_Repeat();
+ }
- lv_watch_png_cache_all_free();
- //lv_obj_del_async(lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING));
- lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_WATCH_FALLDWON);
- if(activity_obj)
+ mmi_watch_search_timer_start();
+
+ watch_set_suspend_enable(false, ACT_ID_WATCH_SEARCHING, 0);
+
+ return obj;
+}
+
+void mmi_ui_msg_update_watch_server_search(void)
+{
+ mmi_watch_server_search_screen_create(NULL);
+}
+
+void mmi_watch_searching_aciton(void)
+{
+ SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
+ if(true == mmi_active_screen_is_prohibit_interrupted()
+ #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
+ || true == mmi_watch_is_in_do_not_disturb_time()
+ #endif
+ )
{
- lv_obj_del(activity_obj);
- }
+ return ;
+ }
- watch_set_suspend_enable(true, ACT_ID_WATCH_FALLDWON, 0);
- //watch_wakeup_time_reset();
+#ifdef __MMI_WECHAT_SUPPORT__
+ if(true == wechat_screen_is_prohibit_interrupted())
+ {
+ return;
+ }
+#endif
+
+ if(NULL != lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING))
+ {
+ return ;
+ }
+
+ // ui
+ mmi_watch_wake_up();
+ mmi_ui_msg_action_watch_searching();
}
-void mmi_watch_search_screen_event_cb(lv_obj_t * obj, lv_event_t e)
-{
- if(LV_EVENT_CLICKED == e)
+static TIMER_ID s_watch_falldwon_id = NULL;
+
+void mmi_falldwon_timer_stop(void)
+{
+ if(NULL != s_watch_falldwon_id)
{
- mmi_watch_search_screen_destroy(); // lv_watch_del_interface(ACT_ID_WATCH_SEARCHING);
+ Hal_Timer_Stop(s_watch_falldwon_id);
+ s_watch_falldwon_id = NULL;
+ }
+}
+
+static void mmi_falldwon_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
+{
+ SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: priority=%d\n", __FUNCTION__, __LINE__, priority);
+
+ if(AUDIO_CTRL_PRIORITY_9 == priority)
+ {
+
+ }
+ else if(AUDIO_CTRL_PRIORITY_9 > priority)
+ {
+ mmi_falldwon_destroy();
}
}
+void mmi_falldwon_timeout_cb(void * para)
+{
+ mmi_falldwon_OK_event_cb(NULL,LV_EVENT_CLICKED);
+}
+
+void mmi_falldwon_timer_start(void)
+{
+ mmi_falldwon_timer_stop();
+ s_watch_falldwon_id = Hal_Timer_Start(10*1000, mmi_falldwon_timeout_cb, NULL, false);
+}
+
+void mmi_falldwon_destroy(void)
+{
+ SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
+ mmi_falldwon_timer_stop();
+
+ Hal_NFFS_File_Play_End();
+ Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_9);
+ Hal_Vibrator_Play_End();
+
+ lv_watch_png_cache_all_free();
+
+ watch_set_suspend_enable(true, ACT_ID_WATCH_FALLDWON, 0);
+}
+
void mmi_falldwon_event_cb(lv_obj_t * obj, lv_event_t e)
{
if(LV_EVENT_CLICKED == e)
{
-
- mmi_falldwon_destroy(); // lv_watch_del_interface(ACT_ID_WATCH_SEARCHING);
+ mmi_falldwon_destroy();
+ //lv_obj_del_async(lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING));
+ lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_WATCH_FALLDWON);
+ if(activity_obj)
+ {
+ lv_obj_del(activity_obj);
+ }
}
}
-
void mmi_falldwon_OK_event_cb(lv_obj_t * obj, lv_event_t e)
{
if(LV_EVENT_CLICKED == e)
{
mmi_protocol_action_fall_down();
- mmi_falldwon_destroy(); // lv_watch_del_interface(ACT_ID_WATCH_SEARCHING);
+ mmi_falldwon_event_cb(NULL,LV_EVENT_CLICKED);
}
}
-
-
lv_obj_t * mmi_watch_falldwon_create(lv_obj_t * activity_obj)
{
SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
if (AUDIO_CTRL_PRIORITY_9 == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_9, mmi_falldwon_audio_ctrl_callback))
{
Hal_NFFS_File_Play_Repeat(AUDIO_FALLDOWN, HAL_AUDIO_SPK_LEVEL_MAX); // query_current_volume()
- }
- Hal_Vibrator_Play_Repeat();
-
- mmi_falldwon_timer_start();
-
- watch_set_suspend_enable(false, ACT_ID_WATCH_FALLDWON, 0);
-
- return obj;
-}
-
-
-lv_obj_t * mmi_watch_server_search_screen_create(lv_obj_t * activity_obj)
-{
- SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
-
- lv_watch_png_cache_all_free();
- if(NULL == activity_obj)
- {
- lv_watch_activity_ext_t activity_ext = {0};
-
- activity_ext.actId = ACT_ID_WATCH_SEARCHING;
- activity_ext.create = (lv_watch_activity_create_f_t)mmi_watch_server_search_screen_create;
- activity_ext.prepare_destory = mmi_watch_search_screen_destroy;
- activity_obj = lv_watch_creat_activity_obj(&activity_ext);
- if(NULL == activity_obj)
- return NULL;
- }
-
- lv_obj_t * obj = lv_watch_obj_create(activity_obj);
- LV_ASSERT_MEM(obj);
-
- lv_watch_search_ext_t * searching_ext = lv_obj_allocate_ext_attr(obj, sizeof(lv_watch_search_ext_t));
-
- 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_obj_set_style_local_bg_color(cont, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0, 0, 0)); // LV_COLOR_BLACK
- lv_obj_set_click(cont, true);
- lv_obj_set_event_cb(cont, mmi_watch_search_screen_event_cb);
- //lv_obj_add_protect(cont, LV_PROTECT_PRESS_LOST);
-
- lv_obj_t * label = lv_label_create(cont, NULL);
-#ifdef USE_LV_WATCH_UI_466_466
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font40);
-#else
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20);
-#endif
- lv_label_set_text_id(label, WATCH_TEXT_ID_SERVER_SEARCH_PROMPT); //lv_lang_get_text(WATCH_TEXT_ID_SERVER_SEARCH_PROMPT)
- lv_obj_align(label, cont, LV_ALIGN_CENTER, 0, 0);
-
- //prompt
- if (AUDIO_CTRL_PRIORITY_SEARCH == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_SEARCH, mmi_watch_search_audio_ctrl_callback))
- {
- uint8_t volume = 0;
- #ifdef __MMI_USER_PROFILE_SUPPORT__
- volume = mmi_user_profile_current_mode_remind_volume_get();
- #else
- volume = query_current_volume();
- #endif
- Hal_NFFS_File_Play_Repeat(AUDIO_WATCH_SEARCH, volume); // HAL_AUDIO_SPK_LEVEL_MAX);
}
if(true == mmi_watch_vibrate_is_permitted())
{
Hal_Vibrator_Play_Repeat();
}
- mmi_watch_search_timer_start();
+ mmi_falldwon_timer_start();
- watch_set_suspend_enable(false, ACT_ID_WATCH_SEARCHING, 0);
+ watch_set_suspend_enable(false, ACT_ID_WATCH_FALLDWON, 0);
return obj;
}
-void mmi_ui_msg_update_watch_server_search(void)
-{
- mmi_watch_server_search_screen_create(NULL);
-}
-
-
void mmi_ui_msg_update_falldwon(void)
{
if(lv_watch_get_activity_obj(ACT_ID_WATCH_FALLDWON)==NULL)
{
-
mmi_watch_falldwon_create(NULL);
}
-
-}
-
-void mmi_watch_searching_aciton(void)
-{
- SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
-
- if(true == mmi_active_screen_is_prohibit_interrupted()
- #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
- || true == mmi_watch_is_in_do_not_disturb_time()
- #endif
- )
- {
- return ;
- }
-
-#ifdef __MMI_WECHAT_SUPPORT__
- if(true == wechat_screen_is_prohibit_interrupted())
- {
- return;
- }
-#endif
-
- if(NULL != lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING))
- {
- return ;
- }
-
- // ui
- mmi_watch_wake_up();
- mmi_ui_msg_action_watch_searching();
}