From 6d9ea68aa58f86cf8b305aed52585bfb41d2ec93 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Tue, 24 Sep 2024 20:33:21 +0800 Subject: [PATCH] =?utf8?q?#314=20=E6=89=8B=E8=A1=A8=EF=BC=8C=E6=B6=88?= =?utf8?q?=E6=81=AF=E9=80=9A=E7=9F=A5=EF=BC=8C=E9=95=BF=E6=B6=88=E6=81=AF?= =?utf8?q?=E8=B6=85=E5=87=BA=E6=A1=86=E5=A4=96=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/message/src/MessageModel.cpp | 2 ++ .../nativeui/message/src/MessageShowView.cpp | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp index 12b4ad39b..7ed7bff6c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp @@ -348,6 +348,8 @@ namespace OHOS data.labelTitle = messageInfo->title; data.timestamp = messageInfo->time; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AddMessageData data.isRead is %d,data.labelDetails is %s,data.labelTitle is %s,data.timestamp is %d", data.isRead, data.labelDetails.c_str(), data.labelTitle.c_str(), data.timestamp); + char labelTime[20]; if (uapi_get_TIME_STR(data.timestamp, labelTime, '.', ':', DATE_Y_M_D_H_M) != ERRCODE_SUCC) { 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 306d9a429..3cc5de923 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp @@ -136,7 +136,7 @@ namespace OHOS int updatedLabelWidth = baseLabelWidth + (additionalLines * extraLabelWidthPerLine); // 输出配置结果 - messageButton->SetPosition(33, 157, 400, updatedRectWidth); + messageButton->SetPosition(33, 157, 380, updatedRectWidth); deleteButton->SetPosition(43, 157 + updatedRectWidth + 20, 380, 100); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "updatedRectWidth %d updatedLabelWidth %d lines %d \r\n", updatedRectWidth, updatedLabelWidth, lines); @@ -176,12 +176,18 @@ namespace OHOS time->SetVisible(true); /* -------------------------------------------------------------------------- */ /*初始化消息内容*/ - InitializeButton(messageButton, 33, 157, 400, defaultRectWidth, "message"); - messageButton->SetStyle(STYLE_BORDER_RADIUS, 30); + InitializeButton(messageButton, 33, 157, 380, defaultRectWidth, "message"); + messageButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + messageButton->SetStyle(STYLE_BORDER_RADIUS, 20); + messageButton->SetStyle(STYLE_PADDING_LEFT, 15); + messageButton->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff)); messageButton->SetAlign(TEXT_ALIGNMENT_LEFT); - messageButton->SetTextColor(Color::Gray()); + messageButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + messageButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED); + messageButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + messageButton->SetStyleForState(STYLE_BORDER_RADIUS, 20, UIButton::PRESSED); messageButton->SetTouchable(false); - // messageButton->SetText(messageStr.c_str()); + messageButton->SetText(messageStr.c_str()); // messageButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); /* -------------------------------------------------------------------------- */ InitUILabel(message, 63, 165, 340, 100, "message", messageStr.c_str(), DEFAULT_VECTOR_FONT_FILENAME, 30); @@ -194,7 +200,7 @@ namespace OHOS container_->Add(title); container_->Add(time); container_->Add(messageButton); - container_->Add(message); + // container_->Add(message); container_->Add(deleteButton); /* -------------------------------------------------------------------------- */ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitView is ok!"); -- 2.17.1