运动识别弹窗修改,需要添加开始运动接口 723/1 723/head
authorluozheng <1732036298@qq.com>
Mon, 19 Aug 2024 03:27:21 +0000 (11:27 +0800)
committerluozheng <1732036298@qq.com>
Mon, 19 Aug 2024 03:27:21 +0000 (11:27 +0800)
code/sdk/application/wearable/service/msg_center/include/notify/motion_recognition_notification.h
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/service/msg_center/src/notify/motion_recognition_notification.cpp

index f435425..7125889 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-08-17 16:43:46
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-19 09:31:47
+ * @LastEditTime: 2024-08-19 11:00:50
  * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/include/notify/motion_recognition_notification.h
  */
 
@@ -26,6 +26,7 @@ namespace OHOS
 
         void SetMotionTypeId(int type);
         int GetMotionType(void);
+        int GetMotionTypeTextId(void);
 
     private:
         MotionRecognitionViewEventListener();
index 85ce944..f492994 100644 (file)
@@ -1140,7 +1140,7 @@ void MsgCenterNotifyArAlertProc(const Topic topic, Request* req)
 {
     uint8_t* motionType=(uint8_t*)req->data;
     WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyArAlertProc,motionType = %d !",*motionType);
-    if(*motionType == 0) //未知运动不弹窗
+    if(*motionType > 5 || *motionType <1) //未知运动不弹窗
     {
         return;
     }
index 10b984f..fb625ce 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-08-17 16:44:20
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-19 10:15:11
+ * @LastEditTime: 2024-08-19 11:25:09
  * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/motion_recognition_notification.cpp
  */
 #include "notification_manager.h"
@@ -69,6 +69,8 @@ namespace OHOS
             /*关闭弹窗*/
             NotificationManager::GetInstance()->StopNotify();
             /*开始运动*/
+            int textId = GetMotionTypeTextId();
+            // set_sport_config(textId);
         }
 
         return true;
@@ -123,15 +125,36 @@ namespace OHOS
             motionType = STR_MOTION_DETECTION_ROWING_NOTE;
             break;
         case 5:
-            motionType = STR_MOTION_DETECTION_ROWING_NOTE;
-            break;
-        default:
-            motionType = STR_MOTION_DETECTION_WALK_NOTE;
+            motionType = STR_MOTION_DETECTION_ELLIPTICAL_NOTE;
             break;
         }
         return motionType;
     }
 
+    int MotionRecognitionViewEventListener::GetMotionTypeTextId(void)
+    {
+        int motionTypeTextId;
+        switch (motionTypeId)
+        {
+        case 1:
+            motionTypeTextId = STR_EXERCISE_OUTDOORWALKING;
+            break;
+        case 2:
+            motionTypeTextId = STR_EXERCISE_OUTDOORRUNNING;
+            break;
+        case 3:
+            motionTypeTextId = STR_EXERCISE_OUTDOORBIKING;
+            break;
+        case 4:
+            motionTypeTextId = STR_EXERCISE_ROWINGMACHINE;
+            break;
+        case 5:
+            motionTypeTextId = STR_EXERCISE_ELLIPTICALTRAINER;
+            break;
+        }
+        return motionTypeTextId;
+    }
+
     static std::string UpdateNoteLabelText(UILabelExt *&label, const std::string &newText, int id)
     {
         if (label == nullptr)