#define DELETEBUTTON "delete_button"
MessageViewEventListener::MessageViewEventListener() {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"MessageViewEventListener::MessageViewEventListener");
}
MessageViewEventListener::~MessageViewEventListener() {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"MessageViewEventListener::~MessageViewEventListener");
}
}
bool MessageViewEventListener::OnRelease(UIView &view,
const ReleaseEvent &event) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MessageViewEventListener::OnRelease");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MessageViewEventListener::OnRelease");
UNUSED(event);
if (strcmp(view.GetViewId(), DELETEBUTTON) == 0) {
NotificationManager::GetInstance()->StopNotify();
return true;
}
bool MessageViewEventListener::OnDrag(UIView &view, const DragEvent &event) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MessageViewEventListener::OnDrag");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MessageViewEventListener::OnDrag");
UNUSED(view);
NotificationManager::GetInstance()->StopNotify();
// 点击关闭之后通知list进行刷新
}
bool MessageViewEventListener::OnDragEnd(UIView &view, const DragEvent &event) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MessageViewEventListener::OnDragEnd");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MessageViewEventListener::OnDragEnd");
if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) {
NotificationManager::GetInstance()->StopNotify();
}
/*创建信息弹窗*/
UIViewGroup *CreateMessageView(void) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateMessageView");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CreateMessageView");
if (MessageGroupView == nullptr) {
MessageGroupView = new UIViewGroup();
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"[CreateMessageView] MessageGroupView new %p",
MessageGroupView);
if (MessageGroupView == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"[CreateMessageView] MessageGroupView new fail!!");
return nullptr;
}
static_cast<UIView::OnDragListener *>(
&MessageViewEventListener::GetInstance());
if (dragListener == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"[CreateMessageView] dragListener new fail!!");
return nullptr;
}
messageStr = "--";
}
/*初始化label*/
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitView");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "InitView");
/* --------------------------------------------------------------------------*/
if (titleLabel == nullptr) {
titleLabel = new UILabel();
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "titleLabel:: new UILabel %p",
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "titleLabel:: new UILabel %p",
titleLabel);
if (titleLabel == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "titleLabel:: new UILabel fail");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "titleLabel:: new UILabel fail");
return nullptr; // 内存分配失败,返回
}
titleLabel->SetPosition(83, 60, 300, 35);
titleLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
titleLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
titleLabel->SetVisible(true);
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "titleLabel is ok!");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "titleLabel is ok!");
}
/* --------------------------------------------------------------------------
*/
if (timeLabel == nullptr) {
timeLabel = new UILabel();
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "timeLabel:: new UILabel %p",
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "timeLabel:: new UILabel %p",
timeLabel);
if (timeLabel == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "timeLabel:: new UILabel fail");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "timeLabel:: new UILabel fail");
return nullptr; // 内存分配失败,返回
}
timeLabel->SetPosition(73, 104, 320, 33);
timeLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS);
timeLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
timeLabel->SetVisible(true);
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "timeLabel is ok!");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "timeLabel is ok!");
}
/* --------------------------------------------------------------------------
*/
/*初始化消息内容*/
if (messageLabel == nullptr) {
messageLabel = new UILabel();
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "messageLabel:: new UILabel %p",
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "messageLabel:: new UILabel %p",
messageLabel);
if (messageLabel == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "messageLabel:: new UILabel fail");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "messageLabel:: new UILabel fail");
return nullptr; // 内存分配失败,返回
}
messageLabel->SetPosition(53, 170, 360, 144);
messageLabel->SetLineBreakMode(UILabel::LINE_BREAK_CLIP); // 换行裁剪
messageLabel->SetAlign(TEXT_ALIGNMENT_CENTER,
TEXT_ALIGNMENT_CENTER); // 居中显示
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "messageLabel is ok");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "messageLabel is ok");
}
/*加载清除按键*/
if (deleteButton == nullptr) {
deleteButton = new UILabelButtonExt();
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"deleteButton:: new UILabelButtonExt %p", deleteButton);
if (deleteButton == nullptr) {
static_cast<UIView::OnTouchListener *>(
&MessageViewEventListener::GetInstance());
if (TouchListener == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"[CreateMessageView] TouchListener new fail!!");
return nullptr;
}
deleteButton->SetOnTouchListener(TouchListener);
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "deleteButton");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "deleteButton");
}
/* --------------------------------------------------------------------------
*/
MessageViewEventListener::GetInstance()
.Message_StartTimer(); // 开启一个3s后弹窗自动销毁定时器
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Create MessageGroupView succeed!!");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Create MessageGroupView succeed!!");
NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeMessageView);
return MessageGroupView;
}
/*释放消息弹窗视图*/
void FreeMessageView(void) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FreeMessageView(void)");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "FreeMessageView(void)");
// //销毁定时器
MessageViewEventListener::GetInstance().Message_StopTimer();
if (MessageGroupView != nullptr) {
MessageGroupView->RemoveAll();
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "titleLabel %p", titleLabel);
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "titleLabel %p", titleLabel);
delete titleLabel;
titleLabel = nullptr;
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "timeLabel %p", timeLabel);
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "timeLabel %p", timeLabel);
delete timeLabel;
timeLabel = nullptr;
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "messageLabel %p", messageLabel);
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "messageLabel %p", messageLabel);
delete messageLabel;
messageLabel = nullptr;
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "deleteButton %p", deleteButton);
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "deleteButton %p", deleteButton);
delete deleteButton;
deleteButton = nullptr;
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MessageGroupView %p",
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MessageGroupView %p",
MessageGroupView);
delete MessageGroupView;
MessageGroupView = nullptr;
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Free MessageView succeed!!");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Free MessageView succeed!!");
}
ScreenTurnOff();
return;
/*定时器到期时的处理*/
static void Message_TimerCallbackProc(int data) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Message_TimerCallbackProc");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Message_TimerCallbackProc");
NotificationManager::GetInstance()->StopNotify();
// 点击关闭之后通知list进行刷新
SendMsgToUIService(UI_UPDATE_MESSAGE_DATA, 0, nullptr, 0);
* @param interval 时间间隔,单位ms
*/
void MessageViewEventListener::Message_StartTimer(uint32_t interval) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"MessageViewEventListener::Message_StartTimer");
/* -------------------------- 1.检查定时器是否已经存在,如果存在则返回
* ------------------------- */
if (g_timer != NULL) {
- WEARABLE_LOGE(
+ WEARABLE_LOGD(
WEARABLE_LOG_MODULE_APP,
"CountDownModel::CountDown_StartTimer Timer already exists!!");
return;
osTimerNew((osTimerFunc_t)Message_TimerCallback, osTimerOnce, NULL, NULL);
// 检查定时器创建是否成功
if (g_timer == NULL) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"CountDownModel::CountDown_StartTimer Timer create failed!!");
return;
}
/* -------------------- 5.检查定时器启动是否成功,如果启动失败,删除定时器并置为
* NULL -------------------- */
if (ret != osOK) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"[CountDown_StartTimer] osTimerDelete failed, ret = %lx!!",
ret);
if (g_timer != NULL) {
void MessageViewEventListener::Message_StopTimer(void) {
// 检查定时器是否存在
if (g_timer != NULL) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"MessageViewEventListener::Message_StopTimer");
osTimerStop(g_timer);
// 删除定时器并置为 NULL
osStatus_t ret = osTimerDelete(g_timer);
if (ret != osOK) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
"osTimerDelete failed, ret = %lx!!", ret);
}
g_timer = NULL;