Merge #607 into sdk602patch0626 from refs/changes/607/head 605/target/2 609/target/1
author罗正 <1732036298@qq.com>
Sat, 27 Jul 2024 05:24:14 +0000 (05:24 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Sat, 27 Jul 2024 05:24:14 +0000 (05:24 +0000)
Code review from 罗正

* refs/changes/607/head: (2 commits squashed)

  - 优化滑动关机和重启视图,视觉上拦截slider点击事件

  - Merge branch &#39;sdk602patch0626&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626

Signed-off-by: 罗正 <1732036298@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/607
code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownView.cpp

index a1f1075..02cbd14 100644 (file)
@@ -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;
     }
 
index f7cea52..530fe9e 100644 (file)
@@ -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_);