From 25dc62ce0fcf45f440d3661bc06558f891cfb190 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 14 Jan 2026 15:46:13 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3GPS=E8=AE=BE=E5=AE=9A=E7=9B=AE?= =?utf8?q?=E6=A0=87=E9=A1=B5=E9=9D=A2=E6=81=AF=E5=B1=8F=E5=90=8E=E6=8C=89?= =?utf8?q?=E9=94=AE=E7=9B=91=E5=90=AC=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/traing/include/TraingSetPresenter.h | 2 -- .../nativeui/traing/src/TraingSetPresenter.cpp | 15 +-------------- .../nativeui/traing/src/TraingSetView.cpp | 13 ++----------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/include/TraingSetPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/include/TraingSetPresenter.h index 7df8f9145..15e4ca4fc 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/include/TraingSetPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/include/TraingSetPresenter.h @@ -40,9 +40,7 @@ namespace OHOS virtual ~TraingSetPresenter(); void OnStart() override; - void OnPause() override; void OnResume() override; - void OnStop() override; static TraingSetPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingSetPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingSetPresenter.cpp index 80c61ecf4..a4501004e 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingSetPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingSetPresenter.cpp @@ -56,22 +56,9 @@ namespace OHOS Presenter::OnStart(); } - void TraingSetPresenter::OnPause(void) - { - - Presenter::OnPause(); - } - void TraingSetPresenter::OnResume(void) { - - Presenter::OnResume(); - } - - void TraingSetPresenter::OnStop(void) - { - - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); } void TraingSetPresenter::NavigateBack() { diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingSetView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingSetView.cpp index 0b6b4a162..1628ba2a3 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingSetView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingSetView.cpp @@ -406,14 +406,7 @@ namespace OHOS group->SetScrollBlankSize(50); group->SetReboundSize(100); group->SetDirection(1); - - // 创建 draglistener 实例并设置为拖动监听器 - UIView::OnDragListener *draglistener = static_cast(TraingSetPresenter::GetInstance()); - if (draglistener == nullptr) - { - return; - } - group->SetOnDragListener(draglistener); + group->SetOnDragListener(presenter_); group->SetTouchable(true); group->SetDraggable(true); @@ -425,13 +418,11 @@ namespace OHOS } SetKeyActListener(); - // GetRootContainer()->Add(SetTagScrollView[SET_VIEW]); - // SetCurrentViewId(SET_VIEW); // 设置当前页面ID if (group != nullptr) { SetTagScrollView[SET_VIEW] = group; - GetRootContainer()->Add(SetTagScrollView[SET_VIEW]); + AddViewToRootContainer(SetTagScrollView[SET_VIEW]); SetCurrentViewId(SET_VIEW); } } -- 2.17.1