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)
}
}
-
+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