From 44e9cc0357a9e2dbe450d5841ff47f01c1e55c8b Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Thu, 27 Nov 2025 16:21:41 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E4=BA=8B=E9=A1=B9=E6=8F=90?= =?utf8?q?=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../include/ThunderBirdReminderView.h | 2 + .../thunderbird/src/ThunderBirdModel.cpp | 33 ++++++---- .../src/ThunderBirdReminderView.cpp | 61 +++++++++++++++++-- 3 files changed, 77 insertions(+), 19 deletions(-) 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 ba5773c88..c6d801bac 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 @@ -29,6 +29,7 @@ namespace OHOS void UpdateTaskReminderText(const char* title, const char* content); void UpdateTaskReminderText(const char* text); void UpdateTaskReminderIcon(const char* icon); + void scheduleName_task_reminder(const char* scheduleName); @@ -38,6 +39,7 @@ namespace OHOS enum : int16_t { THUNDERBIRD_REMINDERVIEW_VOLUME = 0, // 音量调节 THUNDERBIRD_REMINDERVIEW_TASK_REMINDER, // 事项提醒 + THUNDERBIRD_SCHEDULE_TASK_REMINDER, // 日程事项提醒 THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT, // 网络断开 THUNDERBIRD_REMINDERVIEW_VAD_INITIALIZING, // 等待语音初始化 THUNDERBIRD_REMINDERVIEW_LOW_BATTERY, // 电量不足 diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index ccc797449..7c05ed45c 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -2135,19 +2135,26 @@ extern "C" { if (ThunderBirdMainView::GetInstance()) { int currentView = ThunderBirdMainView::GetInstance()->GetCurrentView(); int currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView(); - //如果当前界面是事项提醒界面,则不进行切换,防止返回原任务进入循环 - if(currentView != THUNDERBIRD_REMINDERVIEW && currentSubView != ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER) - { - ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER); - ThunderBirdReminderView::GetInstance()->IsIcon(true); - } - // 更新任务提醒的文本内容 - if (ThunderBirdReminderView::GetInstance()) { - ThunderBirdReminderView::GetInstance()->UpdateTaskReminderText(scheduleName,nullptr); - } - } else { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView instance is null, cannot show task reminder"); - } + ThunderBirdModel::GetInstance()->StartReminderHideTimer(3000); + ThunderBirdReminderView *reminderView = ThunderBirdReminderView::GetInstance(); + if (reminderView) + { + reminderView->Show(ThunderBirdReminderView::THUNDERBIRD_SCHEDULE_TASK_REMINDER); + reminderView->scheduleName_task_reminder(scheduleName); + } + // //如果当前界面是事项提醒界面,则不进行切换,防止返回原任务进入循环 + // if(currentView != THUNDERBIRD_REMINDERVIEW && currentSubView != ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER) + // { + // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER); + // ThunderBirdReminderView::GetInstance()->IsIcon(true); + // } + // // 更新任务提醒的文本内容 + // if (ThunderBirdReminderView::GetInstance()) { + // ThunderBirdReminderView::GetInstance()->UpdateTaskReminderText(scheduleName,nullptr); + // } + // } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView instance is null, cannot show task reminder"); + } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Processing task reminder: %s", scheduleName); } } 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 a53de1421..67ce0c9d1 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 @@ -182,6 +182,23 @@ namespace OHOS } break; } + case THUNDERBIRD_SCHEDULE_TASK_REMINDER: + { + if (RemindButton) + { + RemindButton->SetPosition(102, 114, 168, 40); + RemindButton->SetText(""); + RemindButton->SetLabelPosition(4, 2); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(115, 120, 47, 47); + // RemindIcon->SetSrc(""); + RemindIcon->SetVisible(true); + } + } case THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT: { if (RemindButton) @@ -537,12 +554,44 @@ namespace OHOS { RemindButton->SetText("等待语音初始化"); } - // if (RemindIcon) - // { - // RemindIcon->SetPosition(105, 120, 47, 47); - // RemindIcon->SetSrc("/user/res/no_network.bin"); - // RemindIcon->SetVisible(true); - // } + } + + void ThunderBirdReminderView::scheduleName_task_reminder(const char* scheduleName) + { + if(scheduleName == "提醒设置成功") + { + if (RemindButton) + { + RemindButton->SetPosition(69, 114, 222, 40); + RemindButton->SetText(scheduleName); + RemindButton->SetLabelPosition(26, 2); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(85, 122, 24, 24); + RemindIcon->SetSrc("/user/res/completed.bin"); + RemindIcon->SetVisible(true); + } + } + else + { + if (RemindButton) + { + RemindButton->SetPosition(79, 114, 202, 40); + RemindButton->SetText(scheduleName); + RemindButton->SetLabelPosition(26, 2); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(95, 122, 24, 24); + RemindIcon->SetSrc("/user/res/completed.bin"); + RemindIcon->SetVisible(true); + } + } } } -- 2.17.1