Revert "增加信息弹窗,未完善" 340/1 340/head 341/target/1
authorSnickerSun <snickersun@163.com>
Thu, 20 Jun 2024 14:43:33 +0000 (22:43 +0800)
committerSnickerSun <snickersun@163.com>
Thu, 20 Jun 2024 14:43:33 +0000 (22:43 +0800)
This reverts commit 00e364d062b7964fa669752758e14d0a4328183d.

code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h
code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c
code/sdk/application/wearable/service/msg_center/CMakeLists.txt
code/sdk/application/wearable/service/msg_center/include/notify/message_notification.h [deleted file]
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/message_notification.cpp [deleted file]

index 7f0757d..1c94cd4 100644 (file)
@@ -87,7 +87,6 @@ typedef enum {
     TOPIC_EVENT_FIND_WATCH, //查找手表
     TOPIC_EVENT_CANCEL_FIND_WATCH,//取消查找
     TOPIC_EVENT_DRINKREMINDER,//喝水提醒
-    TOPIC_EVENT_MESSAGENOTE, //消息通知
     TOPIC_END_NUM = 20000,
 } TopicNum;
 
index c8194eb..a9e5925 100644 (file)
@@ -65,7 +65,6 @@ static const TopicToCore topicToCoreArray[] = {
     {TOPIC_EVENT_FIND_WATCH,A_CORE_MASK, 1},//查找手表
     {TOPIC_EVENT_CANCEL_FIND_WATCH,A_CORE_MASK, 1},
     {TOPIC_EVENT_DRINKREMINDER,A_CORE_MASK, 1},
-    {TOPIC_EVENT_MESSAGENOTE,A_CORE_MASK, 1},
 #ifdef SUPPORT_CAT1_MODEM
     {TOPIC_EVENT_CAT1_INCOMMING, A_CORE_MASK, 1},
     {TOPIC_EVENT_CAT1_CALLCONNTED, A_CORE_MASK, 1},
index 0fe23e2..a58b970 100644 (file)
@@ -166,7 +166,6 @@ set(SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/drinkReminder_notification.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/sedentaryReminder_notification.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/transmitting.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/message_notification.cpp
 )
 else()
 set(SOURCES
@@ -181,7 +180,6 @@ set(SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/drinkReminder_notification.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/sedentaryReminder_notification.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/transmitting.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/message_notification.cpp
 )
 endif()
 
diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/message_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/message_notification.h
deleted file mode 100644 (file)
index 977cc2c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*** 
- * @Date: 2024-06-20 09:43:23
- * @LastEditors: Caisking 3449750381@qq.com
- * @LastEditTime: 2024-06-20 09:47:45
- * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/service/msg_center/include/notify/message_notification.h
- */
-#ifndef MESSAGE_NOTIFICATION
-#define MESSAGE_NOTIFICATION
-
-#include "BaseView.h"
-namespace OHOS
-{
-    UIViewGroup *CreateMessageView(void);
-    void FreeMessageView(void);
-
-    class MessageViewEventListener : public UIView::OnTouchListener,public UIView::OnDragListener
-    {
-    public:
-        static MessageViewEventListener &GetInstance();
-        bool OnRelease(UIView &view, const ReleaseEvent &event) override;
-        bool OnDrag(UIView& view, const DragEvent& event) override;
-        bool OnDragEnd(UIView& view, const DragEvent& event) override;
-
-    private:
-        MessageViewEventListener();
-        ~MessageViewEventListener();
-        MessageViewEventListener(const MessageViewEventListener &) = delete;
-        const MessageViewEventListener &operator=(const MessageViewEventListener &) = delete;
-        bool X_DRAG_FLAG{false};
-
-    };
-
-}
-
-#endif
\ No newline at end of file
index 09a47e6..5a65e5f 100644 (file)
@@ -29,7 +29,6 @@
 #include "power_display_service.h"
 #include "cat1_server.h"
 #include "testchanging.h"
-#include "message_notification.h"
 #include "testcat1.h" 
 #include "testold.h"
 #include "testhrsenson.h" 
@@ -78,6 +77,7 @@ const PriorityMapper PRI_MAPPER[] = {
     {TOPIC_EVENT_HFP_WATCH_ACTIVE, PRIORITY_ONE},
     {TOPIC_EVENT_HFP_WATCH_TO_PHONE, PRIORITY_ONE},
     {TOPIC_EVENT_HFP_PHONE_TO_WATCH, PRIORITY_ONE},
+
 #ifdef SUPPORT_CAT1_MODEM
     {TOPIC_EVENT_CAT1_INCOMMING, PRIORITY_ONE},
     {TOPIC_EVENT_CAT1_CALLCONNTED, PRIORITY_ONE},
@@ -105,7 +105,6 @@ const PriorityMapper PRI_MAPPER[] = {
     {TOPIC_EVENT_FIND_WATCH,PRIORITY_TWO},
     {TOPIC_EVENT_CANCEL_FIND_WATCH,PRIORITY_TWO},
     {TOPIC_EVENT_DRINKREMINDER,PRIORITY_TWO},
-    {TOPIC_EVENT_MESSAGENOTE,PRIORITY_TWO},
 };
 
 static bool CheckPriority(const Topic topic)
@@ -178,7 +177,6 @@ void MsgCenterSubscribe()
     MsgCenterSubscribeTopic(TOPIC_EVENT_FIND_WATCH);
     MsgCenterSubscribeTopic(TOPIC_EVENT_CANCEL_FIND_WATCH);
     MsgCenterSubscribeTopic(TOPIC_EVENT_DRINKREMINDER);
-    MsgCenterSubscribeTopic(TOPIC_EVENT_MESSAGENOTE);
 }
 
 static OHOS::UIViewGroup* ShowAlarmNotify(void)
@@ -254,12 +252,6 @@ static OHOS::UIViewGroup* showtransmitNotify(void)
     return OHOS::transmittingShow();
 }
 
-/*显示消息提醒*/
-static OHOS::UIViewGroup* showMessageNotify(void)
-{
-    return OHOS::CreateMessageView();
-}
-
 void MsgCenterNotifyAlarmProc(const Topic topic, Request* req)
 {
     unused(req);
@@ -916,15 +908,6 @@ void MsgCenterNotifyDrinkReminderProc(const Topic topic, Request* req)
     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(showDrinkReminderNotify, (uint16_t)topic, true);
-}
 void MsgCenterNotifyActivityProc(const Topic topic, Request* req)
 {
     unused(topic);
@@ -1109,7 +1092,6 @@ static MsgCenterNotifyTable g_msgCenterNotifyTable[] = {
     {TOPIC_EVENT_FIND_WATCH,MsgCenterNotifyFindWatchProc},
     {TOPIC_EVENT_CANCEL_FIND_WATCH,MsgCenterNotifyCanCelFindWatchProc},
     {TOPIC_EVENT_DRINKREMINDER,MsgCenterNotifyDrinkReminderProc},
-    {TOPIC_EVENT_MESSAGENOTE,MsgCenterNotifyMessageProc},
 };
 
 static MsgCenterNotifyTable *MsgCenterGetNotifyTblCb(uint8_t idx)
diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp
deleted file mode 100644 (file)
index b2ff7d1..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-#include "notification_manager.h"
-#include "wearable_log.h"
-#include "components/ui_button.h"
-#include <iostream>
-#include "ui_service.h"
-#include <graphic_service.h>
-#include "bleEvent.h"
-#include "components/ui_label_ext.h"
-#include "uicomponents/UIComponents.h"
-#include "message/include/MessageModel.h"
-#include "message_notification.h"
-#include "string"
-namespace OHOS
-{
-
-    UIViewGroup *MessageGroupView{nullptr};
-
-    UILabel *titleLabel{nullptr};            // 标题
-    UILabel *timeLabel{nullptr};             // 时间
-    UILabel *messageLabel{nullptr};          // 详细label
-    UILabelButtonExt *deleteButton{nullptr}; // 删除按键
-
-    static std::string titleStr, timeStr, messageStr;
-
-#define DELETEBUTTON "delete_button"
-
-    MessageViewEventListener::MessageViewEventListener()
-    {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MessageViewEventListener::MessageViewEventListener");
-    }
-
-    MessageViewEventListener::~MessageViewEventListener()
-    {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MessageViewEventListener::~MessageViewEventListener");
-    }
-
-    MessageViewEventListener &MessageViewEventListener::GetInstance()
-    {
-        static MessageViewEventListener instance;
-        return instance;
-    }
-    bool MessageViewEventListener::OnRelease(UIView &view, const ReleaseEvent &event)
-    {
-        WEARABLE_LOGE(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_LOGD(WEARABLE_LOG_MODULE_APP, "MessageViewEventListener::OnDrag");
-        UNUSED(view);
-        return true;
-    }
-
-    bool MessageViewEventListener::OnDragEnd(UIView &view, const DragEvent &event)
-    {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MessageViewEventListener::OnDragEnd");
-        if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT)
-        {
-            NotificationManager::GetInstance()->StopNotify();
-        }
-        return true;
-    }
-
-    /*创建信息弹窗*/
-    UIViewGroup *CreateMessageView(void)
-    {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateMessageView");
-        MessageGroupView = new UIViewGroup();
-        if (MessageGroupView == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CreateMessageView] MessageGroupView new fail!!");
-            return nullptr;
-        }
-        MessageGroupView->SetPosition(0, 0, 466, 466);
-        MessageGroupView->SetViewId("messagenotify");
-        MessageGroupView->SetTouchable(true);
-        MessageGroupView->SetDraggable(true);
-        UIView::OnDragListener *dragListener = static_cast<UIView::OnDragListener *>(&MessageViewEventListener::GetInstance());
-        if (dragListener == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CreateMessageView] dragListener new fail!!");
-            return nullptr;
-        }
-        MessageGroupView->SetOnDragListener(dragListener);
-        /*获取最新message*/
-        MessageData *data = MessageModel::GetInstance().GetNewestData();
-        if (data != nullptr)
-        {
-            titleStr = data->labelTitle;
-            timeStr = data->labelTime;
-            messageStr = data->labelDetails;
-        }
-        /*初始化label*/
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitView");
-        /* -------------------------------------------------------------------------- */
-        titleLabel = new UILabel();
-        if (titleLabel == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "titleLabel:: new UILabel fail");
-            return nullptr; // 内存分配失败,返回
-        }
-        titleLabel->SetPosition(83, 60, 300, 35);
-        titleLabel->SetText(titleStr.c_str());
-        titleLabel->SetStyle(STYLE_TEXT_FONT, 30);
-        titleLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS);
-        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!");
-        /* -------------------------------------------------------------------------- */
-        timeLabel = new UILabel();
-        if (timeLabel == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "timeLabel:: new UILabel fail");
-            return nullptr; // 内存分配失败,返回
-        }
-        timeLabel->SetPosition(73, 104, 320, 33);
-        timeLabel->SetViewId("timeLabel");
-        timeLabel->SetText(timeStr.c_str());
-        timeLabel->SetTextColor(Color::Gray());
-        timeLabel->SetStyle(STYLE_TEXT_FONT, 28);
-        timeLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28);
-        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!");
-        /* -------------------------------------------------------------------------- */
-        /*初始化消息内容*/
-        messageLabel = new UILabel();
-        if (messageLabel == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "messageLabel:: new UILabel fail");
-            return nullptr; // 内存分配失败,返回
-        }
-        messageLabel->SetPosition(53, 170, 360, 144);
-        messageLabel->SetViewId("messageLabel");
-        messageLabel->SetText(messageStr.c_str());
-        messageLabel->SetTextColor(Color::Gray());
-        messageLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
-        timeLabel->SetLineBreakMode(UILabel::LINE_BREAK_CLIP);
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "messageLabel is ok");
-
-        /*加载清除按键*/
-        InitButtonExt(deleteButton, 0, 366, 466, 100, DELETEBUTTON, STR_CLOSE, 30);
-        const char *buttonImgSrc = "/user/res/466x100button.bin";
-        deleteButton->SetImageSrc(buttonImgSrc, buttonImgSrc);
-        UIView::OnTouchListener *TouchListener = static_cast<UIView::OnTouchListener *>(&MessageViewEventListener::GetInstance());
-        if (TouchListener == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CreateMessageView] TouchListener new fail!!");
-            return nullptr;
-        }
-        deleteButton->SetOnTouchListener(TouchListener);
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "deleteButton");
-        /* -------------------------------------------------------------------------- */
-        MessageGroupView->Add(titleLabel);
-        MessageGroupView->Add(timeLabel);
-        MessageGroupView->Add(messageLabel);
-        MessageGroupView->Add(deleteButton);
-
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Create MessageGroupView succeed!!");
-
-        return MessageGroupView;
-    }
-    /*释放消息弹窗视图*/
-    void FreeMessageView(void)
-    {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FreeMessageView(void)");
-        if (MessageGroupView != nullptr)
-        {
-            MessageGroupView->RemoveAll();
-
-            delete titleLabel;
-            titleLabel = nullptr;
-
-            delete timeLabel;
-            timeLabel = nullptr;
-
-            delete messageLabel;
-            messageLabel = nullptr;
-
-            delete deleteButton;
-            deleteButton = nullptr;
-
-            RootView::GetInstance()->Remove(MessageGroupView);
-            delete MessageGroupView;
-            MessageGroupView = nullptr;
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Free MessageView succeed!!");
-        }
-        return;
-    }
-}
\ No newline at end of file