Merge #181 into xts_origin from refs/changes/181/head 183/target/1
author罗正 <1732036298@qq.com>
Sat, 25 May 2024 08:06:30 +0000 (08:06 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Sat, 25 May 2024 08:06:30 +0000 (08:06 +0000)
Code review from 罗正

* refs/changes/181/head: (4 commits squashed)

  - 1.添加查找手表,来电,闹钟的铃声,
    2.修改查找手表的铃声为新添加铃声
    3.,修改下来视图中RefreshData函数中注释错误

  - 修改CustomEventPublish的第二和第三个参数,将c_activity_result_t更正为c_inactivity_result_t,以确保参数与实际类型匹配。

  - 添加久坐视功能,久坐开关,久坐时间间隔,就做时间段设置需要协议配合设置

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

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/181
14 files changed:
code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h
code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp
code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp
code/sdk/application/wearable/service/msg_center/CMakeLists.txt
code/sdk/application/wearable/service/msg_center/include/notify/findwatch_notification.h
code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h
code/sdk/application/wearable/service/msg_center/include/notify/sedentaryReminder_notification.h [new file with mode: 0644]
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp
code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp
code/sdk/application/wearable/service/msg_center/src/notify/sedentaryReminder_notification.cpp [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/alarm.mp3 [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/calling.mp3 [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/findwatch.mp3 [new file with mode: 0644]

index 5bcef9c..37c61ca 100644 (file)
@@ -88,6 +88,10 @@ namespace OHOS
             CONFIFMOFEL_ITEM_SLEEP_BEDTIME,//就寝时间
             CONFIFMOFEL_ITEM_SLEEP_GET_UP,//起床时间
             CONFIFMOFEL_ITEM_SLEEP_REMIND,//提前20分钟提醒开关
+            //久坐提醒相关
+            CONFIFMOFEL_ITEM_SEDENTARY_SWITCH,//久坐提醒开关
+            CONFIFMOFEL_ITEM_SEDENTARY_INTERVAL,//久坐提醒时间间隔(单位小时)
+            CONFIFMOFEL_ITEM_SEDENTARY_REMINDERTIME,//久坐提醒时间段
 
             CONFIFMOFEL_ITEM_SIM_ICCID,//SIM卡的ICCID
             CONFIFMOFEL_ITEM_TELECOM_DMP_TIMESEC,//注册时间戳
@@ -194,6 +198,16 @@ namespace OHOS
         void SetA2DPState(bool value);
         bool GetA2DPState(void);
 
+        /* ------------------------------ 久坐提醒相关set与get ----------------------------- */
+        void SetSedentarySwitch(const bool value);
+        bool GetSedentarySwitch();
+
+        void SetSedentaryInterval(const int value);
+        int GetSedentaryInterval();
+
+        void SetSedentaryReminderTime(const std::string& value);
+        std::string GetSedentaryReminderTime();
+
         /* ---------------------------------- 运动识别相关set与get ---------------------------------- */
         void SetMotionRecognition(bool state);
         bool GetMotionRecognition(void);
@@ -256,8 +270,11 @@ namespace OHOS
             {ConfigDataType::DATATYPE_INT,     "sleep_bedtime",            "0" }, //CONFIFMOFEL_ITEM_SLEEP_BEDTIME,//就寝时间
             {ConfigDataType::DATATYPE_INT,     "sleep_getup",              "0" }, // CONFIFMOFEL_ITEM_SLEEP_GET_UP,//起床时间
             {ConfigDataType::DATATYPE_INT,     "sleep_remide",             "0" }, // CONFIFMOFEL_ITEM_SLEEP_REMIND,//提前20分钟提醒开关
-            {ConfigDataType::DATATYPE_STRING,     "sim_iccid",             "" },//CONFIFMOFEL_ITEM_SIM_ICCID cat1的iccid
-            {ConfigDataType::DATATYPE_STRING,     "telecom_regist_timesec","" },//CONFIFMOFEL_ITEM_TELECOM_DMP_TIMESEC
+            {ConfigDataType::DATATYPE_BOOL,    "sedentary_switch",         "false"       }, // CONFIFMOFEL_ITEM_SEDENTARY_SWITCH,//久坐提醒开关
+            {ConfigDataType::DATATYPE_INT,     "sedentary_interval",       "1"           }, // CONFIFMOFEL_ITEM_SEDENTARY_INTERVAL,//久坐提醒时间间隔
+            {ConfigDataType::DATATYPE_STRING,  "sedentary_reminderTime ",  "10:00-22:00" }, // CONFIFMOFEL_ITEM_SEDENTARY_REMINDERTIME,//久坐提醒时间段
+            {ConfigDataType::DATATYPE_STRING,  "sim_iccid",                ""            },//CONFIFMOFEL_ITEM_SIM_ICCID cat1的iccid
+            {ConfigDataType::DATATYPE_STRING,  "telecom_regist_timesec",   ""            },//CONFIFMOFEL_ITEM_TELECOM_DMP_TIMESEC
         };
         ConfigModel();                                        // 私有构造函数,确保无法在外部实例化
         ConfigModel(const ConfigModel &) = delete;            // 禁止拷贝构造
index 3c118ed..a653c59 100644 (file)
@@ -564,6 +564,42 @@ namespace OHOS
         return get_configData_bool(CONFIGMODEL_ITEM_A2DP);
     }
 
+    // 设置久坐提醒开关
+    void ConfigModel::SetSedentarySwitch(const bool value) 
+    {
+        set_condigData_Bool(CONFIFMOFEL_ITEM_SEDENTARY_SWITCH,value);
+    }
+
+    // 获取久坐提醒开关
+    bool ConfigModel::GetSedentarySwitch() 
+    {
+        return get_configData_bool(CONFIFMOFEL_ITEM_SEDENTARY_SWITCH);
+    }
+
+    // 设置久坐提醒时间间隔
+    void ConfigModel::SetSedentaryInterval(const int value) 
+    {
+        set_condigData_Int(CONFIFMOFEL_ITEM_SEDENTARY_INTERVAL,value);
+    }
+
+    // 获取久坐提醒时间间隔
+    int ConfigModel::GetSedentaryInterval() 
+    {
+        return get_configData_int(CONFIFMOFEL_ITEM_SEDENTARY_INTERVAL);
+    }
+
+    // 设置久坐提醒时间段
+    void ConfigModel::SetSedentaryReminderTime(const std::string& value) 
+    {
+        set_condigData_String(CONFIFMOFEL_ITEM_SEDENTARY_REMINDERTIME,value.c_str());
+    }
+
+    // 获取久坐提醒时间段
+    std::string ConfigModel::GetSedentaryReminderTime() 
+    {
+        return get_configData_string(CONFIFMOFEL_ITEM_SEDENTARY_REMINDERTIME);
+    }
+
     /* -------------------------------------------------------------------------- */
     void ConfigModel::SetLanguage(int language)
     {
index dc1b191..d8a17b8 100644 (file)
@@ -804,7 +804,7 @@ namespace OHOS
     void PullUpDownView::RefreshData()
     {
         PRINT("RefreshData Begin!\n");
-        // è\8e·å\8f\96å½\93å\89\8dæ\97¶é\97´
+        // è§£æ\9e\90æ\97¥æ\9c\9fä¿¡æ\81¯
         char *dateStr = (char *)malloc(9);
         if (uapi_get_YYMMDD_Time(dateStr, '/') != ERRCODE_SUCC)
         {
@@ -812,7 +812,7 @@ namespace OHOS
             free(dateStr);
             return;
         }
-        // è§£æ\9e\90æ\97¥æ\9c\9fä¿¡æ\81¯
+        // è\8e·å\8f\96å½\93å\89\8dæ\97¶é\97´
         char *timeStr = (char *)malloc(9);
         if (uapi_get_HHMMSS_Time(timeStr, ':', false) != ERRCODE_SUCC)
         {
index 65d88b4..35ea3b8 100755 (executable)
@@ -156,6 +156,7 @@ set(SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/pairing_notification.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/findwatch_notification.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/drinkReminder_notification.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/sedentaryReminder_notification.cpp
 )
 else()
 set(SOURCES
@@ -168,6 +169,7 @@ set(SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/pairing_notification.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/findwatch_notification.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/drinkReminder_notification.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/sedentaryReminder_notification.cpp
 )
 endif()
 
index 9b931bb..c946c57 100644 (file)
@@ -89,7 +89,7 @@ namespace OHOS
         std::shared_ptr<FindWatchRingPlayerListener> playerInterruptListener{nullptr};
         AudioSession sessionId;
         AudioInterrupt interrupt;
-        char *RingMusicName = "alarm.mp3";
+        char *RingMusicName = "findwatch.mp3";
         bool FindWatchNotifyFlag{false}; // 判断是查找手表, 由notify生成界面
     };
 }
index 2aa2ddd..fc7f116 100755 (executable)
@@ -27,6 +27,7 @@
 #include "pairing_notification.h"
 #include "findwatch_notification.h"
 #include "drinkReminder_notification.h"
+#include "sedentaryReminder_notification.h"
 
 #define UN_OPACITY 255
 #define HAlf_SCREEN  2
diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/sedentaryReminder_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/sedentaryReminder_notification.h
new file mode 100644 (file)
index 0000000..e808751
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef SEDENTARYREMINDER_NOTIFICATION
+#define SEDENTARYREMINDER_NOTIFICATION
+/*久坐提醒*/
+
+#include "BaseView.h"
+namespace OHOS
+{
+    UIViewGroup *CreateSedentaryReminderView(void);
+    void FreeSedentaryReminderView(void);
+
+    class SedentaryReminderViewEventListener : public UIView::OnTouchListener
+    {
+    public:
+        static SedentaryReminderViewEventListener &GetInstance();
+        bool OnRelease(UIView &view, const ReleaseEvent &event) override;
+        bool IsReminderTime();
+    private:
+        SedentaryReminderViewEventListener();
+        ~SedentaryReminderViewEventListener();
+        SedentaryReminderViewEventListener(const SedentaryReminderViewEventListener &) = delete;
+        const SedentaryReminderViewEventListener &operator=(const SedentaryReminderViewEventListener &) = delete;
+        int interval;             // 久坐间隔设置
+        std::string reminderTime; // 提醒时间段设置
+    };
+
+}
+#endif
\ No newline at end of file
index 31b13a5..c068f7a 100644 (file)
@@ -44,6 +44,7 @@
 //#include "TraingCardPresenter.h"
 #include "custom_runtime.h"
 #include "producttest/include/testcat1.h"
+#include <cywee_hal.h>
 //#include "Systemupgrade.h"
 namespace OHOS {
 
@@ -222,6 +223,12 @@ static OHOS::UIViewGroup* showDrinkReminderNotify(void)
     return OHOS::CreateDrinkReminderView();
 }
 
+/*显示久坐提醒视图*/
+static OHOS::UIViewGroup* showSedentaryReminderNotify(void)
+{
+    return OHOS::CreateSedentaryReminderView();
+}
+
 void MsgCenterNotifyAlarmProc(const Topic topic, Request* req)
 {
     unused(req);
@@ -832,11 +839,46 @@ void MsgCenterNotifyActivityProc(const Topic topic, Request* req)
     unused(topic);
     unused(req);
 }
-void MsgCenterNotifyInactivityProc(const Topic topic, Request* req)
+void MsgCenterNotifyInactivityProc(const Topic topic, Request *req)
 {
+    WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyInactivityProc !");
     unused(topic);
-    unused(req);
-} 
+    PRINT("request %d\r\n", req->msgId);
+    
+    cywee_inactivity_result_t *cywee_Inactivity_Info = (cywee_inactivity_result_t *)malloc(req->len);
+    if (!cywee_Inactivity_Info)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Memory allocation failure");
+        return;
+    }
+    
+    int rets = memcpy_s(cywee_Inactivity_Info, req->len, (cywee_inactivity_result_t*)req->data, req->len);
+    if (rets != EOK)
+    {
+        free(cywee_Inactivity_Info);
+        cywee_Inactivity_Info = NULL;
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s cywee_inactivity_result_t failed, ret = %d", rets);
+        return;
+    }
+    
+    WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "cywee_Inactivity_Info->sedentary_status = %d, stand_freq = %d", cywee_Inactivity_Info->sedentary_status, cywee_Inactivity_Info->stand_freq);
+    WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "cywee_Inactivity_Info->output_number = %d", cywee_Inactivity_Info->output_number);
+    
+    switch (cywee_Inactivity_Info->output_number)
+    {
+        case INACTIVITY_MODE_SEDENTARY_OUTPUT:
+            NotificationManager::GetInstance()->ShowNotify(showSedentaryReminderNotify, (uint16_t)topic, true);
+            // if(SedentaryReminderViewEventListener::GetInstance().IsReminderTime() == true)
+            // {
+            //      NotificationManager::GetInstance()->ShowNotify(showSedentaryReminderNotify, (uint16_t)topic, true);
+            // }
+            break;
+        default:
+            break;
+    }
+    
+    free(cywee_Inactivity_Info);
+}
 //APP运动相关
 void MsgCenterNotifybleAPPtraining(const Topic topic, Request* req)
 {
index 31657ab..0302310 100644 (file)
@@ -87,7 +87,7 @@ namespace OHOS
     {
         // 本地播放文件路径和状态
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RingPlayerInit start!");
-        std::string strSrcMusic("/user/music");
+        std::string strSrcMusic("/user/res/ring");
         std::string tempStr("/");
         std::string strName = RingMusicName;
         uri = strSrcMusic + tempStr + strName;
index 3eb3796..3298f9a 100755 (executable)
@@ -36,6 +36,7 @@ void NotificationManager::FreeNotifyViews()
     FreeFindWatchView();
     FreelowPower();
     FreeDrinkReminderView();
+    FreeSedentaryReminderView();
 #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION
     //Do Free notification view
 #endif
diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/sedentaryReminder_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/sedentaryReminder_notification.cpp
new file mode 100644 (file)
index 0000000..92c898f
--- /dev/null
@@ -0,0 +1,200 @@
+#include "notification_manager.h"
+#include "wearable_log.h"
+#include "components/ui_button.h"
+#include "components/ui_image_view.h"
+#include "components/ui_label_ext.h"
+#include "language/font/ui_resource_string.h"
+#include <UIComponents.h>
+#include <cmsis_os2.h>
+#include <broadcast_feature.h>
+#include <service/graphic_service.h>
+#include <thread>
+#include "config/include/ConfigModel.h"
+
+namespace OHOS
+{
+
+    UIViewGroup *SedentaryReminderGroupView{nullptr};
+    UILabelExt *SedentaryReminderTitleLabel{nullptr}; // 标题: 久坐提醒
+    UIImageView *SedentaryReminderImage{nullptr};
+    UILabel *SedentaryReminderNoteLabel{nullptr}; // 久坐提醒note
+    UILabelExt *SedentaryReminderLabel{nullptr};
+    UIButton *SedentaryReminderButton{nullptr};
+
+    static constexpr const char *SedentaryReminderBUTTONVIEWID = "SedentaryReminderButton";
+
+    SedentaryReminderViewEventListener::SedentaryReminderViewEventListener()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SedentaryReminderViewEventListener::SedentaryReminderViewEventListener");
+    }
+
+    SedentaryReminderViewEventListener::~SedentaryReminderViewEventListener()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SedentaryReminderViewEventListener::~SedentaryReminderViewEventListener");
+    }
+
+    SedentaryReminderViewEventListener &SedentaryReminderViewEventListener::GetInstance()
+    {
+        static SedentaryReminderViewEventListener instance;
+        return instance;
+    }
+
+    bool SedentaryReminderViewEventListener::OnRelease(UIView &view, const ReleaseEvent &event)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SedentaryReminderViewEventListener::OnRelease");
+        UNUSED(event);
+        std::string viewId = view.GetViewId();
+        if (viewId == SedentaryReminderBUTTONVIEWID)
+        {
+            NotificationManager::GetInstance()->StopNotify();
+        }
+
+        return true;
+    }
+
+    // 是否是久坐提醒时间段内
+    bool SedentaryReminderViewEventListener::IsReminderTime()
+    {
+        // 获取当前时间
+        time_t now = time(0);
+        tm *ltm = localtime(&now);
+        int currentHour = ltm->tm_hour;
+
+        std::string ReminderTime = ConfigModel::GetInstance()->GetSedentaryReminderTime();
+        // 判断是否在提醒时间段内
+        if (ReminderTime.find(std::to_string(currentHour)) != std::string::npos)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "It's time to remind the user to move!");
+            return true;
+        }
+        return false;
+    }
+
+    /*创建久坐提醒视图*/
+    UIViewGroup *CreateSedentaryReminderView(void)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateSedentaryReminderView(void)");
+        if (SedentaryReminderGroupView == nullptr)
+        {
+            SedentaryReminderGroupView = new UIViewGroup();
+            if (SedentaryReminderGroupView == nullptr)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CreateSedentaryReminderView] SedentaryReminderGroupView new fail!!");
+                return nullptr;
+            }
+            SedentaryReminderGroupView->SetPosition(0, 0, 466, 466);
+            SedentaryReminderGroupView->SetTouchable(true);
+            SedentaryReminderGroupView->SetDraggable(true);
+            /* ------------------------- SedentaryReminderTitleLabel ------------------------ */
+            SedentaryReminderTitleLabel = new UILabelExt();
+            if (SedentaryReminderTitleLabel == nullptr)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CreateSedentaryReminderView] SedentaryReminderTitleLabel new fail!!");
+                return nullptr;
+            }
+            SedentaryReminderTitleLabel->SetPosition(83, 52, 300, 35);
+            SedentaryReminderTitleLabel->SetStyle(STYLE_TEXT_FONT, 30);
+            SedentaryReminderTitleLabel->SetStyle(STYLE_LINE_HEIGHT, 35);
+            // SedentaryReminderTitleLabel->SetText("久坐提醒");
+            SedentaryReminderTitleLabel->SetTextId(STR_SEDENTARY_REMINDER);
+            SedentaryReminderTitleLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
+            SedentaryReminderTitleLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+            SedentaryReminderTitleLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+            /* --------------------------- SedentaryReminderImage --------------------------- */
+            SedentaryReminderImage = new UIImageView();
+            if (SedentaryReminderImage == nullptr)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CreateSedentaryReminderView] SedentaryReminderImage new fail!!");
+                return nullptr;
+            }
+            SedentaryReminderImage->SetPosition(193, 130, 80, 80);
+            SedentaryReminderImage->SetSrc("/user/res/SedentaryReminder/SedentaryReminder.bin");
+            /* ------------------------- SedentaryReminderNoteLabel ------------------------- */
+            SedentaryReminderNoteLabel = new UILabel();
+            if (SedentaryReminderNoteLabel == nullptr)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CreateSedentaryReminderView] SedentaryReminderNoteLabel new fail!!");
+                return nullptr;
+            }
+            SedentaryReminderNoteLabel->SetPosition(53, 248, 360, 70);
+            SedentaryReminderNoteLabel->SetStyle(STYLE_TEXT_FONT, 30);
+            SedentaryReminderNoteLabel->SetStyle(STYLE_LINE_HEIGHT, 35);
+            SetLabelId(SedentaryReminderNoteLabel, STR_SEDENTARY_REMINDER_NOTE);
+            // UpdateLabel(SedentaryReminderNoteLabel,"1",STR_SEDENTARY_REMINDER_NOTE);
+            SedentaryReminderNoteLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
+            SedentaryReminderNoteLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+            SedentaryReminderNoteLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+            /* --------------------------- SedentaryReminderButton -------------------------- */
+            SedentaryReminderButton = new UIButton();
+            if (SedentaryReminderButton == nullptr)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CreateSedentaryReminderView] SedentaryReminderButton new fail!!");
+                return nullptr;
+            }
+            SedentaryReminderButton->SetPosition(0, 366, 466, 100);
+            SedentaryReminderButton->SetViewId(SedentaryReminderBUTTONVIEWID);
+            const char *buttonImgSrc = "/user/res/466x100button.bin";
+            SedentaryReminderButton->SetImageSrc(buttonImgSrc, buttonImgSrc);
+            SedentaryReminderButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff0b1928, UIButton::PRESSED);
+            UIView::OnTouchListener *listener = static_cast<UIView::OnTouchListener *>(&SedentaryReminderViewEventListener::GetInstance());
+            SedentaryReminderButton->SetOnTouchListener(listener);
+            /* --------------------------- SedentaryReminderLabel --------------------------- */
+            SedentaryReminderLabel = new UILabelExt();
+            if (SedentaryReminderLabel == nullptr)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CreateSedentaryReminderView] SedentaryReminderLabel new fail!!");
+                return nullptr;
+            }
+            SedentaryReminderLabel->SetPosition(133, 399, 200, 35);
+            SedentaryReminderLabel->SetStyle(STYLE_TEXT_FONT, 30);
+            SedentaryReminderLabel->SetStyle(STYLE_LINE_HEIGHT, 35);
+            // SedentaryReminderLabel->SetText("知道了");
+            SedentaryReminderLabel->SetTextId(STR_KONW);
+            SedentaryReminderLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
+            SedentaryReminderLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+            SedentaryReminderLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+            /* ----------------------------------- Add ---------------------------------- */
+            SedentaryReminderGroupView->Add(SedentaryReminderTitleLabel);
+            SedentaryReminderGroupView->Add(SedentaryReminderImage);
+            SedentaryReminderGroupView->Add(SedentaryReminderNoteLabel);
+            SedentaryReminderGroupView->Add(SedentaryReminderButton);
+            SedentaryReminderGroupView->Add(SedentaryReminderLabel);
+
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Create SedentaryReminderView succeed!!");
+        }
+
+        return SedentaryReminderGroupView;
+    }
+
+    /*释放久坐提醒视图*/
+    void FreeSedentaryReminderView(void)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FreeSedentaryReminderView(void)");
+        if (SedentaryReminderGroupView != nullptr)
+        {
+            SedentaryReminderGroupView->RemoveAll();
+
+            delete SedentaryReminderTitleLabel;
+            SedentaryReminderTitleLabel = nullptr;
+
+            delete SedentaryReminderImage;
+            SedentaryReminderImage = nullptr;
+
+            delete SedentaryReminderNoteLabel;
+            SedentaryReminderNoteLabel = nullptr;
+
+            delete SedentaryReminderButton;
+            SedentaryReminderButton = nullptr;
+
+            delete SedentaryReminderLabel;
+            SedentaryReminderLabel = nullptr;
+
+            RootView::GetInstance()->Remove(SedentaryReminderGroupView);
+            delete SedentaryReminderGroupView;
+            SedentaryReminderGroupView = nullptr;
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Free SedentaryReminderView succeed!!");
+        }
+        return;
+    }
+
+}
\ No newline at end of file
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/alarm.mp3 b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/alarm.mp3
new file mode 100644 (file)
index 0000000..106054d
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/alarm.mp3 differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/calling.mp3 b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/calling.mp3
new file mode 100644 (file)
index 0000000..f0de98f
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/calling.mp3 differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/findwatch.mp3 b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/findwatch.mp3
new file mode 100644 (file)
index 0000000..2b0a830
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/findwatch.mp3 differ