其他类运动列表显示
authorCaisking <Casiking@zhihuishixun.com>
Tue, 22 Jul 2025 06:56:01 +0000 (14:56 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Tue, 22 Jul 2025 06:56:01 +0000 (14:56 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/include/TraingOtherPresenter.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/include/TraingOtherView.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/src/TraingOtherPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/src/TraingOtherView.cpp

index 5e301bd..fdedb9b 100644 (file)
@@ -27,8 +27,6 @@ namespace OHOS
         virtual ~TraingOtherPresenter();
 
         void OnStart() override;
-        void OnPause() override;
-        void OnResume() override;
         void OnStop() override;
 
         static TraingOtherPresenter *GetInstance();
index d9b0d42..8562f2d 100644 (file)
@@ -66,26 +66,14 @@ namespace OHOS
     void TraingOtherPresenter::OnStart()
     {
         p_TraingOtherModel->InitTraingOtherListItem();
-        Presenter<TraingOtherView>::OnStart();
-    }
-
-    void TraingOtherPresenter::OnPause(void)
-    {
-        Presenter<TraingOtherView>::OnPause();
-    }
-
-    void TraingOtherPresenter::OnResume(void)
-    {
         if (view_ == nullptr)
         {
             return;
         }
+
         const TraingOtherItem *itemInfo = p_TraingOtherModel->GetTraingOtherlistItems();
-        for (int i = 0; i < p_TraingOtherModel->GetTraingOtherListNum(); i++)
-        {
-            view_->AddToTraingOtherList(itemInfo[i]);
-        }
-        Presenter<TraingOtherView>::OnResume();
+   
+        view_->RefreshTraingOtherList(itemInfo);
     }
 
     void TraingOtherPresenter::OnStop(void)
index abaf5af..7529799 100644 (file)
@@ -117,5 +117,14 @@ void TraingOtherView::OnStart() {
   }
 }
 
-
+void TraingOtherView::RefreshTraingOtherList(const TraingOtherItem *itemInfo) {
+  for (uint8_t i = 0; i < TraingOtherModel::GetInstance().GetTraingOtherListNum();
+       i++) {
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
+                  "SettingPresenter::OnStart itemInfo[i].itemName:%d", i);
+    AddToTraingOtherList(itemInfo[i]);
+  }
+  TraingOtherList->SetAdapter(p_TraingOtherListAdapter);
+  TraingOtherList->RefreshList();
+}
 } // namespace OHOS
\ No newline at end of file