From 1c17ddb784b15fa4b63a04dfef5d8748345adf8c Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sat, 27 Jul 2024 13:08:36 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E6=BB=91=E5=8A=A8=E5=85=B3?= =?utf8?q?=E6=9C=BA=E5=92=8C=E9=87=8D=E5=90=AF=E8=A7=86=E5=9B=BE=EF=BC=8C?= =?utf8?q?=E8=A7=86=E8=A7=89=E4=B8=8A=E6=8B=A6=E6=88=AAslider=E7=82=B9?= =?utf8?q?=E5=87=BB=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/RebootAndShutdownPresenter.cpp | 18 +++++++++++++++++- .../src/RebootAndShutdownView.cpp | 6 ++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownPresenter.cpp index a1f107518..02cbd14f9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownPresenter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:11:17 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-07-20 14:56:16 + * @LastEditTime: 2024-07-27 13:03:52 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/RebootAndShutdownPresenter.cpp */ #include "AppViewIDs.h" @@ -88,6 +88,22 @@ namespace OHOS { RebootAndShutdownView::GetInstance()->ChangeView(FACTORYRESET, REBOOTANDSHUTDOWN); } + else if (strcmp(view.GetViewId(), SHUTDOWN_SLIDER_VIEWID) == 0) + { + auto shutdownSlider = view_->GetShutdownSlider(); + if (shutdownSlider != nullptr) + { + shutdownSlider->SetValue(SLIDER_VALUE_MIN); + } + } + else if (strcmp(view.GetViewId(), REBOOT_SLIDER_VIEWID) == 0) + { + auto rebootSlider = view_->GetRebootSlider(); + if (rebootSlider != nullptr) + { + rebootSlider->SetValue(SLIDER_VALUE_MIN); + } + } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownView.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownView.cpp index f7cea52ec..530fe9ea2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-07-18 14:26:08 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-07-24 17:35:57 + * @LastEditTime: 2024-07-27 12:55:14 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownView.cpp */ @@ -227,7 +227,7 @@ namespace OHOS return false; } shutdownSlider->SetPosition(10, 10, 360, 80); - shutdownSlider->SetViewId(REBOOT_SLIDER_VIEWID); + shutdownSlider->SetViewId(SHUTDOWN_SLIDER_VIEWID); shutdownSlider->SetStyle(STYLE_BORDER_RADIUS, 100); shutdownSlider->SetRange(100, 0); shutdownSlider->SetValidWidth(360); @@ -267,9 +267,11 @@ namespace OHOS rebootSlider->SetValue(12); rebootSlider->SetCapType(CapType::CAP_ROUND); } + shutdownSlider->SetOnClickListener(presenter_); shutdownSlider->SetOnDragListener(presenter_); shutdownSlider->SetSliderEventListener(presenter_); + rebootSlider->SetOnClickListener(presenter_); rebootSlider->SetOnDragListener(presenter_); rebootSlider->SetSliderEventListener(presenter_); -- 2.17.1