#314 手表,消息通知,长消息超出框外显示
authorCaisking <3449750381@qq.com>
Tue, 24 Sep 2024 12:33:21 +0000 (20:33 +0800)
committerCaisking <3449750381@qq.com>
Tue, 24 Sep 2024 12:33:21 +0000 (20:33 +0800)
code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp
code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp

index 12b4ad3..7ed7bff 100644 (file)
@@ -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)
         {
index 306d9a4..3cc5de9 100644 (file)
@@ -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!");