Merge #813 into sdk602patch0626 from refs/changes/813/head 818/target/1
author袁清梦 <3449750381@qq.com>
Thu, 29 Aug 2024 02:34:38 +0000 (02:34 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Thu, 29 Aug 2024 02:34:38 +0000 (02:34 +0000)
Code review from 袁清梦

* refs/changes/813/head: (8 commits squashed)

  - 屏蔽KeyInputListener里面的不使用功能

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

  - 修复密码锁通过蓝牙解锁进行状态同步

  - 修改&quot;重新检测->重测“

  - 删除重复的字段

  - 修复睡眠进度条的两端为圆形

  - 修改每日目标进度条方向

  - 修改训练中进度条颜色为绿色

Signed-off-by: Caisking <3449750381@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/813
code/sdk/application/wearable/fd230app/nativeui/codedlock/include/CodedLockModel.h
code/sdk/application/wearable/fd230app/nativeui/codedlock/src/CodedLockModel.cpp
code/sdk/application/wearable/fd230app/nativeui/goal/src/goalview.cpp
code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TrainingDataView.cpp
code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang
tools/language_tool/Language_xml/input_list_zh.txt
tools/language_tool/Language_xml/language.xlsx
tools/language_tool/Language_xml/language_zh.xml
tools/language_tool/font/zh.lang

index 76e12d7..995b85c 100644 (file)
@@ -1,3 +1,9 @@
+/*** 
+ * @Date: 2024-08-21 15:27:38
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-08-28 18:32:09
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/codedlock/include/CodedLockModel.h
+ */
 #ifndef CODEDLOCKMODEL_H
 #define CODEDLOCKMODEL_H
 
@@ -33,6 +39,8 @@ namespace OHOS
         uint8_t GetPointNum();
         // 配置用户密码
         void SetUserPassWord(const std::string &password);
+        // ble进行解锁
+        void BleUnlock();
 
     private:
         CodedLockModel();
index 25c7d8d..40175f1 100644 (file)
@@ -1,9 +1,13 @@
 #include "codedlock/include/CodedLockModel.h"
+#include "MainViewSample.h"
+#include "codedlock/include/CodedLockView.h"
 #include <cctype>
 #include <algorithm>
 #include "wearable_log.h"
 #include "string.h"
 #include "ConfigModel.h"
+
+extern "C" void uapi_dev_runtime_set_lock_status(uint8_t status);
 namespace OHOS
 {
     /**
@@ -185,4 +189,26 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "密码为空");
         }
     }
+
+    /**
+     * @brief 更新用户状态
+     */
+    void CodedLockModel::BleUnlock()
+    {
+        // 先进行解锁
+        uapi_dev_runtime_set_lock_status(0);
+        /*设置表盘状态*/
+        MainModel::GetInstance().setDialState(DialState::LOCK, false);
+
+        // 获取当前活动视图的实例
+        auto mainViewInstance = MainViewSample::GetInstance();
+        auto codedLockViewInstance = CodedLockView::GetInstance();
+
+        // 如果是在主界面或密码锁界面,重新进入主界面
+        if (mainViewInstance != nullptr || codedLockViewInstance != nullptr)
+        {
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
+        }
+    }
+
 }
\ No newline at end of file
index 76e51cf..d0752e1 100644 (file)
@@ -237,8 +237,8 @@ namespace OHOS
         circleProgress1_->SetForegroundStyle(STYLE_LINE_WIDTH, 20);
         circleProgress1_->SetCenterPosition(233, 229);
         circleProgress1_->SetRadius(205);
-        circleProgress1_->SetStartAngle(40);
-        circleProgress1_->SetEndAngle(320);
+        circleProgress1_->SetStartAngle(320);
+        circleProgress1_->SetEndAngle(40);
         circleProgress1_->SetValue(GoalModel::GetInstance().getstepvalue());
         circleProgress1_->SetBackgroundImagePosition(36, 26);
         circleProgress1_->SetCapType(CAP_ROUND);
index 23f40d3..4aca60c 100644 (file)
@@ -23,6 +23,7 @@ namespace OHOS
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " SleepView::~SleepView");
         ClearAll();
+
         g_pSleepView = nullptr;
     }
 
@@ -47,6 +48,7 @@ namespace OHOS
             float value = (static_cast<float>(SleepModel::GetInstance().get_sleep_total()) / static_cast<float>(SleepModel::GetInstance().get_sleep_goal())) * 100.0f;
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "value %d!", value);
             circleProgress_->SetValue(value);
+            circleProgress_->SetCapType(CAP_ROUND);
         }
 
         // 更新目标时间
index 002bc75..463bb18 100644 (file)
@@ -65,7 +65,7 @@ namespace OHOS
         circleProgress->SetBackgroundStyle(STYLE_LINE_WIDTH, 12);
         circleProgress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, 0xff2195F6);
         circleProgress->SetForegroundStyle(STYLE_BORDER_COLOR, 0xff000000);
-        circleProgress->SetForegroundStyle(STYLE_LINE_COLOR, 0xff45A5FF);
+        circleProgress->SetForegroundStyle(STYLE_LINE_COLOR, 0xff4fC34C);
         circleProgress->SetForegroundStyle(STYLE_LINE_WIDTH, 10);
         circleProgress->SetCenterPosition(235, 235);
         circleProgress->SetRadius(215);
@@ -82,8 +82,8 @@ namespace OHOS
 
         InitLabel(curtimelabel, 155, 60, 150, 50, "label1", "23:54", DEFAULT_VECTOR_FONT_FILENAME, 40);
 
-        InitLabel(timerlabel, 0, 163, 466, 150, "label3", "00:00:00", GILROY_BOLD_FONT, 80);
-        InitLabel(heartlabel, 85, 284, 230, 80, "label4", "144", GILROY_BOLD_FONT, 60);
+        InitLabel(timerlabel, 0, 163, 466, 150, "label3", "00:00:00", DEFAULT_VECTOR_FONT_FILENAME, 80);
+        InitLabel(heartlabel, 85, 284, 230, 80, "label4", "144", DEFAULT_VECTOR_FONT_FILENAME, 60);
         InitLabel(ubpmlabel, 218, 284, 230, 80, "label5", "bpm", DEFAULT_VECTOR_FONT_FILENAME, 60);
         ubpmlabel->SetTextColor(Color::Gray());
         Add(curtimelabel);
index 7db379f..99d68d6 100644 (file)
@@ -615,6 +615,12 @@ void ble_set_password(uint8_t falg, char * data)
     printf("设置手表密码 %d %s \r\n",falg, data);   
 
     /*更新model密码配置*/
+    if(falg == 0)
+    {
+        //更新手表状态
+        GraphicService::GetInstance()->PostGraphicEvent(
+        std::bind(&OHOS::CodedLockModel::BleUnlock, OHOS::CodedLockModel::GetInstance()));      
+    }
     OHOS::CodedLockModel::GetInstance()->SetUserPassWord(data);
 
     return;
index 1492dc2..94677db 100644 (file)
Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang differ
index 00a6ccf..50bed8a 100644 (file)
@@ -271,7 +271,7 @@ STR_CHECKERROR$检测不到结果
 STR_WAERKEEP$请确认已带上手表,并保持静止\r
 STR_WEARRE$进行重新检测\r
 STR_WEARREADY$准备好后点击下方按钮\r
-STR_RECHECK$é\87\8dæ\96°æ£\80æµ\8b\r
+STR_RECHECK$重测\r
 STR_CHECKEWARN$血氧提醒\r
 STR_BLOODSHORT$当前血氧含量已低于XX%\r
 STR_HEARTNOTE$请注意身体健康\r
index ff7f4b3..999cdd3 100644 (file)
Binary files a/tools/language_tool/Language_xml/language.xlsx and b/tools/language_tool/Language_xml/language.xlsx differ
index ae3b258..e3658d8 100644 (file)
        <lanstr id="STR_WAERKEEP" value="请确认已带上手表,并保持静止"/>
        <lanstr id="STR_WEARRE" value="进行重新检测"/>
        <lanstr id="STR_WEARREADY" value="准备好后点击下方按钮"/>
-       <lanstr id="STR_RECHECK" value="é\87\8dæ\96°æ£\80æµ\8b"/>
+       <lanstr id="STR_RECHECK" value="重测"/>
        <lanstr id="STR_CHECKEWARN" value="血氧提醒"/>
        <lanstr id="STR_BLOODSHORT" value="当前血氧含量已低于XX%"/>
        <lanstr id="STR_HEARTNOTE" value="请注意身体健康"/>
index 1492dc2..94677db 100644 (file)
Binary files a/tools/language_tool/font/zh.lang and b/tools/language_tool/font/zh.lang differ