目前训练UI还有部分bug,后续更改
authorCaisking <3449750381@qq.com>
Tue, 19 Mar 2024 12:52:08 +0000 (20:52 +0800)
committerCaisking <3449750381@qq.com>
Tue, 19 Mar 2024 12:52:08 +0000 (20:52 +0800)
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp

index 6078f2c..d55dc6c 100644 (file)
@@ -71,6 +71,10 @@ namespace OHOS
         {\r
             NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSTRONG);\r
         }\r
+        if (strcmp(view.GetViewId(), BUTTONNOTE) == 0)\r
+        {\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSTRONG);\r
+        }\r
         return true;\r
     }\r
 }\r
index f469d6d..8d5d8c1 100644 (file)
@@ -68,11 +68,10 @@ namespace OHOS
 
     bool TraingEnddataPresenter::OnClick(UIView &view, const ClickEvent &event)
     {
-
         // 根据控件id查找是哪个控件触发了点击回调
         if (strcmp(view.GetViewId(), BUTTONBACK) == 0)
         {
-            //NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING);
+            NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING);
         }
         return true;
     }
index 169885e..6a3fe24 100644 (file)
@@ -172,16 +172,15 @@ namespace OHOS
     /* DeInit:删除组件 */
     void TraingRecordView::DeInit()
     {
-        UIView *view = static_cast<UIViewGroup *>(container_)->GetChildrenHead();
-        while (view != nullptr)
+        if (label1_ != nullptr)
         {
-            UIView *tempView = view;
-            view = view->GetNextSibling();
-            if (tempView->GetParent())
-            {
-                static_cast<UIViewGroup *>(tempView->GetParent())->Remove(tempView);
-            }
-            delete tempView;
+            delete label1_;
+            label1_ = nullptr;
+        }
+        if (label2_ != nullptr)
+        {
+            delete label2_;
+            label2_ = nullptr;
         }
         delete container_;
         container_ = nullptr;