呼吸训练增加滑动退出 1740/1
authorCaisking <Casiking@zhihuishixun.com>
Thu, 8 May 2025 02:57:15 +0000 (10:57 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Thu, 8 May 2025 02:57:15 +0000 (10:57 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/sleep/src/SleepControlView.cpp

index 26ba322..2238c30 100644 (file)
@@ -116,7 +116,7 @@ namespace OHOS
 
     bool RespiratoryTrainingPresenter::OnDragEnd(UIView &view, const DragEvent &event)
     {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RespiratoryTrainingPresenter::OnDragEnd");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RespiratoryTrainingPresenter::OnDragEnd");
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && RespiratoryTrainingPresenter::X_DRAG_FLAG)
         {
             std::string viewId = view.GetViewId();
index f3acf6b..99a6a41 100644 (file)
@@ -572,6 +572,11 @@ namespace OHOS
 
     void RespiratoryTrainingView::OnStart()
     {
+
+        RootView::GetInstance()->SetDraggable(true);
+        RootView::GetInstance()->SetTouchable(true);
+        RootView::GetInstance()->SetOnDragListener(presenter_);
+ 
         RespiratoryTrainingViewInit();
     }
 }
\ No newline at end of file
index b91c737..4836eaa 100644 (file)
@@ -100,9 +100,7 @@ namespace OHOS
     /*OnStart 增加界面控制*/
     void SleepControlView::OnStart()
     {
-        View<SleepControlPresenter>::OnStart();
-        AddViewToRootContainer(new UIViewGroup());
-        GetRootContainer()->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());
+
         GetRootContainer()->SetTouchable(true);
         GetRootContainer()->SetDraggable(true);
         AddViewToRootContainer(GetSleepControlPageView());