修复析构不完全的bug
authorCaisking <3449750381@qq.com>
Tue, 2 Apr 2024 10:12:56 +0000 (18:12 +0800)
committerCaisking <3449750381@qq.com>
Tue, 2 Apr 2024 10:12:56 +0000 (18:12 +0800)
13 files changed:
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2View.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnoteView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimeView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinView.cpp

index 76fc845..0579133 100644 (file)
@@ -3,7 +3,7 @@
 \r
 #include "common/image_cache_manager.h"\r
 #include "components/ui_label_ext.h"\r
-#include"language/font/ui_resource_string.h"\r
+#include "language/font/ui_resource_string.h"\r
 #include "UiConfig.h"\r
 #include "ui_resource_image.h"\r
 #include <ui_scroll_view.h>\r
@@ -75,6 +75,7 @@ namespace OHOS
     /* DeInit:删除组件 */\r
     void TraingDataView::DeInit()\r
     {\r
+        container_->RemoveAll();\r
         UIView *view = static_cast<UIViewGroup *>(container_)->GetChildrenHead();\r
         while (view != nullptr)\r
         {\r
index 349859a..ac07665 100644 (file)
@@ -82,7 +82,7 @@ namespace OHOS
         scrollView1_->Add(image5_);
 
         // 初始化button
-        TraingModel::GetInstance()->InitButton(button1_, 42, 1319, 380, 100, BUTTONBACK);
+        TraingModel::GetInstance()->InitButton(button1_, 42, 1319 - 338, 380, 100, BUTTONBACK);
         button1_->SetOnClickListener(static_cast<UIView::OnClickListener *>(TraingEnddataPresenter::GetInstance()));
         scrollView1_->Add(button1_);
 
@@ -110,17 +110,17 @@ namespace OHOS
         label12_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x7f));
         label18_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x7f));
 
-        TraingModel::GetInstance()->InitLabel(label13_, 146, 626- 338, 60, 40, "label18", "226%", DEFAULT_VECTOR_FONT_FILENAME, 40);
+        TraingModel::GetInstance()->InitLabel(label13_, 146, 626 - 338, 60, 40, "label18", "226%", DEFAULT_VECTOR_FONT_FILENAME, 40);
         label13_->SetTextColor(Color::GetColorFromRGBA(0x4f, 0xc3, 0x4c, 0xff));
-        TraingModel::GetInstance()->InitLabel(label14_, 146, 756- 338, 60, 40, "label14", "05:45:46", DEFAULT_VECTOR_FONT_FILENAME, 40);
+        TraingModel::GetInstance()->InitLabel(label14_, 146, 756 - 338, 60, 40, "label14", "05:45:46", DEFAULT_VECTOR_FONT_FILENAME, 40);
         label14_->SetTextColor(Color::GetColorFromRGBA(0xff, 0x8a, 0x36, 0xff));
-        TraingModel::GetInstance()->InitLabel(label15_, 146, 886- 338, 60, 40, "label15", "8,301", DEFAULT_VECTOR_FONT_FILENAME, 40);
+        TraingModel::GetInstance()->InitLabel(label15_, 146, 886 - 338, 60, 40, "label15", "8,301", DEFAULT_VECTOR_FONT_FILENAME, 40);
         label15_->SetTextColor(Color::GetColorFromRGBA(0x36, 0x4a, 0xff, 0xff));
-        TraingModel::GetInstance()->InitLabel(label16_, 146, 1016- 338, 60, 40, "label16", "144", DEFAULT_VECTOR_FONT_FILENAME, 40);
+        TraingModel::GetInstance()->InitLabel(label16_, 146, 1016 - 338, 60, 40, "label16", "144", DEFAULT_VECTOR_FONT_FILENAME, 40);
         label16_->SetTextColor(Color::GetColorFromRGBA(0xff, 0x5a, 0x36, 0xff));
-        TraingModel::GetInstance()->InitLabel(label17_, 146, 1146- 338, 60, 40, "label17", "中等强度", DEFAULT_VECTOR_FONT_FILENAME, 40);
+        TraingModel::GetInstance()->InitLabel(label17_, 146, 1146 - 338, 60, 40, "label17", "中等强度", DEFAULT_VECTOR_FONT_FILENAME, 40);
         label17_->SetTextColor(Color::GetColorFromRGBA(0xff, 0x5a, 0x36, 0xff));
-        TraingModel::GetInstance()->InitLabel(label19_, 201, 1348- 338, 60, 40, "label19", "关闭", DEFAULT_VECTOR_FONT_FILENAME, 31);
+        TraingModel::GetInstance()->InitLabel(label19_, 201, 1348 - 338, 60, 40, "label19", "关闭", DEFAULT_VECTOR_FONT_FILENAME, 31);
 
         scrollView1_->Add(label1_);
         // scrollView1_->Add(label2_);
@@ -147,9 +147,9 @@ namespace OHOS
         {
             image7_ = new UIImageView();
         }
-        image7_->SetPosition(188, 1460); // widget's left position and top position
-        image7_->Resize(100, 100);       // widget's width and height
-        image7_->SetViewId("image7");    // Set style
+        image7_->SetPosition(188, 1460 - 338); // widget's left position and top position
+        image7_->Resize(100, 100);             // widget's width and height
+        image7_->SetViewId("image7");          // Set style
         // Add to rootView
         scrollView1_->Add(image7_);
         image7_->SetVisible(true);
@@ -158,6 +158,7 @@ namespace OHOS
     /* DeInit:删除组件 */
     void TraingEnddataView::DeInit()
     {
+        container_->RemoveAll();
         UIView *view = static_cast<UIViewGroup *>(container_)->GetChildrenHead();
         while (view != nullptr)
         {
index 18e43c7..015872e 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "common/image_cache_manager.h"
 #include "components/ui_label_ext.h"
-#include"language/font/ui_resource_string.h"
+#include "language/font/ui_resource_string.h"
 #include "UiConfig.h"
 #include "ui_resource_image.h"
 #include <ui_scroll_view.h>
@@ -67,6 +67,7 @@ namespace OHOS
     /* DeInit:删除组件 */
     void TraingEndnote2View::DeInit()
     {
+        container_->RemoveAll();
         UIView *view = static_cast<UIViewGroup *>(container_)->GetChildrenHead();
         while (view != nullptr)
         {
index 53675c2..e139db1 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "common/image_cache_manager.h"
 #include "components/ui_label_ext.h"
-#include"language/font/ui_resource_string.h"
+#include "language/font/ui_resource_string.h"
 #include "UiConfig.h"
 #include "ui_resource_image.h"
 #include <ui_scroll_view.h>
@@ -67,6 +67,7 @@ namespace OHOS
     /* DeInit:删除组件 */
     void TraingEndnoteView::DeInit()
     {
+        container_->RemoveAll();
         UIView *view = static_cast<UIViewGroup *>(container_)->GetChildrenHead();
         while (view != nullptr)
         {
index f209447..fb5d1f5 100644 (file)
@@ -3,7 +3,7 @@
 #include <ui_scroll_view.h>
 #include "common/image_cache_manager.h"
 #include "components/ui_label_ext.h"
-#include"language/font/ui_resource_string.h"
+#include "language/font/ui_resource_string.h"
 #include "UiConfig.h"
 #include "ui_resource_image.h"
 #include <ui_scroll_view.h>
@@ -36,6 +36,7 @@ namespace OHOS
     /* DeInit:删除组件 */
     void TraingMusicView::DeInit()
     {
+        container_->RemoveAll();
         // 删除容器
         if (playersView != nullptr)
         {
index 70580c9..3aa1607 100644 (file)
@@ -65,6 +65,7 @@ namespace OHOS
     /* DeInit:删除组件*/
     void TraingNomalView::DeInit()
     {
+        container_->RemoveAll();
         if (sporttitle_ != nullptr)
         {
             delete sporttitle_;
index bc7ea09..072c142 100644 (file)
@@ -3,7 +3,7 @@
 \r
 #include "common/image_cache_manager.h"\r
 #include "components/ui_label_ext.h"\r
-#include"language/font/ui_resource_string.h"\r
+#include "language/font/ui_resource_string.h"\r
 #include "UiConfig.h"\r
 #include "ui_resource_image.h"\r
 #include <ui_scroll_view.h>\r
@@ -125,6 +125,7 @@ namespace OHOS
     /* DeInit:删除组件 */\r
     void TraingSetCaluliView::DeInit()\r
     {\r
+        container_->RemoveAll();\r
         // 删除Label\r
         if (label1_ != nullptr)\r
         {\r
index c378c81..66f6d1e 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "common/image_cache_manager.h"
 #include "components/ui_label_ext.h"
-#include"language/font/ui_resource_string.h"
+#include "language/font/ui_resource_string.h"
 #include "UiConfig.h"
 #include "ui_resource_image.h"
 #include <ui_scroll_view.h>
@@ -126,6 +126,7 @@ namespace OHOS
     /* DeInit:删除组件 */
     void TraingSetDistView::DeInit()
     {
+        container_->RemoveAll();
         // 删除Label
         if (label1_ != nullptr)
         {
index 8e282bb..b7bafcf 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "common/image_cache_manager.h"
 #include "components/ui_label_ext.h"
-#include"language/font/ui_resource_string.h"
+#include "language/font/ui_resource_string.h"
 #include "UiConfig.h"
 #include "ui_resource_image.h"
 #include <ui_scroll_view.h>
@@ -125,6 +125,7 @@ namespace OHOS
     /* DeInit:删除组件 */
     void TraingSetSeptView::DeInit()
     {
+        container_->RemoveAll();
         // 删除Label
         if (label1_ != nullptr)
         {
index ff770a7..1352893 100644 (file)
@@ -3,7 +3,7 @@
 \r
 #include "common/image_cache_manager.h"\r
 #include "components/ui_label_ext.h"\r
-#include"language/font/ui_resource_string.h"\r
+#include "language/font/ui_resource_string.h"\r
 #include "UiConfig.h"\r
 #include "ui_resource_image.h"\r
 #include <ui_scroll_view.h>\r
@@ -125,6 +125,7 @@ namespace OHOS
     /* DeInit:删除组件 */\r
     void TraingSetTimeView::DeInit()\r
     {\r
+        container_->RemoveAll();\r
         // 删除Label\r
         if (label1_ != nullptr)\r
         {\r
index 6d22528..e4b2ef0 100644 (file)
@@ -3,7 +3,7 @@
 \r
 #include "common/image_cache_manager.h"\r
 #include "components/ui_label_ext.h"\r
-#include"language/font/ui_resource_string.h"\r
+#include "language/font/ui_resource_string.h"\r
 #include "UiConfig.h"\r
 #include "ui_resource_image.h"\r
 #include <ui_scroll_view.h>\r
@@ -77,6 +77,7 @@ namespace OHOS
     /* DeInit:删除组件 */\r
     void TraingSetView::DeInit()\r
     {\r
+        container_->RemoveAll();\r
         // 删除Label\r
         if (label1_ != nullptr)\r
         {\r
index 5f5a3f4..6b3343e 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "common/image_cache_manager.h"
 #include "components/ui_label_ext.h"
-#include"language/font/ui_resource_string.h"
+#include "language/font/ui_resource_string.h"
 #include "UiConfig.h"
 #include "ui_resource_image.h"
 #include <ui_scroll_view.h>
@@ -14,7 +14,6 @@
 namespace OHOS
 {
 
-
     static TraingStrongView *g_pTraingStrongView{nullptr};
 
     TraingStrongView::TraingStrongView()
@@ -33,7 +32,7 @@ namespace OHOS
 
         return g_pTraingStrongView;
     }
-   
+
     /* InitView:初始化界面*/
     void TraingStrongView ::InitView()
     {
@@ -101,6 +100,7 @@ namespace OHOS
     /* DeInit:删除组件 */
     void TraingStrongView::DeInit()
     {
+        container_->RemoveAll();
         UIView *view = static_cast<UIViewGroup *>(container_)->GetChildrenHead();
         while (view != nullptr)
         {
index d64c54b..bbe4e31 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "common/image_cache_manager.h"
 #include "components/ui_label_ext.h"
-#include"language/font/ui_resource_string.h"
+#include "language/font/ui_resource_string.h"
 #include "UiConfig.h"
 #include "ui_resource_image.h"
 #include <ui_scroll_view.h>
@@ -156,6 +156,7 @@ namespace OHOS
     /* DeInit:删除组件*/
     void TraingWinView::DeInit()
     {
+        container_->RemoveAll();
         UIView *view = static_cast<UIViewGroup *>(container_)->GetChildrenHead();
         while (view != nullptr)
         {