gengxin
authorCCC <2393524978@qq.com>
Wed, 23 Aug 2023 12:21:10 +0000 (20:21 +0800)
committerCCC <2393524978@qq.com>
Wed, 23 Aug 2023 12:21:10 +0000 (20:21 +0800)
2.sdk/sdk/gui/lv_watch/lv_apps/dialpad/dialpad.c
2.sdk/sdk/gui/lv_watch/lv_apps/dialpad/dialpad.h
2.sdk/sdk/gui/lv_watch/lv_apps/mmi_wechat/wechat.h
2.sdk/sdk/gui/lv_watch/lv_apps/mmi_wechat/wechat_ui.c

index 0fad444..70adbc2 100644 (file)
@@ -43,6 +43,52 @@ static lv_res_t dialpad_btn_short_click_action(lv_obj_t * btn);
 /**********************
  *   GLOBAL FUNCTIONS
 ***********************/
+
+#ifdef __MMI_ZHSX_SUPPORT__
+
+static nv_watch_switch_t s_dial_pad_switch = {0};
+static uint8_t s_dial_pad_switch_init = 0;
+
+void mmi_dial_pad_switch_nv_write(void)
+{
+       uint32_t nv_data_length = sizeof(nv_watch_switch_t);
+       
+       if(nv_data_length != UI_NV_Write_Req(NV_SECTION_UI_DIAL_PAD_SWITCH, 0, nv_data_length, (uint8_t *)&s_dial_pad_switch))
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: nv write fail\n", __FUNCTION__, __LINE__);
+       }
+}
+
+void mmi_dial_pad_switch_nv_read(void)
+{
+       uint32_t nv_data_length = sizeof(nv_watch_switch_t);
+       
+       if(nv_data_length != UI_NV_Read_Req(NV_SECTION_UI_DIAL_PAD_SWITCH, 0, nv_data_length, (uint8_t *)&s_dial_pad_switch))
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: nv read fail\n", __FUNCTION__, __LINE__);
+       }
+}
+
+uint8_t mmi_dial_pad_switch_get(void)
+{
+       if(0 == s_dial_pad_switch_init)
+       {
+               s_dial_pad_switch_init = 1;
+               mmi_dial_pad_switch_nv_read();
+       }
+       return (s_dial_pad_switch.switch_flag);
+}
+
+void mmi_dial_pad_switch_set(uint8_t value)
+{
+       if(0 == value || 1 == value)
+       {
+               s_dial_pad_switch.switch_flag = value;
+               mmi_dial_pad_switch_nv_write();
+       }
+}
+#endif
+
 lv_obj_t * dialpad_create(lv_obj_t * activity_obj)
 {
     lv_dialpad_obj_ext_t * ext = NULL;
index b8d625f..6f42ba2 100644 (file)
@@ -38,6 +38,9 @@ typedef struct {
  **********************/
 lv_obj_t * dialpad_create(lv_obj_t * activity_obj);
 void dialpad_create_event_cb(lv_obj_t * btn, lv_event_t e);
+#ifdef __MMI_ZHSX_SUPPORT__
+void mmi_dial_pad_switch_set(uint8_t value);
+#endif
 
 /**********************
  *      MACROS
index a995425..485ed0d 100644 (file)
@@ -101,7 +101,6 @@ typedef struct
 
 
 
-//void wechat_chat_list_set_slide_enable(lv_watch_obj_ext_t * ext, bool enable);
 void mmi_wechat_msg_info_init(void);
 void wechat_msg_info_nv_write(void);
 
index 1011195..a9fd40c 100644 (file)
@@ -679,20 +679,18 @@ void wechat_msg_sending_screen_prepare_destory(lv_obj_t * activity_obj)
        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__);
+               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);
@@ -806,7 +804,6 @@ void wechat_msg_recording_anim(lv_anim_t * a)
                        recording_ext->file_size = 0;
                        Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_5);
                        
-                       //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);
                        lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_WECHAT_RECORDING);
                        if(NULL != activity_obj)
@@ -856,12 +853,6 @@ void wechat_msg_recording_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
                {
                        lv_obj_del(activity_obj);
                }
-               
-               //lv_wechat_ext_t * ext = wechat_actId_ext_get(ACT_ID_WECHAT_MAIN);
-               //if(NULL != ext)
-               //{
-               //      wechat_chat_list_set_slide_enable(&ext->old_ext, false); /*prevent to slide out while recording*/
-               //}
     }
 }
 
@@ -906,7 +897,6 @@ void wechat_msg_recording_cb(MCI_EVNET_T event , MCI_INFO_T info_type, int32_t v
                        {
                                lv_obj_del(activity_obj);
                        }
-                       wechat_chat_list_set_slide_enable(&ext->old_ext, true); /*reset slide_enable at the end of recording*/
                        break;
                        
                case MCI_EVENT_INFO:
@@ -947,8 +937,6 @@ void wechat_msg_recording_screen_create(void)
        
     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));
@@ -1081,6 +1069,8 @@ void wechat_msg_record_button_event_cb(lv_obj_t * obj, lv_event_t e)
                lv_wechat_ext_t * ext = wechat_actId_ext_get(ACT_ID_WECHAT_MAIN);
                if(NULL == ext) 
                        return ;
+
+               wechat_chat_list_set_slide_enable(&ext->old_ext, true); /*reset slide_enable at the end of recording*/
                
         if(0 == ext->old_ext.element_click_en) 
                {
@@ -1104,7 +1094,8 @@ void wechat_msg_record_button_event_cb(lv_obj_t * obj, lv_event_t e)
                }
                else
                {
-                       //wechat_msg_voice_item_playing_stop(ext);
+                       wechat_chat_list_set_slide_enable(&ext->old_ext, false); /*prevent to slide out while recording*/
+
                        wechat_msg_recording_screen_create();
        }
     } 
@@ -1120,6 +1111,8 @@ void wechat_msg_record_button_event_cb(lv_obj_t * obj, lv_event_t e)
                        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) 
                        {
@@ -1349,7 +1342,6 @@ void wechat_chat_list_voice_item_playing_audio_ctrl_callback(AUDIO_CTRL_PRIORITY
                lv_wechat_ext_t * ext = wechat_actId_ext_get(ACT_ID_WECHAT_MAIN);
                if(NULL != ext)
                {
-                       //wechat_chat_list_set_slide_enable(&ext->old_ext, false); /*prevent to slide out while recording*/
                        wechat_msg_voice_item_playing_stop(ext);
                }
     }