From 596641b1f722bb39966ebcce978c4fea295152c4 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sat, 28 Mar 2026 17:18:37 +0800 Subject: [PATCH] =?utf8?q?=E4=B8=BB=E7=95=8C=E9=9D=A2=E5=8D=A1=E7=89=87?= =?utf8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/goal/src/goalControlView.cpp | 14 -------- .../nativeui/sleep/src/SleepCardView.cpp | 25 ++------------ .../sleep/src/SleepControlPresenter.cpp | 1 - .../nativeui/sleep/src/SleepControlView.cpp | 34 ++++++++++++------- .../weather/src/WeatherControlView.cpp | 14 -------- 5 files changed, 23 insertions(+), 65 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalControlView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalControlView.cpp index 5f1e157b2..c3aeaefa3 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalControlView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalControlView.cpp @@ -29,11 +29,6 @@ namespace OHOS if (viewiInitStatus == true) { RemoveAll(); - if (goalOnSwipeListener != nullptr) - { - delete goalOnSwipeListener; - goalOnSwipeListener = nullptr; - } if (maingoalView != nullptr) { delete maingoalView; @@ -51,8 +46,6 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherView::new mainweatherView fail!"); return false; } - - UISwipeView *goalSwipView = dynamic_cast(maingoalView->GetGoalPageView()); if (goalSwipView == nullptr) { @@ -60,13 +53,6 @@ namespace OHOS return false; } - goalOnSwipeListener = static_cast(new GoalControlViewOnSwipeListener()); - if (goalOnSwipeListener == nullptr) - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "weatherOnSwipeListener new fail"); - return false; - } - goalSwipView->SetOnSwipeListener(goalOnSwipeListener); Add(goalSwipView); return true; diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepCardView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepCardView.cpp index 780d285d7..81411d4d0 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepCardView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/sleep/src/SleepCardView.cpp @@ -33,22 +33,8 @@ namespace OHOS RemoveAll(); if (sleepcontrolView != nullptr) { - if (sleepOnSwipeListener != nullptr) - { - delete sleepOnSwipeListener; - sleepOnSwipeListener = nullptr; - } - - if (sleepcontrolView != nullptr) - { - delete sleepcontrolView; - sleepcontrolView = nullptr; - } - if(SleepSwipView) - { - delete SleepSwipView; - SleepSwipView = nullptr; - } + delete sleepcontrolView; + sleepcontrolView = nullptr; } } } @@ -70,13 +56,6 @@ namespace OHOS return false; } - sleepOnSwipeListener = static_cast(new SleepOnSwipeListener()); - if (sleepOnSwipeListener == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sleepOnSwipeListener new fail"); - return false; - } - SleepSwipView->SetOnSwipeListener(sleepOnSwipeListener); Add(SleepSwipView); return true; 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 35ff5274c..a74562438 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 @@ -104,7 +104,6 @@ namespace OHOS void SleepControlPresenter::OnSwipe(UISwipeView &view) {} void SleepOnSwipeListener::OnSwipe(UISwipeView &view) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SleepOnSwipeListener::OnSwipe,current tab index = %d", view.GetCurrentPage()); return; } } \ No newline at end of file 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 edc2a79d3..8474ff71f 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 @@ -40,24 +40,32 @@ namespace OHOS { if (SleepSwipeViewList != nullptr) { - for (int32_t i = 0; i < maxPage; i++) - { - recordCard[i] = nullptr; - } - SleepSwipeViewList->RemoveAll(); + delete SleepSwipeViewList; + SleepSwipeViewList = nullptr; - delete sleepView; - sleepView = nullptr; + if (sleepView != nullptr) + { + delete sleepView; + sleepView = nullptr; + } - delete sleeptimeView; - sleeptimeView = nullptr; + if (sleeptimeView != nullptr) + { + delete sleeptimeView; + sleeptimeView = nullptr; + } - delete sleepnapView; - sleepnapView = nullptr; + if (sleepnapView != nullptr) + { + delete sleepnapView; + sleepnapView = nullptr; + } - delete SleepSwipeViewList; - SleepSwipeViewList = nullptr; + for (int32_t i = 0; i < maxPage; i++) + { + recordCard[i] = nullptr; + } } } /*初始化主睡眠界面VIEW*/ diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/weather/src/WeatherControlView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/weather/src/WeatherControlView.cpp index 867efa38b..64ec0b0d6 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/weather/src/WeatherControlView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/weather/src/WeatherControlView.cpp @@ -35,9 +35,6 @@ namespace OHOS if (viewiInitStatus == true) { RemoveAll(); - delete weatherOnSwipeListener; - weatherOnSwipeListener = nullptr; - delete mainWeatherView; mainWeatherView = nullptr; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherControlView::ClearAll success!!"); @@ -73,17 +70,6 @@ namespace OHOS } } - if (weatherOnSwipeListener == nullptr) - { - weatherOnSwipeListener = static_cast(new WeatherControlViewOnSwipeListener()); - if (weatherOnSwipeListener == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "weatherOnSwipeListener new fail"); - return false; - } - } - - // weatherSwipView->SetOnSwipeListener(weatherOnSwipeListener); weatherSwipView->SetVisible(false); Add(weatherSwipView); -- 2.17.1