From 221c7b6c1f25d91cebdf0db75abbba374ec83d42 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 25 Jun 2025 14:50:29 +0800 Subject: [PATCH] =?utf8?q?=E7=9B=AE=E6=A0=87=E5=BC=B9=E7=AA=97=E4=BB=A3?= =?utf8?q?=E7=A0=81=E5=90=88=E5=B9=B6=EF=BC=8C=E5=BE=85=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../broadcast/src/broadcast_implement.c | 1 + .../fd230/service/msg_center/CMakeLists.txt | 2 + .../include/notify/goal_notification.h | 64 +++ .../msg_center/src/msg_center_customer.cpp | 35 +- .../src/notify/goal_notification.cpp | 462 ++++++++++++++++++ 5 files changed, 562 insertions(+), 2 deletions(-) create mode 100644 code/sdk/application/wearable/fd230/service/msg_center/include/notify/goal_notification.h create mode 100644 code/sdk/application/wearable/fd230/service/msg_center/src/notify/goal_notification.cpp diff --git a/code/sdk/application/wearable/fd230/service/broadcast/src/broadcast_implement.c b/code/sdk/application/wearable/fd230/service/broadcast/src/broadcast_implement.c index 487ff8aee..6188dcf3c 100644 --- a/code/sdk/application/wearable/fd230/service/broadcast/src/broadcast_implement.c +++ b/code/sdk/application/wearable/fd230/service/broadcast/src/broadcast_implement.c @@ -41,6 +41,7 @@ static const TopicToCore topicToCoreArray[] = { {TOPIC_EVENT_INACTIVITY_UPDATE, 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,其对应的位图 */ diff --git a/code/sdk/application/wearable/fd230/service/msg_center/CMakeLists.txt b/code/sdk/application/wearable/fd230/service/msg_center/CMakeLists.txt index 39c03d13f..cb8a7ccdb 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230/service/msg_center/CMakeLists.txt @@ -165,6 +165,7 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/debug_output_notification/debug_output_notification_itemview.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/debug_output_notification/debug_output_notification.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/message_notification.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/goal_notification.cpp ) else() set(SOURCES @@ -184,6 +185,7 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/debug_output_notification/debug_output_notification_itemview.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/debug_output_notification/debug_output_notification.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/message_notification.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/goal_notification.cpp ) endif() diff --git a/code/sdk/application/wearable/fd230/service/msg_center/include/notify/goal_notification.h b/code/sdk/application/wearable/fd230/service/msg_center/include/notify/goal_notification.h new file mode 100644 index 000000000..84518a114 --- /dev/null +++ b/code/sdk/application/wearable/fd230/service/msg_center/include/notify/goal_notification.h @@ -0,0 +1,64 @@ +#ifndef GOAL_NOTIFICATION_H +#define GOAL_NOTIFICATION_H + +namespace OHOS +{ + + typedef enum GOAL_type + { + GOAL_STEP = 1, + + GOAL_CALOREIE, + GOAL_STAND, + GOAL_FAT, + GOAL_DISTANCE, + + GOAL_free, + } transmitting_type; + + UIViewGroup *GoalviewShow(void); + void set_goal_flag_view(uint8_t falg); + + uint8_t get_Is_show_flag(uint8_t type); + + uint8_t set_Is_show_flag(uint8_t flag, uint8_t type); + + class GoalViewEventListener : public OHOS::UIView::OnClickListener, + public OHOS::UIView::OnLongPressListener, + public OHOS::UIView::OnTouchListener, + public OHOS::UIView::OnDragListener + { + public: + GoalViewEventListener(); + virtual ~GoalViewEventListener(); + static GoalViewEventListener *GetInstance(void); + + bool OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override + { + return true; + } + bool OnDragEnd(OHOS::UIView &view, const OHOS::DragEvent &event) override + { + return true; + } + virtual bool OnPress(OHOS::UIView &view, const OHOS::PressEvent &event) override + { + return true; + } + virtual bool OnLongPress(OHOS::UIView &view, const OHOS::LongPressEvent &event) override + { + return true; + } + virtual bool OnRelease(OHOS::UIView &view, const OHOS::ReleaseEvent &event) override + { + return true; + } + + virtual bool OnDragStart(OHOS::UIView &view, const OHOS::DragEvent &event) override + { + return true; + } + }; +}; +#endif /* CHARGE_NOTIFICATION_H */ \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp index d4942b59f..261eaab19 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp @@ -55,6 +55,7 @@ #include "testchangingC.h" #include "custom_runtime.h" #include "message_notification.h" +#include "goal_notification.h" #ifdef SUPPORT_POWER_MANAGER #include "power_display_service.h" @@ -88,8 +89,9 @@ const PriorityMapper PRI_MAPPER[] = { {TOPIC_EVENT_AR_ALERT_TYPE_UPDATE, PRIORITY_TWO}, {TOPIC_EVENT_INACTIVITY_UPDATE, PRIORITY_TWO}, // #endif - {TOPIC_EVENT_FIND_WATCH,PRIORITY_TWO}, // 查找找手表 - {TOPIC_EVENT_DEBUGOUTPUT,PRIORITY_ONE},//开发调试专用窗口 + {TOPIC_EVENT_FIND_WATCH,PRIORITY_TWO}, // 查找找手表 + {TOPIC_EVENT_DEBUGOUTPUT,PRIORITY_ONE}, //开发调试专用窗口 + {TOPIC_EVENT_GOAL_SHOW_VIEW,PRIORITY_TWO}, // 训练目标弹窗 }; @@ -137,6 +139,7 @@ void MsgCenterSubscribe() // #endif MsgCenterSubscribeTopic(TOPIC_EVENT_FIND_WATCH); MsgCenterSubscribeTopic(TOPIC_EVENT_DEBUGOUTPUT); + MsgCenterSubscribeTopic(TOPIC_EVENT_GOAL_SHOW_VIEW); } @@ -220,6 +223,10 @@ static OHOS::UIViewGroup* showDebugOutputNotify(void) static OHOS::UIViewGroup *showMessageNotify(void) { return OHOS::CreateMessageView(); } +static OHOS::UIViewGroup* ShowGoalNotify(void) +{ + return OHOS::GoalviewShow(); +} void MsgCenterNotifyAlarmProc(const Topic topic, Request* req) { @@ -654,6 +661,29 @@ void MsgCenterNotifyDebugOutProc(const Topic topic, Request *req) NotificationManager::GetInstance()->ShowNotify(showDebugOutputNotify, (uint16_t)topic, true); } } +void MsgCenterNotifyGoalShowViewProc(const Topic topic, Request* req) +{ + unused(req); + if (CheckPriority(topic)) + { + uint8_t* data=(uint8_t*)req->data; + if(get_Is_show_flag(data[0])) + { + set_goal_flag_view(data[0]); + set_Is_show_flag(0,data[0]); + + const power_display_svr_api_t *display_api = power_display_svr_get_api(); + + if (display_api->get_screen_state() != SCREEN_ON) + { + display_api->turn_on_screen(); + } + + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(ShowGoalNotify, static_cast(topic), true); + } + } +} #endif /* 订阅事件通知逻辑可定制 */ @@ -679,6 +709,7 @@ static MsgCenterNotifyTable g_msgCenterNotifyTable[] = { // #endif {TOPIC_EVENT_FIND_WATCH,MsgCenterNotifyFindWatchProc}, {TOPIC_EVENT_DEBUGOUTPUT,MsgCenterNotifyDebugOutProc}, + {TOPIC_EVENT_GOAL_SHOW_VIEW,MsgCenterNotifyGoalShowViewProc}, // {TOPIC_EVENT_DEVICE_UNBIND, MsgCenterNotifyDeviceUnBindProc}, // {TOPIC_EVENT_DEVICE_UNBINDING_REQUEST, MsgCenterNotifyDeviceUnBindingRequestProc}, diff --git a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/goal_notification.cpp b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/goal_notification.cpp new file mode 100644 index 000000000..ae03651b9 --- /dev/null +++ b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/goal_notification.cpp @@ -0,0 +1,462 @@ + +#include "components/ui_view_group.h" +#include "notification_manager.h" +#include "wearable_log.h" +#include "UiConfig.h" +#include "AlarmPopUpPresenter.h" +#include "components/ui_image_view.h" +#include "components/ui_label.h" +#include "components/ui_label_ext.h" +#include "components/ui_label_button_ext.h" +#include "osal_timer.h" +#include "cmsis_os2.h" +#include "NativeAbility.h" +#include "custom_utils.h" +#include "components/ui_slider.h" +#include "power_display_service.h" +#include "goal_notification.h" +#include "ui_resource_string.h" +#include "traing/Training_UiConfig.h" + +#include "ConfigModel.h" +#include "uicomponents/UIComponents.h" +#include "battery_service.h" +#include "upg.h" +#include "custom_runtime.h" +#include "vibrator/service/vibrator_service.h" +#ifdef SUPPORT_BLE_SERVICE +/#include "bleEvent.h" +#endif +namespace OHOS +{ + +#define BUTTONWINOK "buttom_win" + + static UIScrollView *getView{nullptr}; + + /*达成训练目标弹窗*/ + static UILabelExt *labeltitle = nullptr; + + static UILabelExt *labelgettag = nullptr; + static UILabelExt *labeltag = nullptr; + static UILabelExt *labelpre = nullptr; + static UILabelButtonExt *buttonok_ = nullptr; + static UIImageAnimatorView *imageAnimator{nullptr}; + static const ImageInfo **winimageInfos{nullptr}; + static ImageAnimatorInfo *winimageAnimatorInfo{nullptr}; + static std::string winbasePath = "/user/res/Training/training_GIF/win/"; + + static osTimerId_t GoalviewShow_timer = NULL; + + void Freegoalview(void) + { + if (getView != nullptr) + { + getView->RemoveAll(); + + if (labeltag) + { + delete labeltag; + labeltag = nullptr; + } + + if (labeltitle) + { + delete labeltitle; + labeltitle = nullptr; + } + if (labelpre) + { + delete labelpre; + labelpre = nullptr; + } + if (buttonok_) + { + delete buttonok_; + buttonok_ = nullptr; + } + if (imageAnimator) + { + imageAnimator->Stop(); + FreeImageInfoArray(winimageInfos, winbasePath.c_str(), 94); + delete imageAnimator; + imageAnimator = nullptr; + + delete[] winimageAnimatorInfo; + winimageAnimatorInfo = nullptr; + } + if (labelgettag) + { + + delete labelgettag; + labelgettag = nullptr; + } + + if (GoalviewShow_timer) + { + osTimerStop(GoalviewShow_timer); + osStatus_t ret = osTimerDelete(GoalviewShow_timer); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Disatransmitting_timer failed ret = %lx!", ret); + // return; + } + GoalviewShow_timer = nullptr; + } + + RootView::GetInstance()->Remove(getView); + + delete getView; + getView = nullptr; + } + } + static uint8_t flag_goal = 0; + + static uint8_t GOAL_CALOREIE_falg = 1; + + static uint8_t GOAL_FAT_falg = 1; + + static uint8_t GOAL_STAND_falg = 1; + + static uint8_t GOAL_DISTANCE_falg = 1; + + static uint8_t GOAL_STEP_falg = 1; + + // static uint8_t set_last_show_time(uint8_t type) + // { + + // switch (type) { + // case GOAL_CALOREIE: + // ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES); + // break; + // case GOAL_FAT: + // ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION); + // break; + // case GOAL_STAND: + // ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES); + // break; + // case GOAL_DISTANCE: + // ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE); + // break; + // case GOAL_STEP: + // ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT);; + // break; + // default: + // break; + // } + // } + + // static uint8_t get_last_show_time(uint8_t type) + // { + // uint32_t tagType =flag_goal; + // switch (tagType) { + // case GOAL_CALOREIE: + // tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES); + // tagString=std::to_string(tag)+"kcal"; + // break; + // case GOAL_FAT: + // tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION); + // tagString=std::to_string(tag)+"min"; + // break; + // case GOAL_STAND: + // tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES); + // tagString=std::to_string(tag)+"times"; + // break; + // case GOAL_DISTANCE: + // tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE); + // tagString=std::to_string(tag)+"km"; + // break; + // case GOAL_STEP: + // tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT);; + // tagString=std::to_string(tag)+"steps"; + // break; + // default: + // break; + // } + // } + + uint8_t get_Is_show_flag(uint8_t type) + { + switch (type) + { + case GOAL_CALOREIE: + + return GOAL_CALOREIE_falg; + + case GOAL_FAT: + return GOAL_FAT_falg; + + case GOAL_STAND: + return GOAL_STAND_falg; + + case GOAL_DISTANCE: + return GOAL_DISTANCE_falg; + + case GOAL_STEP: + return GOAL_STEP_falg; + + default: + return 0; + } + } + + uint8_t set_Is_show_flag(uint8_t flag, uint8_t type) + { + switch (type) + { + case GOAL_CALOREIE: + + GOAL_CALOREIE_falg = flag; + ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES_TIME, flag); + break; + + case GOAL_FAT: + GOAL_FAT_falg = flag; + ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION_TIME, flag); + break; + + case GOAL_STAND: + GOAL_STAND_falg = flag; + ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES_TIME, flag); + break; + + case GOAL_DISTANCE: + GOAL_DISTANCE_falg = flag; + ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE_TIME, flag); + break; + + case GOAL_STEP: + GOAL_STEP_falg = flag; + ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT_TIME, flag); + break; + + default: + return 0; + } + return 1; + } + + void set_goal_flag_view(uint8_t falg) + { + flag_goal = falg; + } + + static void InitImageAnimator() + { + + int tag = 0; + uint8_t tagType = flag_goal; + std::string tagString; + + switch (tagType) + { + case GOAL_CALOREIE: + tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES); + tagString = std::to_string(tag) + "kcal"; + break; + case GOAL_FAT: + tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION); + tagString = std::to_string(tag) + "min"; + break; + case GOAL_STAND: + tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES); + tagString = std::to_string(tag) + "times"; + break; + case GOAL_DISTANCE: + tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE); + tagString = std::to_string(tag) + "km"; + break; + case GOAL_STEP: + tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT); + ; + tagString = std::to_string(tag) + "steps"; + break; + default: + break; + } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, + "tag[%d]-tagType[%d]-tagString[%s]\r\n", tag, tagType, + tagString.c_str()); + InitLabel(labeltag, 70, 215, 326, 97, "label2", tagString.c_str(), + DEFAULT_VECTOR_FONT_FILENAME, 80); + labeltag->SetTextColor(Color::GetColorFromRGBA(0x4f, 0xc3, 0x4c, 0xff)); + labeltag->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + getView->Add(labeltag); + + // 初始化图片数组以及动画 + winimageInfos = CreateImageInfoArray(winbasePath.c_str(), 94); + winimageAnimatorInfo = new ImageAnimatorInfo[94]; + InitImageAnimatorSource(imageAnimator, winimageAnimatorInfo, winimageInfos, + 94, 173, 100, 120, 120, "imageAnimator1", 10); + imageAnimator->Start(); + getView->Add(imageAnimator); + } + + static uint8_t GoalviewShowCallBack_FALG = 0; + + static void GoalviewShowCallBack(int data) + { + GoalviewShowCallBack_FALG--; + if (GoalviewShowCallBack_FALG >= 7) + { + if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get())) + { + ui_api_vibrate_once_func(); + } + } + if (GoalviewShowCallBack_FALG == 0) + { + + NotificationManager::GetInstance()->StopNotify(); + + // if(GoalviewShow_timer) + // { + // osTimerStop(GoalviewShow_timer); + // osStatus_t ret = osTimerDelete(GoalviewShow_timer); + // if (ret != osOK) { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Disatransmitting_timer failed ret = %lx!", ret); + // return; + // } + // GoalviewShow_timer = nullptr; + // } + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "hintdialtimerCallBack ??????!"); + } + + UIViewGroup *GoalviewShow() + { + // 震动3次 + + if (GoalviewShow_timer) + { + osTimerStop(GoalviewShow_timer); + osStatus_t ret = osTimerDelete(GoalviewShow_timer); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Disatransmitting_timer failed ret = %lx!", ret); + return NULL; + } + GoalviewShow_timer = nullptr; + } + + uint32_t tick; + osStatus_t retTimer; + GoalviewShowCallBack_FALG = 10; + GoalviewShow_timer = osTimerNew((osTimerFunc_t)GoalviewShowCallBack, osTimerPeriodic, NULL, NULL); + tick = osMs2Tick(1000); // osMs2Tick(1000); + retTimer = osTimerStart(GoalviewShow_timer, tick); + if (retTimer != osOK && GoalviewShow_timer != NULL) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartCallTimer osTimerStart failed, ret = %lx!!", retTimer); + osTimerDelete(GoalviewShow_timer); + GoalviewShow_timer = NULL; + return NULL; + } + + if (getView == nullptr) + { + getView = new UIScrollView(); + getView->SetPosition(0, 0); + getView->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); + getView->SetScrollBlankSize(20); + getView->SetReboundSize(50); + getView->SetDirection(1); + + UIView::OnClickListener *button1Click = static_cast(GoalViewEventListener::GetInstance()); + getView->SetOnClickListener(button1Click); + getView->SetTouchable(true); + + // 初始化Lable + // InitRollLabel(labeltitle, 83, 50, 300, 35, "label1", STR_GOAL_ACHIEVED, DEFAULT_VECTOR_FONT_FILENAME, 35); + // TODO:多国语言 + InitLabelExt(labeltitle, 83, 50, 300, 35, "label3", + STR_GOAL_DOWN, DEFAULT_VECTOR_FONT_FILENAME_EN, + 35); + labeltitle->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + labeltitle->SetRollSpeed(23); + getView->Add(labeltitle); + InitRollLabel(labelgettag, 103, 307, 200, 35, "label3", STR_ACCOMPLISH_GOAL, + DEFAULT_VECTOR_FONT_FILENAME, 30); + getView->Add(labelgettag); + InitLabel(labelpre, 233, 307, 160, 35, "label3", "100%", + DEFAULT_VECTOR_FONT_FILENAME, 30); + getView->Add(labelpre); + + // 初始化按键 + InitButtonExt(buttonok_, 0, 366, 466, 100, BUTTONWINOK, STR_OK, 30); + buttonok_->SetImageSrc(BUTTONOK_IMAGE, BUTTONOK_IMAGE); + getView->Add(buttonok_); + + RootView::GetInstance()->Add(getView); + + getView->SetDraggable(false); + getView->SetTouchable(true); + NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(Freegoalview); + + InitImageAnimator(); + } + else + { + uint8_t tagType = flag_goal; + std::string tagString; + uint32_t tag = 0; + switch (tagType) + { + case GOAL_CALOREIE: + tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES); + tagString = std::to_string(tag) + "kcal"; + break; + case GOAL_FAT: + tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION); + tagString = std::to_string(tag) + "minute"; + break; + case GOAL_STAND: + tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES); + tagString = std::to_string(tag) + "times"; + break; + case GOAL_DISTANCE: + tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE); + tagString = std::to_string(tag) + "km"; + break; + case GOAL_STEP: + tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT); + ; + tagString = std::to_string(tag) + "steps"; + break; + default: + break; + } + labeltag->SetText(tagString.c_str()); + labeltag->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + getView->Invalidate(); + } + return getView; + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShowGetTagView end"); + } + + GoalViewEventListener::GoalViewEventListener() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CallViewEventListener :%p", this); + } + + GoalViewEventListener::~GoalViewEventListener() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "~CallViewEventListener"); + } + + GoalViewEventListener *GoalViewEventListener::GetInstance(void) + { + static GoalViewEventListener lowppowrViewEventListene_t; + return &lowppowrViewEventListene_t; + } + + bool GoalViewEventListener::OnClick(UIView &view, const ClickEvent &event) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick"); + NotificationManager::GetInstance()->StopNotify(); + return true; + UNUSED(event); + } + +} -- 2.17.1