From: luozheng <1732036298@qq.com> Date: Fri, 16 Jan 2026 03:27:31 +0000 (+0800) Subject: 解决睡眠slice息屏按键失效问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=c9cc2f22b26eee7d68056d3eebfbf299a80375ed;p=mirrors%2FFD230.git 解决睡眠slice息屏按键失效问题 --- diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/src/CalculatorPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/src/CalculatorPresenter.cpp index 927425e6b..67fda82e1 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/src/CalculatorPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/src/CalculatorPresenter.cpp @@ -14,8 +14,8 @@ #include "uicomponents/UIComponents.h" namespace OHOS { - REGIST_MENU_PRO( VIEW_CALCULATOR, CalculatorView, CalculatorPresenter, - PNG_APPLIST_INFORMATION_IMAGE_BIG, PNG_APPLIST_INFORMATION_IMAGE, PNG_APPLIST_INFORMATION_IMAGE, "计算器", STR_CALCULATOR); +// REGIST_MENU_PRO( VIEW_CALCULATOR, CalculatorView, CalculatorPresenter, +// PNG_APPLIST_INFORMATION_IMAGE_BIG, PNG_APPLIST_INFORMATION_IMAGE, PNG_APPLIST_INFORMATION_IMAGE, "计算器", STR_CALCULATOR); static CalculatorPresenter *g_pMainView = nullptr; CalculatorPresenter::CalculatorPresenter() diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/include/SleepControlPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/include/SleepControlPresenter.h index 998b9746f..4d4cad25b 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/include/SleepControlPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/include/SleepControlPresenter.h @@ -36,9 +36,7 @@ namespace OHOS virtual ~SleepControlPresenter(); void OnStart() override; - void OnPause() override; void OnResume() override; - void OnStop() override; static SleepControlPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepControlPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepControlPresenter.cpp index 724a4a22d..35ff5274c 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepControlPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepControlPresenter.cpp @@ -50,22 +50,11 @@ namespace OHOS void SleepControlPresenter::OnStart() { - Presenter::OnStart(); - } - - void SleepControlPresenter::OnPause(void) - { - Presenter::OnPause(); } void SleepControlPresenter::OnResume(void) { - Presenter::OnResume(); - } - - void SleepControlPresenter::OnStop(void) - { - Presenter::OnStop(); + RootView::GetInstance()->SetOnKeyActListener(this); } bool SleepControlPresenter::OnDrag(UIView &view, const DragEvent &event) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepControlView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepControlView.cpp index c4f93a972..edc2a79d3 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepControlView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepControlView.cpp @@ -102,10 +102,7 @@ namespace OHOS { SleepModel::GetInstance().msg_save_sleep_data(); - GetRootContainer()->SetTouchable(true); - GetRootContainer()->SetDraggable(true); AddViewToRootContainer(GetSleepControlPageView()); - // GetRootContainer()->Add(GetSleepControlPageView()); if (SleepSwipeViewList == nullptr) {