解决睡眠slice息屏按键失效问题
authorluozheng <1732036298@qq.com>
Fri, 16 Jan 2026 03:27:31 +0000 (11:27 +0800)
committerluozheng <1732036298@qq.com>
Fri, 16 Jan 2026 03:27:31 +0000 (11:27 +0800)
code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/src/CalculatorPresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/include/SleepControlPresenter.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepControlPresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepControlView.cpp

index 927425e..67fda82 100644 (file)
@@ -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()
index 998b974..4d4cad2 100644 (file)
@@ -36,9 +36,7 @@ namespace OHOS
         virtual ~SleepControlPresenter();
 
         void OnStart() override;
-        void OnPause() override;
         void OnResume() override;
-        void OnStop() override;
 
         static SleepControlPresenter *GetInstance();
 
index 724a4a2..35ff527 100644 (file)
@@ -50,22 +50,11 @@ namespace OHOS
 
     void SleepControlPresenter::OnStart()
     {
-        Presenter<SleepControlView>::OnStart();
-    }
-
-    void SleepControlPresenter::OnPause(void)
-    {
-        Presenter<SleepControlView>::OnPause();
     }
 
     void SleepControlPresenter::OnResume(void)
     {
-        Presenter<SleepControlView>::OnResume();
-    }
-
-    void SleepControlPresenter::OnStop(void)
-    {
-        Presenter<SleepControlView>::OnStop();
+        RootView::GetInstance()->SetOnKeyActListener(this);
     }
 
     bool SleepControlPresenter::OnDrag(UIView &view, const DragEvent &event)
index c4f93a9..edc2a79 100644 (file)
@@ -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)
         {