// 重置哄睡录音标志位
void ResetLullabyRecording(void);
+
+ bool IsVolumeAdjustmentAvailable(int16_t currentView, int16_t currentSubView);
private:
bool OnKeyAct(UIView &view, const KeyEvent &event) override; // 增加按键事件
// 辅助函数
void HandleDialogueFunction(int16_t currentView, int16_t currentSubView);
void HandleLullabyFunction(int16_t currentView, int16_t currentSubView);
- bool IsVolumeAdjustmentAvailable(int16_t currentView, int16_t currentSubView);
+
void ShowVolumeAdjustment(int volumeDelta);
bool HandleViewNavigation(int16_t currentView, int16_t currentSubView, bool isUpKey, KeyType keyType);
#include <service/graphic_service.h>
#include "custom_utils.h"
#include <string.h>
+#include "bluetooth/Ln_Bluetooth_apiC.h"
#include <algorithm>
#include <ctime>
#include "custom_runtime.h"
// currentSubView = ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW;
}
+ // 蓝牙界面(搜索/连接过程)强制停止、上报,并跳转提醒
+ if (currentView == THUNDERBIRD_BLUEVIEW) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandleScheduleReminder: in BLUEVIEW, stop scan/connect and switch to reminder");
+ ln_bt_scan_stop();
+ ln_bt_disconnect(); // 确保中断连接流程
+ ln_bt_report_earphone_connection_status(); // 上报当前连接状态
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER);
+ if (ThunderBirdReminderView::GetInstance()) {
+ ThunderBirdReminderView::GetInstance()->IsIcon(false);
+ }
+ }
//如果当前界面是事项提醒界面,则不进行切换,防止返回原任务进入循环
- if(currentView != THUNDERBIRD_REMINDERVIEW && currentSubView != ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER)
+ else if(currentView != THUNDERBIRD_REMINDERVIEW && currentSubView != ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER)
{
ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER);
ThunderBirdReminderView::GetInstance()->IsIcon(false);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Processing schedule reminder: %s - %s", title, content);
}
}
+ //是否显示任务提醒界面
+ bool ThunderBirdModel::IsShowTaskReminder()
+ {
+ if(ThunderBirdMainView::GetInstance())
+ {
+ int currentView = ThunderBirdMainView::GetInstance()->GetCurrentView();
+ int currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView();
+ if ((currentView == THUNDERBIRD_REMINDERVIEW &&
+ currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER) ||
+ ThunderBirdPresenter::GetInstance()->IsVolumeAdjustmentAvailable(currentView, currentSubView))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
void ThunderBirdModel::HandleTaskReminder(const char* scheduleName)
{
+ if(!IsShowTaskReminder())
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleTaskReminder: 不显示任务提醒界面");
+ return;
+ }
uapi_set_screen_on_api(); // 亮屏
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleTaskReminder");
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScheduleName: %s", scheduleName ? scheduleName : "NULL");
- // 震动提醒
- // custom_VibratorFunc_int(0);
- // 这里可以添加具体的任务提醒处理逻辑
- // 例如:显示任务提醒界面、播放提醒音、更新任务列表等
+
// 示例:通过图形服务显示任务提醒
if (scheduleName) {