From: xue <2144439972@qq.com> Date: Mon, 13 Oct 2025 01:54:50 +0000 (+0800) Subject: 优化提醒逻辑 X-Git-Tag: V1.0.9_20251128_194606_LN~264 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=d87e66e395f61c3832078d9c2341225346573907;p=mirrors%2FFD230.git 优化提醒逻辑 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdReminderView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdReminderView.h index 7523c38b1..8aa879874 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdReminderView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdReminderView.h @@ -45,6 +45,7 @@ namespace OHOS private: UIViewGroup *group{nullptr}; UILabelExt *TextLabel{nullptr}; + UILabelExt *TextLabel_Y{nullptr}; UILabelExt *RemindLabel{nullptr}; UILabelButton *RemindButton{nullptr}; UIImageView *RemindIcon{nullptr}; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp index 36f7a05cb..c5c645990 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp @@ -233,7 +233,7 @@ namespace OHOS } if(RemindIcon) { - RemindIcon->SetPosition(158, 296, 24, 24); + RemindIcon->SetPosition(159, 296, 24, 24); RemindIcon->SetSrc("/user/res/volume_up.bin"); RemindIcon->SetVisible(true); } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp index b10d6c522..00904fa00 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp @@ -35,6 +35,7 @@ namespace OHOS group = nullptr; } if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } + if (TextLabel_Y != nullptr) { delete TextLabel_Y; TextLabel_Y = nullptr; } if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; } if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; } @@ -52,6 +53,14 @@ namespace OHOS group->SetStyle(STYLE_BACKGROUND_OPA, 0x00); // 公共控件 + TextLabel_Y = new UILabelExt(); + if (TextLabel_Y) + { + TextLabel_Y->SetVisible(false); + TextLabel_Y->SetStyle(STYLE_LINE_SPACE, 10); + TextLabel_Y->SetStyle(STYLE_LETTER_SPACE, 1); + group->Add(TextLabel_Y); + } TextLabel = new UILabelExt(); if (TextLabel) { @@ -60,6 +69,7 @@ namespace OHOS TextLabel->SetStyle(STYLE_LETTER_SPACE, 1); group->Add(TextLabel); } + RemindButton = new UILabelButton(); if (RemindButton) { @@ -112,6 +122,7 @@ namespace OHOS { if (group == nullptr) { return; } if (TextLabel) { TextLabel->SetVisible(false); TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS);} + if (TextLabel_Y) { TextLabel_Y->SetVisible(false); TextLabel_Y->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS);} if (RemindLabel) { RemindLabel->SetVisible(false); } if (RemindButton) { RemindButton->SetVisible(false); } if (RemindIcon) { RemindIcon->SetVisible(false); RemindIcon->SetStyle(STYLE_BACKGROUND_OPA, 0x00);} @@ -137,21 +148,36 @@ namespace OHOS } case THUNDERBIRD_REMINDERVIEW_TASK_REMINDER: { + if (RemindIcon) + { + // 图标位置:整体居中的左侧 + RemindIcon->SetPosition(52, 66, 36, 36); + RemindIcon->SetSrc("/user/res/notification.bin"); + RemindIcon->SetVisible(true); + } + if (TextLabel) { - TextLabel->SetPosition(99, 64, 261, 42); + // 文本位置:图标右侧,紧挨着 + TextLabel->SetPosition(96, 64, 300, 42); TextLabel->SetText("11点了该睡觉了"); - TextLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT); + TextLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_CENTER); // 左对齐,因为已经整体居中了 TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); TextLabel->SetRollSpeed(35); TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); TextLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(57, 64, 36, 36); - RemindIcon->SetSrc("/user/res/notification.bin"); - RemindIcon->SetVisible(true); + } + if (TextLabel_Y) + { + // 黑色文本:位置比白色文本偏移2像素 + TextLabel_Y->SetPosition(98, 66, 300, 42); + TextLabel_Y->SetText("11点了该睡觉了"); + TextLabel_Y->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_CENTER); + TextLabel_Y->SetStyle(STYLE_TEXT_COLOR, 0xff000000); + TextLabel_Y->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + TextLabel_Y->SetRollSpeed(35); + TextLabel_Y->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + TextLabel_Y->SetVisible(true); } if (RemindButton) { @@ -163,7 +189,7 @@ namespace OHOS } if (RemindIcon2) { - RemindIcon2->SetPosition(144, 122, 24, 24); + RemindIcon2->SetPosition(146, 124, 24, 24); RemindIcon2->SetSrc("/user/res/volume_up.bin"); RemindIcon2->SetVisible(true); } @@ -388,6 +414,7 @@ namespace OHOS if (group == nullptr) { return; } if (RemindButton) { RemindButton->SetVisible(false); } if (TextLabel) { TextLabel->SetVisible(false); } + if (TextLabel_Y) { TextLabel_Y->SetVisible(false); } if (RemindLabel) { RemindLabel->SetVisible(false); } if (RemindIcon) { RemindIcon->SetVisible(false); } if (RemindIcon2) { RemindIcon2->SetVisible(false); } @@ -440,14 +467,17 @@ namespace OHOS } else if (title) { // 只有标题 TextLabel->SetText(title); + TextLabel_Y->SetText(title); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Updated task reminder text with title only: %s", title); } else if (content) { // 只有内容 TextLabel->SetText(content); + TextLabel_Y->SetText(content); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Updated task reminder text with content only: %s", content); } else { // 都没有,使用默认文本 TextLabel->SetText("11点了该睡觉了"); + TextLabel_Y->SetText("11点了该睡觉了"); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Updated task reminder text with default text"); } }