#include "sleepmode/include/SleepModeModel.h"
#include "main/include/MainViewSample.h"
+#include "main/include/dropdown/DropDownCardPage1.h"
#include "MainModel.h"
#include "ConfigModel.h"
#include "custom_runtime.h"
/*更新主界面配置*/
MainModel::GetInstance().setDialState(DialState::SLEEP, true);
+ //更新下拉界面
+ if(DropDownCardPage1::GetInstance() != nullptr && MainViewSample::GetInstance() != nullptr)
+ {
+ DropDownCardPage1::GetInstance()->UpdateSleepModelState(true);
+ }
+
// disable flip wrist
uapi_take_to_wake(0);
/*更新主界面配置*/
MainModel::GetInstance().setDialState(DialState::SLEEP, false);
+ //更新下拉界面
+ if(DropDownCardPage1::GetInstance() != nullptr && MainViewSample::GetInstance() != nullptr)
+ {
+ DropDownCardPage1::GetInstance()->UpdateSleepModelState(false);
+ }
// enable flip wrist
if(true == mmi_flip_wrist_switch_get())
{
NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeSleepView);
/*获取最新sleep*/
SLEEPSTATE sleepsate = SleepModel::GetInstance().get_sleep_state();
- UIResourceTextId textId = STR_MORNNING;
+ // TODO:适配多国语言
+ // UIResourceTextId textId = STR_MORNNING;
+ std::string sleep_note;
switch (sleepsate)
{
case SLEEPSTATE::SLEEPNOTIFY:
titleStr = SleepModel::GetInstance().get_notifiy();
- textId = STR_DISTURB; // 即将开启勿扰
+ // textId = STR_DISTURB; // 即将开启勿扰
+ sleep_note = "手表将在20分钟后开启睡眠模式,关闭请到控制中心";
break;
case SLEEPSTATE::SLEPP:
titleStr = SleepModel::GetInstance().get_sleep_notifiy();
- textId = STR_DISTURBNOTE;
+ // textId = STR_DISTURBNOTE;
+ sleep_note = "已开启睡眠模式,此模式下手表将关闭所有提醒功能";
break;
case SLEEPSTATE::WAKE:
titleStr = SleepModel::GetInstance().get_wake_notifiy();
- textId = STR_MORNNING;
+ // textId = STR_MORNNING;
SetAlarmClockView(); // 设置为早安视图
return SleepGroupView;
break;
}
sleepnotifylabel->SetPosition(53, 220, 360, 144);
sleepnotifylabel->SetViewId("sleepnotifylabel");
- sleepnotifylabel->SetTextId(textId);
+ // sleepnotifylabel->SetTextId(textId);
+ sleepnotifylabel->SetText(sleep_note.c_str());
sleepnotifylabel->SetTextColor(Color::Gray());
sleepnotifylabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
sleepnotifylabel->SetLineBreakMode(UILabel::LINE_BREAK_CLIP); // 换行裁剪