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