From 268b26f719e388561e1702ffb07f7a30a1007f43 Mon Sep 17 00:00:00 2001 From: Caisking Date: Tue, 22 Jul 2025 14:56:01 +0800 Subject: [PATCH] =?utf8?q?=E5=85=B6=E4=BB=96=E7=B1=BB=E8=BF=90=E5=8A=A8?= =?utf8?q?=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../include/TraingOtherPresenter.h | 2 -- .../include/TraingOtherView.h | 2 +- .../src/TraingOtherPresenter.cpp | 18 +++--------------- .../src/TraingOtherView.cpp | 11 ++++++++++- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/include/TraingOtherPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/include/TraingOtherPresenter.h index 5e301bdc2..fdedb9b68 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/include/TraingOtherPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/include/TraingOtherPresenter.h @@ -27,8 +27,6 @@ namespace OHOS virtual ~TraingOtherPresenter(); void OnStart() override; - void OnPause() override; - void OnResume() override; void OnStop() override; static TraingOtherPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/include/TraingOtherView.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/include/TraingOtherView.h index 9ca24f660..08c058162 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/include/TraingOtherView.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/include/TraingOtherView.h @@ -39,7 +39,7 @@ public: UIList *GetList(); void AddToTraingOtherList(const TraingOtherItem &item); - + void RefreshTraingOtherList(const TraingOtherItem *itemInfo); private: void InitView(void); void DeInitView(void); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/src/TraingOtherPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/src/TraingOtherPresenter.cpp index d9b0d42fb..8562f2d24 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/src/TraingOtherPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/src/TraingOtherPresenter.cpp @@ -66,26 +66,14 @@ namespace OHOS void TraingOtherPresenter::OnStart() { p_TraingOtherModel->InitTraingOtherListItem(); - Presenter::OnStart(); - } - - void TraingOtherPresenter::OnPause(void) - { - Presenter::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::OnResume(); + + view_->RefreshTraingOtherList(itemInfo); } void TraingOtherPresenter::OnStop(void) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/src/TraingOtherView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/src/TraingOtherView.cpp index abaf5afd3..7529799e5 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/src/TraingOtherView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_list_other/src/TraingOtherView.cpp @@ -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 -- 2.17.1