遥控拍照: 2070/2 2070/head 2083/target/1
authorluozheng <1732036298@qq.com>
Wed, 13 Aug 2025 09:38:35 +0000 (17:38 +0800)
committerluozheng <1732036298@qq.com>
Wed, 13 Aug 2025 09:38:35 +0000 (17:38 +0800)
1.解决遥控拍照界面按钮点击无响应问题
2.解决app下发遥控拍照指令手表无响应问题

code/sdk/application/wearable/fd230/nativeapp/nativeui/takephotos/include/TakephotosPresenter.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/takephotos/include/TakephotosView.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/takephotos/src/TakephotosPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/takephotos/src/TakephotosView.cpp
code/sdk/application/wearable/fd230/service/broadcast/src/broadcast_implement.c
code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c

index 0d40083..bf22bf5 100644 (file)
@@ -20,9 +20,6 @@ namespace OHOS
         virtual ~TakephotosPresenter();
 
         void OnStart() override;
-        void OnPause() override;
-        void OnResume() override;
-        void OnStop() override;
         static TakephotosPresenter *GetInstance();
 
     private:
index 5107e1d..1007a1e 100644 (file)
@@ -51,7 +51,6 @@ namespace OHOS
         static TakephotosView *GetInstance(void);
 
         void OnStart() override;
-        void OnStop() override;
         void InitView();
         void DeInit();
         void PreLoad(void);
index 06a7c0f..6494666 100644 (file)
@@ -37,6 +37,7 @@ namespace OHOS
 
     TakephotosPresenter::TakephotosPresenter()
     {
+        g_pTakephotosPresenter = this;
 #ifdef MEM_CHECK
         MemCheck::GetInstance()->EnableLeakCheck(true);
 #endif
@@ -45,6 +46,7 @@ namespace OHOS
     TakephotosPresenter::~TakephotosPresenter()
     {
         g_pTakephotosPresenter = nullptr;
+        TakePhotosNum = 0;
 #ifdef MEM_CHECK
         MemCheck::GetInstance()->EnableLeakCheck(false);
 #endif
@@ -59,21 +61,6 @@ namespace OHOS
     {
     }
 
-    void TakephotosPresenter::OnPause(void)
-    {
-        Presenter<TakephotosView>::OnPause();
-    }
-
-    void TakephotosPresenter::OnResume(void)
-    {
-        Presenter<TakephotosView>::OnResume();
-    }
-
-    void TakephotosPresenter::OnStop(void)
-    {
-        TakePhotosNum = 0;
-    }
-
     bool TakephotosPresenter::OnDrag(UIView &view, const DragEvent &event)
     {
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&
index cf1586c..e46f0d4 100644 (file)
@@ -111,10 +111,11 @@ namespace OHOS
   /* DeInit:删除组件 */
   void TakephotosView::DeInit()
   {
-
-    if (scrollview_)
+    if (scrollview_ != nullptr)
     {
       scrollview_->RemoveAll();
+      delete scrollview_;
+      scrollview_ = nullptr;
     }
     if (creamView)
     {
@@ -355,15 +356,4 @@ namespace OHOS
       labelclick_->Invalidate();
     }
   }
-
-  void TakephotosView::OnStop()
-  {
-    if (scrollview_ != nullptr)
-    {
-      scrollview_->RemoveAll();
-      delete scrollview_;
-      scrollview_ = nullptr;
-    }
-    return;
-  }
 } // namespace OHOS
index ad29282..c3b661a 100644 (file)
@@ -43,11 +43,17 @@ static const TopicToCore topicToCoreArray[] = {
     {TOPIC_EVENT_LOWPOWER_ALARM, A_CORE_MASK, 1},
     {TOPIC_EVENT_AR_ALERT_TYPE_UPDATE, A_CORE_MASK, 1},
     {TOPIC_EVENT_INACTIVITY_UPDATE, A_CORE_MASK, 1},
-    {TOPIC_EVENT_FIND_WATCH, A_CORE_MASK, 1},
+    {TOPIC_EVENT_FIND_WATCH, A_CORE_MASK, 1},        //查找手表
     {TOPIC_EVENT_DEBUGOUTPUT, A_CORE_MASK, 1},
     {TOPIC_EVENT_GOAL_SHOW_VIEW, A_CORE_MASK, 1},
     {TOPIC_EVENT_DRINKREMINDER, A_CORE_MASK, 1},
     {TOPIC_EVENT_SLEEPNOTE, A_CORE_MASK, 1},
+    {TOPIC_EVENT_ENTER_CMAERA,A_CORE_MASK, 1},      //遥控拍照
+    {TOPIC_EVENT_CANCEL_CMAERA,A_CORE_MASK, 1},     //取消遥控拍照
+    {TOPIC_EVENT_ASSISTANT_NOTE,A_CORE_MASK, 1},    //语音助手
+    {TOPIC_EVENT_MESSAGENOTE,A_CORE_MASK, 1},
+    {TOPIC_EVENT_MESSAGE_UPDATA,A_CORE_MASK, 1},
+    {TOPIC_EVENT_SHUTDOWN_ANIMATIOR,A_CORE_MASK, 1},
 };
 
 /* 所有的topic,其对应的位图 */
index a36f362..103de45 100644 (file)
@@ -4063,15 +4063,7 @@ static void findWatchCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totald
     if(Check_CRC(data,len,crcvalue))\r
     {\r
         uint8_t findFlag = data[0];\r
-        //弹窗界面\r
-        if(findFlag)//查找手表弹窗界面\r
-        // {\r
-        //     CustomEventPublish(TOPIC_EVENT_FIND_WATCH,&findFlag,sizeof(findFlag));\r
-        // }else//停止查找手表 如果在查找手表界面就要停止回到上一级界面\r
-        // {\r
-        //     CustomEventPublish(TOPIC_EVENT_CANCEL_FIND_WATCH,NULL,0);\r
-        // }\r
-        CustomEventPublish(TOPIC_EVENT_FIND_WATCH,&findFlag,sizeof(findFlag));\r
+        CustomEventPublish(TOPIC_EVENT_FIND_WATCH,&findFlag,sizeof(findFlag));//查找手表\r
         setFindWatchFlag(1);\r
     }else\r
     {\r