From: 罗正 <1732036298@qq.com> Date: Sat, 25 May 2024 08:06:30 +0000 (+0000) Subject: Merge #181 into xts_origin from refs/changes/181/head X-Git-Tag: release_V1.2.70_20241020_135402~1106^2 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=refs%2Fchanges%2F183%2Ftarget%2F1;p=mirrors%2FFD230.git Merge #181 into xts_origin from refs/changes/181/head 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 'xts_origin' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into xts_origin Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/181 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h b/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h index 5bcef9c05..37c61ca0b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h @@ -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; // 禁止拷贝构造 diff --git a/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp index 3c118ed36..a653c5982 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp @@ -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) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp index dc1b19129..d8a17b8dd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp @@ -804,7 +804,7 @@ namespace OHOS void PullUpDownView::RefreshData() { PRINT("RefreshData Begin!\n"); - // 获取当前时间 + // 解析日期信息 char *dateStr = (char *)malloc(9); if (uapi_get_YYMMDD_Time(dateStr, '/') != ERRCODE_SUCC) { @@ -812,7 +812,7 @@ namespace OHOS free(dateStr); return; } - // 解析日期信息 + // 获取当前时间 char *timeStr = (char *)malloc(9); if (uapi_get_HHMMSS_Time(timeStr, ':', false) != ERRCODE_SUCC) { diff --git a/code/sdk/application/wearable/service/msg_center/CMakeLists.txt b/code/sdk/application/wearable/service/msg_center/CMakeLists.txt index 65d88b4ec..35ea3b881 100755 --- a/code/sdk/application/wearable/service/msg_center/CMakeLists.txt +++ b/code/sdk/application/wearable/service/msg_center/CMakeLists.txt @@ -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() diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/findwatch_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/findwatch_notification.h index 9b931bb7a..c946c5726 100644 --- a/code/sdk/application/wearable/service/msg_center/include/notify/findwatch_notification.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/findwatch_notification.h @@ -89,7 +89,7 @@ namespace OHOS std::shared_ptr playerInterruptListener{nullptr}; AudioSession sessionId; AudioInterrupt interrupt; - char *RingMusicName = "alarm.mp3"; + char *RingMusicName = "findwatch.mp3"; bool FindWatchNotifyFlag{false}; // 判断是查找手表, 由notify生成界面 }; } diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h b/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h index 2aa2ddd3c..fc7f11631 100755 --- a/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h @@ -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 index 000000000..e808751b2 --- /dev/null +++ b/code/sdk/application/wearable/service/msg_center/include/notify/sedentaryReminder_notification.h @@ -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 diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 31b13a5a9..c068f7a1c 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -44,6 +44,7 @@ //#include "TraingCardPresenter.h" #include "custom_runtime.h" #include "producttest/include/testcat1.h" +#include //#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) { diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp index 31657ab2b..0302310a6 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp @@ -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; diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp index 3eb3796c5..3298f9ad8 100755 --- a/code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp @@ -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 index 000000000..92c898fd9 --- /dev/null +++ b/code/sdk/application/wearable/service/msg_center/src/notify/sedentaryReminder_notification.cpp @@ -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 +#include +#include +#include +#include +#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(&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 index 000000000..106054d42 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 index 000000000..f0de98f2d 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 index 000000000..2b0a83095 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ring/findwatch.mp3 differ