关闭主界面不必要的打印
authorCaisking <Casiking@zhihuishixun.com>
Fri, 29 Aug 2025 03:43:04 +0000 (11:43 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Fri, 29 Aug 2025 03:43:04 +0000 (11:43 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainViewSample.cpp

index 138d5f5..3d79a04 100644 (file)
@@ -582,7 +582,7 @@ namespace OHOS
         }\r
         else\r
         {\r
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Error: Second value is empty. Initializing to default settings.\r\n");\r
+            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Error: Second value is empty. Initializing to default settings.\r\n");\r
         #if defined(BOARD_W9)\r
             InitDialSettingDefault(DIAL_CLOCK);//W9使用默认静态表盘\r
         #else\r
index edab4f5..5673c08 100644 (file)
@@ -160,18 +160,18 @@ namespace OHOS
             delete setmainView;
             setmainView = nullptr;
         }
-        // if (sleepView != nullptr)
-        // {
-        //     sleepView->RemoveAll();
-        //     delete sleepView;
-        //     sleepView = nullptr;
-        // }
-        // if (traingView != nullptr)
-        // {
-        //     traingView->RemoveAll();
-        //     delete traingView;
-        //     traingView = nullptr;
-        // }
+        if (sleepView != nullptr)
+        {
+            sleepView->RemoveAll();
+            delete sleepView;
+            sleepView = nullptr;
+        }
+        if (traingView != nullptr)
+        {
+            traingView->RemoveAll();
+            delete traingView;
+            traingView = nullptr;
+        }
         if (weatherControlView != nullptr)
         {
             delete weatherControlView;
@@ -183,11 +183,6 @@ namespace OHOS
             delete GoalControlView;
             GoalControlView = nullptr;
         }
-        // if (applistCardView != nullptr)
-        // {
-        //     delete applistCardView;
-        //     applistCardView = nullptr;
-        // }
         if (mainSwipeGroup != nullptr)
         {
             delete mainSwipeGroup;
@@ -227,7 +222,7 @@ namespace OHOS
 
     void MainViewSample::OnStart()
     {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainViewSample::OnStart");
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample::OnStart");
 
         if (mainSwipeGroup == nullptr) {
             mainSwipeGroup = new UICrossView();
@@ -352,14 +347,14 @@ namespace OHOS
             {
                 if (cardSettings[i] == CardMapper[j].id)
                 {
-                    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,  "MainViewSample:: recordCard[%d]", j);
+                    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,  "MainViewSample:: recordCard[%d]", j);
                     recordCard[j] = (this->*(CardMapper[j].func))();
                     if (recordCard[j] == nullptr)
                     {
                         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainViewSample:: recordCard %d error", j);
                         return false;
                     }
-                    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+                    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
                                   "MainViewSample:: recordCard[%d]:%p", j, recordCard[j]);
                     break;
                 }
@@ -383,7 +378,7 @@ namespace OHOS
             if (recordCard[cardId] != nullptr)
             {
                 mainSwipeGroup->HorAdd(recordCard[cardId]);
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainViewSample:: HorViewLoad cardid = %d ViewIndex = %d",
+                WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample:: HorViewLoad cardid = %d ViewIndex = %d",
                               cardId, recordCard[cardId]->GetViewIndex());
             }
             else
@@ -397,8 +392,7 @@ namespace OHOS
 
     void MainViewSample::VerticalViewInit(void)
     {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample::VerticalViewInit");
-#ifdef FD230
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample::VerticalViewInit")
         if (dropDownView == nullptr) {
             dropDownView = new PullUpDownView();
             if (dropDownView == nullptr)
@@ -426,8 +420,6 @@ namespace OHOS
         messageView->PreLoad();
         messageView->SetDraggable(false);
         // messageView->SetIntercept(true);
-        messageView->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT);
-#endif
     }
 
     PullUpDownView *MainViewSample::GetPullUpView()