From: luozheng <1732036298@qq.com> Date: Sat, 10 Aug 2024 04:19:59 +0000 (+0800) Subject: 睡眠模式开启勿扰同步刷新下拉界面 X-Git-Tag: release_V1.2.70_20241020_135402~685 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=4698f0e5208b913a7aa6a9ac8ed9162489ce3e19;p=mirrors%2FFD230.git 睡眠模式开启勿扰同步刷新下拉界面 --- diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h index 4dc0f6ca6..333c7c9db 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h @@ -511,7 +511,9 @@ enum UIResourceTextId : uint16_t { STR_AVG_PACE = 498, STR_TONGYI_QIANWEN = 499, STR_IFLYTEK_SPARK = 500, - STR_MAX_ID = 501, + STR_DISTURBNOTE_OFF = 501, + STR_4G_NOTE = 502, + STR_MAX_ID = 503, }; // UIResourceTextId enum FontLanguageId : uint8_t { diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp index 15d32f5af..0e6fb0728 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp @@ -388,6 +388,7 @@ extern "C" if (OHOS::ConfigModel::GetInstance()->GetDnotdisturb()) { OHOS::ConfigModel::GetInstance()->SetDnotdisturb(false); // 关闭勿扰 + SendMsgToUIService(UI_UPDATE_DNOTDISTURB_MODE,0,nullptr,0); } if(uapi_dev_runtime_get_sleep_status() == 0) { @@ -418,6 +419,7 @@ extern "C" if (!OHOS::ConfigModel::GetInstance()->GetDnotdisturb()) { OHOS::ConfigModel::GetInstance()->SetDnotdisturb(true); // 开启勿扰 + SendMsgToUIService(UI_UPDATE_DNOTDISTURB_MODE,0,nullptr,0); } LOS_Msleep(1000); do_cywee_service_check_msg(CYWEE_SERVICE_CMD_SLEEPING_MODE, NULL); diff --git a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbModel.h b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbModel.h index 311041d84..ca8aeadf0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbModel.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-10 16:38:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-16 11:40:33 + * @LastEditTime: 2024-08-10 10:23:18 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbModel.h */ #ifndef DNOTDISTURB_MODEL_H @@ -16,6 +16,7 @@ namespace OHOS static DnotDisturbModel &GetInstance(void); void SetDoNotDisturbModeEnabled(bool enabled); bool GetDoNotDisturbModeEnabled() const; + void UpdateDoNotDisturbMode(void); private: DnotDisturbModel(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbModel.cpp index b46c4bd4c..5b584edb3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbModel.cpp @@ -2,10 +2,11 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-10 16:38:52 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-16 11:37:40 + * @LastEditTime: 2024-08-10 10:25:37 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbModel.cpp */ #include "dnotdisturb/include/DnotDisturbModel.h" +#include "main/include/PullUpDownView.h" #include "ConfigModel.h" namespace OHOS { @@ -22,13 +23,23 @@ namespace OHOS void DnotDisturbModel::SetDoNotDisturbModeEnabled(bool enabled) { - //isDoNotDisturbModeEnabled = enabled; + // isDoNotDisturbModeEnabled = enabled; ConfigModel::GetInstance()->SetDnotdisturb(enabled); } bool DnotDisturbModel::GetDoNotDisturbModeEnabled() const { - //return isDoNotDisturbModeEnabled; + // return isDoNotDisturbModeEnabled; return ConfigModel::GetInstance()->GetDnotdisturb(); } + + /*更新勿扰模式*/ + void DnotDisturbModel::UpdateDoNotDisturbMode(void) + { + if (PullUpDownView::GetInstance() != nullptr) + { + PullUpDownView::GetInstance()->UpdateDnotDisturbStatus(GetDoNotDisturbModeEnabled()); + } + return; + } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp index 1e8240bb6..095499692 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-10 11:58:37 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-07 18:54:14 + * @LastEditTime: 2024-08-10 11:01:46 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp */ #include "AppViewIDs.h" @@ -88,8 +88,8 @@ namespace OHOS } if (&view == p_DnotDisturbView->GetButtonOn()) // 开启勿扰模式 { - DnotDisturbModel::GetInstance().SetDoNotDisturbModeEnabled(true); - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); + bool state = DnotDisturbModel::GetInstance().GetDoNotDisturbModeEnabled(); + DnotDisturbModel::GetInstance().SetDoNotDisturbModeEnabled(state ? false : true); } else if (&view == p_DnotDisturbView->GetButtonOff()) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp index 4c1dca988..ef60f68c2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp @@ -2,11 +2,12 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-10 11:58:21 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-29 16:30:35 + * @LastEditTime: 2024-08-10 10:59:45 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp */ #include "dnotdisturb/include/DnotDisturbView.h" #include "dnotdisturb/include/DnotDisturbPresenter.h" +#include "dnotdisturb/include/DnotDisturbModel.h" #include "wearable_log.h" #include "screensetting/include/ScreenModels.h" #include "UiConfig.h" @@ -135,7 +136,8 @@ namespace OHOS AttentionLabel->SetPosition(33, 228, 400, 70); AttentionLabel->SetStyle(STYLE_TEXT_FONT, 30); AttentionLabel->SetStyle(STYLE_LINE_HEIGHT, 35); - AttentionLabel->SetTextId(STR_DO_NOT_DISTURB_MODE); // 开启勿扰模式,手表将不会发出震动与铃声,是否开启 + // bool ?勿扰模式已开启是否关闭:开启勿扰模式,手表将不会发出震动与铃声,是否开启 + AttentionLabel->SetTextId(DnotDisturbModel::GetInstance().GetDoNotDisturbModeEnabled() ? STR_DISTURBNOTE_OFF : STR_DO_NOT_DISTURB_MODE); AttentionLabel->SetLineBreakMode(UILabelExt::LINE_BREAK_WRAP); AttentionLabel->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff)); AttentionLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); diff --git a/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h b/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h index 51b4af564..64eba7b35 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h +++ b/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h @@ -8,7 +8,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-12 11:44:04 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-03 14:17:30 + * @LastEditTime: 2024-08-10 10:16:48 * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h */ /* @@ -73,6 +73,7 @@ typedef enum { UI_UPDATE_CALL_VOLUME, //更新通话音量 UI_UPDATE_VIBRATION_MODE, //更新震动模式 UI_UPDATE_SILENT_MODE, //更新静音模式 + UI_UPDATE_DNOTDISTURB_MODE, //更新勿扰模式 UI_UPDATE_WEATHER_DATA, //天气数据更新 UI_UPDATE_SLEEP_DATA, //更新睡眠数据 diff --git a/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp b/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp index 1644e549d..2ed316cfb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp @@ -19,6 +19,7 @@ #include "displaybrightness/include/DisplayBrightnessModel.h" #include "soundandvibration/include/SoundAndVibrationModel.h" #include "rebootandshutdown/include/RebootAndShutdownModel.h" +#include "dnotdisturb/include/DnotDisturbModel.h" #include "obumessage/include/OBUMessageModel.h" #include "sleep/include/SleepModel.h" #include "message/include/MessageModel.h" @@ -106,6 +107,7 @@ static void HandleUpdateSystemVolume(Request *request); static void HandleUpdateCallVolume(Request *request); static void HandleUpdateVibrationMode(Request *request); static void HandleUpdateSilentMode(Request *request); +static void HandleUpdateDontDisturbMode(Request *request); static void HandleAiJumpToResultView(Request *request); static void HandleAiJumpToListeningMessage(Request *request); static void HandleUpdateUserQuestionStr(Request *request); @@ -139,6 +141,7 @@ MsgHandlerEntry msgHandlers[] = { {UI_UPDATE_CALL_VOLUME, HandleUpdateCallVolume}, {UI_UPDATE_VIBRATION_MODE, HandleUpdateVibrationMode}, {UI_UPDATE_SILENT_MODE, HandleUpdateSilentMode}, + {UI_UPDATE_DNOTDISTURB_MODE,HandleUpdateDontDisturbMode}, {UI_AI_JUMP_TO_RESULT_VIEW, HandleAiJumpToResultView}, {UI_UPDATE_USER_QUESTION_STR,HandleUpdateUserQuestionStr}, {UI_UPDATE_AI_ANSWER_STR, HandleUpdateAIAnswerStr}, @@ -532,6 +535,14 @@ void HandleUpdateSilentMode(Request *request) std::bind(&OHOS::SoundAndVibrationModel::UpdateSilentModeSwitch, OHOS::SoundAndVibrationModel::GetInstance())); } +//处理更新勿扰模式 +void HandleUpdateDontDisturbMode(Request *request) +{ + WEARABLE_LOGI(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleUpdateDontDisturbMode"); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::DnotDisturbModel::UpdateDoNotDisturbMode, &OHOS::DnotDisturbModel::GetInstance())); +} + //处理Ai回应的用户数据 void HandleAiJumpToResultView(Request *request) { diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang index 7ab73a51e..c67adb79f 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h index 71fa6407b..9443534a1 100644 --- a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h @@ -511,7 +511,9 @@ enum UIResourceTextId : uint16_t { STR_AVG_PACE = 498, STR_TONGYI_QIANWEN = 499, STR_IFLYTEK_SPARK = 500, - STR_MAX_ID = 501, + STR_DISTURBNOTE_OFF = 501, + STR_4G_NOTE = 502, + STR_MAX_ID = 503, }; // UIResourceTextId enum FontLanguageId : uint8_t { diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang index fd0fdf734..9c38b26e4 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang differ diff --git a/tools/language_tool/Language_xml/input_list_en.txt b/tools/language_tool/Language_xml/input_list_en.txt index 0e10562f7..6830f46cd 100644 --- a/tools/language_tool/Language_xml/input_list_en.txt +++ b/tools/language_tool/Language_xml/input_list_en.txt @@ -317,7 +317,7 @@ STR_15_SECONDS$15 s STR_30_SECONDS$30 s STR_60_SECONDS$60 s STR_300_SECONDS$300 s -STR_4G_CAPABILITY$4G capability +STR_4G_CAPABILITY$4G STR_VOLTE_CALL$VoLTE call STR_MOBILE_DATA_OPTION$Mobile data option STR_SYSTEM_UPDATE$System Update @@ -498,4 +498,6 @@ STR_STEP_FREQUENCY$Step frequency (steps/min) STR_STEP_LENGTH$Stride length (CM) STR_AVG_PACE$Average pace STR_TONGYI_QIANWEN$Tongyi Qianwen -STR_IFLYTEK_SPARK$Xunfei Spark \ No newline at end of file +STR_IFLYTEK_SPARK$Xunfei Spark +STR_DISTURBNOTE_OFF$Do not disturb mode is enabled or disabled +STR_4G_NOTE$Note: After opening, the power consumption of the watch will be increased and the standby time will be shortened \ No newline at end of file diff --git a/tools/language_tool/Language_xml/input_list_zh.txt b/tools/language_tool/Language_xml/input_list_zh.txt index e1b9379f1..2ca45f008 100644 --- a/tools/language_tool/Language_xml/input_list_zh.txt +++ b/tools/language_tool/Language_xml/input_list_zh.txt @@ -317,7 +317,7 @@ STR_15_SECONDS$15秒 STR_30_SECONDS$30秒 STR_60_SECONDS$60秒 STR_300_SECONDS$300秒 -STR_4G_CAPABILITY$4G能力 +STR_4G_CAPABILITY$4G STR_VOLTE_CALL$VoLTE 通话 STR_MOBILE_DATA_OPTION$移动数据选项 STR_SYSTEM_UPDATE$系统更新 @@ -498,4 +498,6 @@ STR_STEP_FREQUENCY$步频(æ­¥/分钟) STR_STEP_LENGTH$步幅(CM) STR_AVG_PACE$平均配速 STR_TONGYI_QIANWEN$通义千问 -STR_IFLYTEK_SPARK$讯飞星火 \ No newline at end of file +STR_IFLYTEK_SPARK$讯飞星火 +STR_DISTURBNOTE_OFF$勿扰模式已开启是否关闭 +STR_4G_NOTE$注:开启后,手表功耗会提高,待机时间会缩短 \ No newline at end of file diff --git a/tools/language_tool/Language_xml/language_en.xml b/tools/language_tool/Language_xml/language_en.xml index c0bf0b95a..7e54f22b2 100644 --- a/tools/language_tool/Language_xml/language_en.xml +++ b/tools/language_tool/Language_xml/language_en.xml @@ -318,7 +318,7 @@ - + @@ -500,4 +500,6 @@ + + diff --git a/tools/language_tool/Language_xml/language_zh.xml b/tools/language_tool/Language_xml/language_zh.xml index bec22e9ba..8bce54a5d 100644 --- a/tools/language_tool/Language_xml/language_zh.xml +++ b/tools/language_tool/Language_xml/language_zh.xml @@ -318,7 +318,7 @@ - + @@ -500,4 +500,6 @@ + + diff --git a/tools/language_tool/font/en.lang b/tools/language_tool/font/en.lang index 7ab73a51e..c67adb79f 100644 Binary files a/tools/language_tool/font/en.lang and b/tools/language_tool/font/en.lang differ diff --git a/tools/language_tool/font/ui_resource_string.h b/tools/language_tool/font/ui_resource_string.h index 71fa6407b..9443534a1 100644 --- a/tools/language_tool/font/ui_resource_string.h +++ b/tools/language_tool/font/ui_resource_string.h @@ -511,7 +511,9 @@ enum UIResourceTextId : uint16_t { STR_AVG_PACE = 498, STR_TONGYI_QIANWEN = 499, STR_IFLYTEK_SPARK = 500, - STR_MAX_ID = 501, + STR_DISTURBNOTE_OFF = 501, + STR_4G_NOTE = 502, + STR_MAX_ID = 503, }; // UIResourceTextId enum FontLanguageId : uint8_t { diff --git a/tools/language_tool/font/zh.lang b/tools/language_tool/font/zh.lang index fd0fdf734..9c38b26e4 100644 Binary files a/tools/language_tool/font/zh.lang and b/tools/language_tool/font/zh.lang differ