From: Caisking Date: Thu, 8 May 2025 02:57:15 +0000 (+0800) Subject: 呼吸训练增加滑动退出 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~324 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=029967bb4469b2808748e01554419349416595b2;p=mirrors%2FFD230.git 呼吸训练增加滑动退出 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingPresenter.cpp index 26ba3227b..2238c303d 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingPresenter.cpp @@ -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(); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingView.cpp index f3acf6be6..99a6a41ad 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingView.cpp @@ -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 diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/sleep/src/SleepControlView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/sleep/src/SleepControlView.cpp index b91c737d1..4836eaab6 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/sleep/src/SleepControlView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/sleep/src/SleepControlView.cpp @@ -100,9 +100,7 @@ namespace OHOS /*OnStart 增加界面控制*/ void SleepControlView::OnStart() { - View::OnStart(); - AddViewToRootContainer(new UIViewGroup()); - GetRootContainer()->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + GetRootContainer()->SetTouchable(true); GetRootContainer()->SetDraggable(true); AddViewToRootContainer(GetSleepControlPageView());