From 2abd1650e4583661b9a64bb8a4ae9b5dd1636b8c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Sat, 16 Nov 2024 10:47:52 +0000 Subject: [PATCH] Merge #1412 into sdk602patch0911 from refs/changes/1412/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/1412/head: (3 commits squashed) - applsit拨号盘实现:目前,滑动一下屏幕APP转动一次,后续优化为多次转动 - 解决倒计时界面内存泄漏问题 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: Caisking <3449750381@qq.com> Reviewed-by: 罗正 <1732036298@qq.com> Reviewed-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Reviewed-by: aliyun6865282430 <1624952103@qq.com> Merged-by: Caisking <3449750381@qq.com> CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1412 --- .../countdown/src/MainCountDownPresenter.cpp | 4 +++- .../nativeui/countdown/src/MainCountDownView.cpp | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/countdown/src/MainCountDownPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/countdown/src/MainCountDownPresenter.cpp index 26c6c0578..ddf2320ce 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/countdown/src/MainCountDownPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/countdown/src/MainCountDownPresenter.cpp @@ -158,7 +158,8 @@ namespace OHOS { UITimePicker *timePicker = CountDownTimeConfigView::GetInstance()->GetTimePicker(); - if (nullptr != timePicker && ("00:00:00" != timePicker->GetSelectValue())) + std::string timeValue = timePicker->GetSelectValue(); + if (nullptr != timePicker && ("00:00:00" != timeValue)) { CountDownModel::GetInstance()->SetCountDownTime(timePicker->GetSelectValue()); // 设置倒计时时间 CountDownModel::GetInstance()->SetRingTime(timePicker->GetSelectValue()); // 设置响铃时间 @@ -201,6 +202,7 @@ namespace OHOS { CountDownModel::GetInstance()->SetCountDownTime("00:00:00"); CountDownModel::GetInstance()->SetRingTime("00:00:00"); + CountDownModel::GetInstance()->CountDown_StopTimer(); CountDownModel::GetInstance()->StopRingtonePlaybackAndReleaseResources(); p_StartCountDownView->GetPlayOrPauseToggleButton()->SetTouchable(true); p_StartCountDownView->GetPlayOrPauseToggleButton()->SetState(false); diff --git a/code/sdk/application/wearable/fd230app/nativeui/countdown/src/MainCountDownView.cpp b/code/sdk/application/wearable/fd230app/nativeui/countdown/src/MainCountDownView.cpp index 150f0ff9a..fcfecb757 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/countdown/src/MainCountDownView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/countdown/src/MainCountDownView.cpp @@ -245,14 +245,17 @@ namespace OHOS bool MainCountDownView::ChangeMainCountDown(int16_t thisView) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCountDownView::ChangeMainCountDown"); - UIScrollView *view = MainCountDownViewInit(); - if (view == nullptr) + if (scrollView[thisView] == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "view nullptr fail"); - return false; + UIScrollView *view = MainCountDownViewInit(); + if (view == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "view nullptr fail"); + return false; + } + scrollView[thisView] = view; + container_->Add(scrollView[thisView]); } - scrollView[thisView] = view; - container_->Add(scrollView[thisView]); return true; } @@ -426,6 +429,7 @@ namespace OHOS container_->SetTouchable(true); container_->SetDraggable(true); /* -------------------------------------------------------------------------- */ + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%d,%d",CountDownModel::GetInstance()->CountDownTimerIsEnd(),CountDownModel::GetInstance()->GetChanageToStartCountDownView()); if (CountDownModel::GetInstance()->CountDownTimerIsEnd() == false || CountDownModel::GetInstance()->GetChanageToStartCountDownView() == true) { -- 2.17.1