From: Caisking Date: Tue, 22 Jul 2025 06:56:01 +0000 (+0800) Subject: 其他类运动列表显示 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~210^2~9 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=268b26f719e388561e1702ffb07f7a30a1007f43;p=mirrors%2FFD230.git 其他类运动列表显示 --- 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