// 达到最高心率进行心率提醒弹窗
if (sportdata->heart >= ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_TRAINING_HEART_MAX))
{
- uapi_set_screen_on_api(); // 亮屏检测
- custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO);
+ uapi_set_screen_on_api(); // 亮屏检测
+ custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); // 震动提醒
TraingCardView::GetInstance()->SetPopupViewStatus(HeartPopup, true);
}
// sportdata->duration = cyweeInfo->duration;
return 2;\r
}\r
\r
-\r
int uid_t = 0;\r
int appid_t = 0;\r
int hasCode_t = 0;\r
title_c->valuestring[len++] = '.';\r
title_c->valuestring[len++] = 0;\r
}\r
- \r
memcpy(titleBuf,(uint8_t *)title_c->valuestring,len);\r
}\r
cJSON* msg = cJSON_GetObjectItem(root, "msg");\r
value[17] = 1;\r
value[18] = Calculate_CRC(value,18);\r
sendBleData(value,19);\r
+ CustomEventPublish(TOPIC_EVENT_MESSAGENOTE,&data,1);\r
}else{\r
value[17] = 0;\r
value[18] = Calculate_CRC(value,18);\r
}
}
+//消息通知
+void MsgCenterNotifyMessageProc(const Topic topic, Request* req)
+{
+ unused(topic);
+ unused(req);
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyMessageProc !");
+ //亮屏显示新信息弹窗
+ 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();
+ }
+ display_api->set_screen_set_keepon_timeout(1000*5);
+ NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
+ NotificationManager::GetInstance()->ShowNotify(showMessageNotify, (uint16_t)topic, true);
+}
#endif
NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
NotificationManager::GetInstance()->ShowNotify(showDrinkReminderNotify, (uint16_t)topic, true);
}
-//消息通知
-void MsgCenterNotifyMessageProc(const Topic topic, Request* req)
-{
- unused(topic);
- unused(req);
- WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyMessageProc !");
- NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
- NotificationManager::GetInstance()->ShowNotify(showMessageNotify, (uint16_t)topic, true);
-}
+
void MsgCenterNotifyActivityProc(const Topic topic, Request* req)
{
unused(topic);
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);
if(cywee_Inactivity_Info->sedentary_status==9)
set_stand_falg();
}
-
-
static int interval = 0;//久坐间隔时间
switch (cywee_Inactivity_Info->output_number)
{
#include "message/include/MessageModel.h"
#include "message_notification.h"
#include "string"
+#include "vibrator_service.h"
+extern "C" void custom_VibratorFunc(OHOS::VibratorType vibratorType);
+
namespace OHOS
{
messageLabel->SetText(messageStr.c_str());
messageLabel->SetTextColor(Color::Gray());
messageLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
- timeLabel->SetLineBreakMode(UILabel::LINE_BREAK_CLIP);
+ messageLabel->SetLineBreakMode(UILabel::LINE_BREAK_CLIP); // 换行裁剪
+ messageLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); // 居中显示
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "messageLabel is ok");
/*加载清除按键*/
MessageGroupView->Add(deleteButton);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Create MessageGroupView succeed!!");
-
+ // 震动提醒
+ custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO);
return MessageGroupView;
}
/*释放消息弹窗视图*/