From 0c0bd76abe26ebcea5dfbc117009de47e05466ca Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Sat, 5 Oct 2024 17:03:26 +0800 Subject: [PATCH] =?utf8?q?=E6=B6=88=E6=81=AF=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?utf8?q?=E6=B6=88=E6=81=AF=E8=AF=A6=E6=83=85=E7=95=8C=E9=9D=A2=E6=98=BE?= =?utf8?q?=E7=A4=BA=E4=B8=8D=E5=AE=8C=E5=85=A8=E7=9A=84=E6=8C=89=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/message/include/MessageShowView.h | 15 +++------------ .../nativeui/message/src/MessageShowView.cpp | 12 +++++++++++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h index d8bdf8c26..8d13f06f2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h @@ -1,15 +1,4 @@ -/*** - * @Date: 2024-06-21 09:56:18 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-08-12 16:03:32 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h - */ -/*** - * @Date: 2024-06-21 09:56:18 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-08-09 18:56:33 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h - */ + #ifndef MessageShow_VIEW_H #define MessageShow_VIEW_H @@ -63,6 +52,8 @@ namespace OHOS UILabelButton *messageButton{nullptr}; // 消息 UILabelButtonExt *deleteButton{nullptr}; // 清除按键 + UIImageView *background{nullptr}; + bool viewInitStatus{false}; std::string titleStr; std::string timeStr; diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp index abb9c33cc..8585c26d0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp @@ -82,6 +82,9 @@ namespace OHOS delete deleteButton; deleteButton = nullptr; + + delete background; + background = nullptr; } void MessageShowView::InitializeLabel(UILabel *label, int posX, int posY, int width, int height, const char *viewId, int fontSize) @@ -141,6 +144,12 @@ namespace OHOS messageButton->SetPosition(33, 157, 380, updatedRectWidth); deleteButton->SetPosition(43, 157 + updatedRectWidth + 20, 380, 100); + /*加载空白*/ + CreateLine(background, 43, 157 + updatedRectWidth + 20 + 50, 380, 100, + "line"); + background->SetVisible(false); + container_->Add(background); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "updatedRectWidth %d updatedLabelWidth %d lines %d \r\n", updatedRectWidth, updatedLabelWidth, lines); } void MessageShowView::InitView() @@ -202,6 +211,7 @@ namespace OHOS container_->Add(deleteButton); /* -------------------------------------------------------------------------- */ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitView is ok!"); + // UpdateMessage(); } @@ -217,7 +227,7 @@ namespace OHOS titleStr = data->labelTitle; timeStr = data->labelTime; messageStr = data->labelDetails; - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UpdateMessage title %s time %s message %s", titleStr.c_str(), timeStr.c_str(), messageStr.c_str()); + WEARABLE_LOGED(WEARABLE_LOG_MODULE_APP, "UpdateMessage title %s time %s message %s", titleStr.c_str(), timeStr.c_str(), messageStr.c_str()); } void MessageShowView::PreLoad(void) { -- 2.17.1