Browse Source

在功耗显示界面来回切换输入/输入和输出时,多次创建了背景和数据,导致会多出混乱的应用界面
现在在切换时,先保存父背景,然后删除本次应用的数据和背景,然后再根据父背景重新生成新的背景和数据来覆盖

robbin 4 days ago
parent
commit
43df282807

+ 21 - 21
application/aem_watch/src/application/in_out_power/aem_widget_in_out_power.c

@@ -33,29 +33,38 @@ static void timer_cb(lv_timer_t *t)
     if (s_wf_in_out_power->bg == NULL)
         return;
 
-    if (in_out_value_show_flag != aem_in_out_value_show())
+    lv_obj_t *par = lv_obj_get_parent(s_wf_in_out_power->bg);
+    if (par == NULL)
+        return;
+        
+    bool b_temp_flag = aem_in_out_value_show();
+
+    if (in_out_value_show_flag != b_temp_flag)
     {
         lv_timer_pause(s_wf_in_out_power->timer);
 
-        //os_printk("[timer_cb] in_out_value_show_flag:%d\n", in_out_value_show_flag);
+        in_out_value_show_flag = b_temp_flag;
 
-        if (s_wf_in_out_power->bg)
+        uint8_t *ext_data = lv_obj_get_user_data(s_wf_in_out_power->bg);
+        if (ext_data)
         {
-            aem_in_out_power_screen_del(s_wf_in_out_power->bg);
-            aem_input_power_screen_del(s_wf_in_out_power->bg);
-
-            //lv_obj_del(s_wf_in_out_power->bg);
-            //s_wf_in_out_power->bg = NULL;
+            lv_mem_free(ext_data);
+            ext_data = NULL;
+            lv_obj_set_user_data(s_wf_in_out_power->bg, NULL);
         }
-        in_out_value_show_flag = aem_in_out_value_show();
-
+        
+        //os_printk("widget in out power [timer_cb] in_out_value_show_flag:%d\n", in_out_value_show_flag);
+        
+        lv_obj_del(s_wf_in_out_power->bg);
+        s_wf_in_out_power->bg = NULL;
+        
         if (in_out_value_show_flag)
         {
-            s_wf_in_out_power->bg = aem_in_out_power_screen_create(s_wf_in_out_power->bg, true);
+            s_wf_in_out_power->bg = aem_in_out_power_screen_create(par, true);
         }
         else
         {
-            s_wf_in_out_power->bg = aem_input_power_screen_create(s_wf_in_out_power->bg, true);
+            s_wf_in_out_power->bg = aem_input_power_screen_create(par, true);
         }
 
         lv_timer_resume(s_wf_in_out_power->timer);
@@ -73,15 +82,6 @@ static void timer_cb(lv_timer_t *t)
     }
 }
 
-static int32_t keypad_evt_handler(aem_key_evt_info_t *evt_info)
-{
-    return 0;
-}
-
-static const aem_sys_evt_ops_t ops = {
-    .key_evt_func = keypad_evt_handler,
-};
-
 static lv_obj_t *on_start(lv_obj_t *par)
 {
     if (s_wf_in_out_power == NULL)

+ 1 - 1
application/aem_watch/src/user_cfg/device_info_cfg.h

@@ -5,7 +5,7 @@
 #define __DEVICE_INFO_CONFIG_H__
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 0
-#define MICRO_VERSION 6
+#define MICRO_VERSION 7
 #define DEVICE_ID "CJ01"//3085
 #define DEVICE_NAME "Catsights"//"3085S WATCH"
 #define DEVICE_NAME_UI "Catsights"//"3085S WATCH"

+ 1 - 1
thirdparty/lib/aem/config/aem_project.h

@@ -4,7 +4,7 @@
 #pragma warning(error : 4013)
 #endif
 #define AEM_VERSION "BL_Develop_NOR"
-#define BUILD_TIME "202503182115"
+#define BUILD_TIME "202503281835"
 #define AEM_GUI_FWK_LIB_VER "2.0.0.0"
 #define APP_DOWNLOAD_URL "https://customer.com"
 #define AEM_APP_TRANS_ANIMATION 1