From: luozheng <1732036298@qq.com> Date: Mon, 12 Jan 2026 07:48:33 +0000 (+0800) Subject: 解决运动界面中:更多运动息屏按键监听和表冠聚焦失效问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=5e81cc5190e509b15ede7f660c62307fec65d51a;p=mirrors%2FFD230.git 解决运动界面中:更多运动息屏按键监听和表冠聚焦失效问题 --- diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/include/TraingAquaticPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/include/TraingAquaticPresenter.h index ef0d88826..e3b7a3a1c 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/include/TraingAquaticPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/include/TraingAquaticPresenter.h @@ -34,7 +34,7 @@ namespace OHOS virtual ~TraingAquaticPresenter(); void OnStart() override; - void OnStop() override; + void OnResume() override; static TraingAquaticPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/include/TraingAquaticView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/include/TraingAquaticView.h index 477ddeea4..eab0efaa1 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/include/TraingAquaticView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/include/TraingAquaticView.h @@ -36,7 +36,7 @@ namespace OHOS void OnStart() override; - UIList *GetList(); + UIList *GetAquaticList(); void AddToTraingAquaticList(const TraingAquaticItem &item); void RefreshTraingAquaticList(const TraingAquaticItem *itemInfo); private: diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/src/TraingAquaticPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/src/TraingAquaticPresenter.cpp index f5c9a1116..1c506e1da 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/src/TraingAquaticPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/src/TraingAquaticPresenter.cpp @@ -61,10 +61,13 @@ namespace OHOS view_->RefreshTraingAquaticList(itemInfo); } - void TraingAquaticPresenter::OnStop(void) + void TraingAquaticPresenter::OnResume(void) { - - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); + if (TraingAquaticView::GetInstance()->GetAquaticList() != nullptr) + { + TraingAquaticView::GetInstance()->GetAquaticList()->RequestFocus(); + } } bool TraingAquaticPresenter::OnDrag(UIView &view, const DragEvent &event) { diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/src/TraingAquaticView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/src/TraingAquaticView.cpp index 45535d43c..59bf4f8af 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/src/TraingAquaticView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_aquatic/src/TraingAquaticView.cpp @@ -128,4 +128,7 @@ void TraingAquaticView::RefreshTraingAquaticList(const TraingAquaticItem *itemIn TraingAquaticList->RefreshList(); } +UIList *TraingAquaticView::GetAquaticList() { + return TraingAquaticList; +} } // namespace OHOS \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/include/TraingBallPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/include/TraingBallPresenter.h index 7f2087519..2b05619f4 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/include/TraingBallPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/include/TraingBallPresenter.h @@ -34,7 +34,7 @@ namespace OHOS virtual ~TraingBallPresenter(); void OnStart() override; - void OnStop() override; + void OnResume() override; static TraingBallPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/include/TraingBallView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/include/TraingBallView.h index ab2a3a593..afa921a73 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/include/TraingBallView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/include/TraingBallView.h @@ -36,7 +36,7 @@ public: void OnStart() override; - UIList *GetList(); + UIList *GetBallList(); void AddToTraingBallList(const TraingBallItem &item); void RefreshTraingBallList(const TraingBallItem *itemInfo); private: diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/src/TraingBallPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/src/TraingBallPresenter.cpp index 969afad6d..879f1d0c0 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/src/TraingBallPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/src/TraingBallPresenter.cpp @@ -61,10 +61,13 @@ namespace OHOS view_->RefreshTraingBallList(itemInfo); } - void TraingBallPresenter::OnStop(void) + void TraingBallPresenter::OnResume(void) { - - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); + if (TraingBallView::GetInstance()->GetBallList() != nullptr) + { + TraingBallView::GetInstance()->GetBallList()->RequestFocus(); + } } bool TraingBallPresenter::OnDrag(UIView &view, const DragEvent &event) { diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/src/TraingBallView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/src/TraingBallView.cpp index a1972b822..e9db10c7d 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/src/TraingBallView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ball/src/TraingBallView.cpp @@ -126,4 +126,9 @@ void TraingBallView::RefreshTraingBallList(const TraingBallItem *itemInfo) { TraingBallList->RefreshList(); } +UIList *TraingBallView::GetBallList() { + return TraingBallList; +} + + } // namespace OHOS \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/include/TraingDancePresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/include/TraingDancePresenter.h index 49b8bf94b..1798e85a0 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/include/TraingDancePresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/include/TraingDancePresenter.h @@ -28,7 +28,7 @@ namespace OHOS virtual ~TraingDancePresenter(); void OnStart() override; - void OnStop() override; + void OnResume() override; static TraingDancePresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/include/TraingDanceView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/include/TraingDanceView.h index 4247eb110..1852d3b62 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/include/TraingDanceView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/include/TraingDanceView.h @@ -26,7 +26,7 @@ public: void OnStart() override; - UIList *GetList(); + UIList *GetDanceList(); void AddToTraingDanceList(const TraingDanceItem &item); void RefreshTraingDanceList(const TraingDanceItem *itemInfo); private: diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/src/TraingDancePresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/src/TraingDancePresenter.cpp index 50459e9cd..b53d43ba6 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/src/TraingDancePresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/src/TraingDancePresenter.cpp @@ -60,10 +60,13 @@ namespace OHOS view_->RefreshTraingDanceList(itemInfo); } - void TraingDancePresenter::OnStop(void) + void TraingDancePresenter::OnResume(void) { - - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); + if (TraingDanceView::GetInstance()->GetDanceList() != nullptr) + { + TraingDanceView::GetInstance()->GetDanceList()->RequestFocus(); + } } bool TraingDancePresenter::OnDrag(UIView &view, const DragEvent &event) { diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/src/TraingDanceView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/src/TraingDanceView.cpp index 286125c52..6464b9719 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/src/TraingDanceView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_dance/src/TraingDanceView.cpp @@ -126,4 +126,8 @@ void TraingDanceView::RefreshTraingDanceList(const TraingDanceItem *itemInfo) { TraingDanceList->SetAdapter(p_TraingDanceListAdapter); TraingDanceList->RefreshList(); } + +UIList *TraingDanceView::GetDanceList() { + return TraingDanceList; +} } // namespace OHOS \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/include/TraingFitnessPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/include/TraingFitnessPresenter.h index 8e3518af5..92ccbceae 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/include/TraingFitnessPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/include/TraingFitnessPresenter.h @@ -22,7 +22,7 @@ namespace OHOS virtual ~TraingFitnessPresenter(); void OnStart() override; - void OnStop() override; + void OnResume() override; static TraingFitnessPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/include/TraingFitnessView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/include/TraingFitnessView.h index 020dd545b..f62533a6a 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/include/TraingFitnessView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/include/TraingFitnessView.h @@ -28,7 +28,7 @@ public: void OnStart() override; - UIList *GetList(); + UIList *GetFitnessList(); UIScrollView *GetScrollView(); void AddToTraingFitnessList(const TraingFitnessItem &item); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/src/TraingFitnessPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/src/TraingFitnessPresenter.cpp index 3f17e8c91..d7bb3e7ae 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/src/TraingFitnessPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/src/TraingFitnessPresenter.cpp @@ -58,10 +58,13 @@ namespace OHOS view_->RefreshTraingFitnessList(itemInfo); } - void TraingFitnessPresenter::OnStop(void) + void TraingFitnessPresenter::OnResume(void) { - - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); + if (TraingFitnessView::GetInstance()->GetFitnessList() != nullptr) + { + TraingFitnessView::GetInstance()->GetFitnessList()->RequestFocus(); + } } bool TraingFitnessPresenter::OnDrag(UIView &view, const DragEvent &event) { diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/src/TraingFitnessView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/src/TraingFitnessView.cpp index ba7bac8ed..27680556b 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/src/TraingFitnessView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_fitness/src/TraingFitnessView.cpp @@ -128,4 +128,9 @@ void TraingFitnessView::RefreshTraingFitnessList(const TraingFitnessItem *itemIn TraingFitnessList->SetAdapter(p_TraingFitnessListAdapter); TraingFitnessList->RefreshList(); } + +UIList *TraingFitnessView::GetFitnessList() { + return TraingFitnessList; +} + } // namespace OHOS \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/include/TraingIcePresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/include/TraingIcePresenter.h index 8e9c71a25..843988b50 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/include/TraingIcePresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/include/TraingIcePresenter.h @@ -28,7 +28,7 @@ namespace OHOS virtual ~TraingIcePresenter(); void OnStart() override; - void OnStop() override; + void OnResume() override; static TraingIcePresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/include/TraingIceView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/include/TraingIceView.h index cc099864d..d345e18ff 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/include/TraingIceView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/include/TraingIceView.h @@ -26,7 +26,7 @@ public: void OnStart() override; - UIList *GetList(); + UIList *GetIceList(); void AddToTraingIceList(const TraingIceItem &item); void RefreshTraingIceList(const TraingIceItem *itemInfo); private: diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/src/TraingIcePresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/src/TraingIcePresenter.cpp index 470fa5b9c..b7ff8443a 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/src/TraingIcePresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/src/TraingIcePresenter.cpp @@ -60,10 +60,13 @@ namespace OHOS view_->RefreshTraingIceList(itemInfo); } - void TraingIcePresenter::OnStop(void) + void TraingIcePresenter::OnResume(void) { - - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); + if (TraingIceView::GetInstance()->GetIceList() != nullptr) + { + TraingIceView::GetInstance()->GetIceList()->RequestFocus(); + } } bool TraingIcePresenter::OnDrag(UIView &view, const DragEvent &event) { diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/src/TraingIceView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/src/TraingIceView.cpp index c07e23c27..e91e0aaad 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/src/TraingIceView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_ice/src/TraingIceView.cpp @@ -129,4 +129,8 @@ void TraingIceView::RefreshTraingIceList(const TraingIceItem *itemInfo) { TraingIceList->RefreshList(); } +UIList *TraingIceView::GetIceList() { + return TraingIceList; +} + } // namespace OHOS \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/include/TraingMorePresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/include/TraingMorePresenter.h index 1dac05709..89f9ed462 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/include/TraingMorePresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/include/TraingMorePresenter.h @@ -34,7 +34,7 @@ namespace OHOS virtual ~TraingMorePresenter(); void OnStart() override; - void OnStop() override; + void OnResume() override; void NavigateBack(); static TraingMorePresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/include/TraingMoreView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/include/TraingMoreView.h index 69aea522d..732d148b3 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/include/TraingMoreView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/include/TraingMoreView.h @@ -26,7 +26,7 @@ public: void OnStart() override; - UIList *GetList(); + UIList *GetMoreList(); void AddToTraingMoreList(const TraingMoreItem &item); void RefreshTraingMoreList(const TraingMoreItem *itemInfo); private: diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp index 903555d42..a35a02bf5 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp @@ -62,9 +62,13 @@ namespace OHOS view_->RefreshTraingMoreList(itemInfo); } - void TraingMorePresenter::OnStop(void) + void TraingMorePresenter::OnResume(void) { - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); + if (TraingMoreView::GetInstance()->GetMoreList() != nullptr) + { + TraingMoreView::GetInstance()->GetMoreList()->RequestFocus(); + } } void TraingMorePresenter::NavigateBack() diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/src/TraingMoreView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/src/TraingMoreView.cpp index de8c34b29..984300d3a 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/src/TraingMoreView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_more/src/TraingMoreView.cpp @@ -122,4 +122,8 @@ void TraingMoreView::RefreshTraingMoreList(const TraingMoreItem *itemInfo) { TraingMoreList->RefreshList(); } +UIList *TraingMoreView::GetMoreList() { + return TraingMoreList; +} + } // namespace OHOS \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/include/TraingOtherPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/include/TraingOtherPresenter.h index 271bb7bd8..500dfaf3d 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/include/TraingOtherPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/include/TraingOtherPresenter.h @@ -28,7 +28,7 @@ namespace OHOS virtual ~TraingOtherPresenter(); void OnStart() override; - void OnStop() override; + void OnResume() override; static TraingOtherPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/include/TraingOtherView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/include/TraingOtherView.h index 08c058162..e2b5c112c 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/include/TraingOtherView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/include/TraingOtherView.h @@ -37,7 +37,7 @@ public: - UIList *GetList(); + UIList *GetOtherList(); void AddToTraingOtherList(const TraingOtherItem &item); void RefreshTraingOtherList(const TraingOtherItem *itemInfo); private: diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/src/TraingOtherPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/src/TraingOtherPresenter.cpp index 337c59d39..9335eb5e2 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/src/TraingOtherPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/src/TraingOtherPresenter.cpp @@ -76,10 +76,13 @@ namespace OHOS view_->RefreshTraingOtherList(itemInfo); } - void TraingOtherPresenter::OnStop(void) + void TraingOtherPresenter::OnResume(void) { - - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); + if (TraingOtherView::GetInstance()->GetOtherList() != nullptr) + { + TraingOtherView::GetInstance()->GetOtherList()->RequestFocus(); + } } bool TraingOtherPresenter::OnDrag(UIView &view, const DragEvent &event) { diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/src/TraingOtherView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/src/TraingOtherView.cpp index 7529799e5..bc2da45b1 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/src/TraingOtherView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_other/src/TraingOtherView.cpp @@ -127,4 +127,7 @@ void TraingOtherView::RefreshTraingOtherList(const TraingOtherItem *itemInfo) { TraingOtherList->SetAdapter(p_TraingOtherListAdapter); TraingOtherList->RefreshList(); } +UIList *TraingOtherView::GetOtherList() { + return TraingOtherList; +} } // namespace OHOS \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/include/TraingRestPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/include/TraingRestPresenter.h index 6b7c95772..13644f7b3 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/include/TraingRestPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/include/TraingRestPresenter.h @@ -28,7 +28,7 @@ namespace OHOS virtual ~TraingRestPresenter(); void OnStart() override; - void OnStop() override; + void OnResume() override; static TraingRestPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/include/TraingRestView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/include/TraingRestView.h index 89ac6a6e0..f5fe18242 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/include/TraingRestView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/include/TraingRestView.h @@ -36,7 +36,7 @@ public: void OnStart() override; - UIList *GetList(); + UIList *GetRestList(); void AddToTraingRestList(const TraingRestItem &item); void RefreshTraingRestList(const TraingRestItem *itemInfo); private: diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/src/TraingRestPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/src/TraingRestPresenter.cpp index d099db459..8105b56f4 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/src/TraingRestPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/src/TraingRestPresenter.cpp @@ -61,10 +61,13 @@ namespace OHOS - void TraingRestPresenter::OnStop(void) + void TraingRestPresenter::OnResume(void) { - - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); + if (TraingRestView::GetInstance()->GetRestList() != nullptr) + { + TraingRestView::GetInstance()->GetRestList()->RequestFocus(); + } } bool TraingRestPresenter::OnDrag(UIView &view, const DragEvent &event) { diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/src/TraingRestView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/src/TraingRestView.cpp index bd3922bb8..9264463ae 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/src/TraingRestView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_list_rest/src/TraingRestView.cpp @@ -126,4 +126,7 @@ void TraingRestView::RefreshTraingRestList(const TraingRestItem *itemInfo) { TraingRestList->SetAdapter(p_TraingRestListAdapter); TraingRestList->RefreshList(); } +UIList *TraingRestView::GetRestList() { + return TraingRestList; +} } // namespace OHOS \ No newline at end of file