睡眠模式开启勿扰同步刷新下拉界面
authorluozheng <1732036298@qq.com>
Sat, 10 Aug 2024 04:19:59 +0000 (12:19 +0800)
committerluozheng <1732036298@qq.com>
Sat, 10 Aug 2024 04:19:59 +0000 (12:19 +0800)
18 files changed:
code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h
code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp
code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbModel.h
code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbModel.cpp
code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp
code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h
code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang
tools/language_tool/Language_xml/input_list_en.txt
tools/language_tool/Language_xml/input_list_zh.txt
tools/language_tool/Language_xml/language_en.xml
tools/language_tool/Language_xml/language_zh.xml
tools/language_tool/font/en.lang
tools/language_tool/font/ui_resource_string.h
tools/language_tool/font/zh.lang

index 4dc0f6c..333c7c9 100644 (file)
@@ -511,7 +511,9 @@ enum UIResourceTextId : uint16_t {
     STR_AVG_PACE = 498,\r
     STR_TONGYI_QIANWEN = 499,\r
     STR_IFLYTEK_SPARK = 500,\r
-    STR_MAX_ID = 501,\r
+    STR_DISTURBNOTE_OFF = 501,\r
+    STR_4G_NOTE = 502,\r
+    STR_MAX_ID = 503,\r
 }; // UIResourceTextId\r
 \r
 enum FontLanguageId : uint8_t {\r
index 15d32f5..0e6fb07 100644 (file)
@@ -388,6 +388,7 @@ extern "C"
                 if (OHOS::ConfigModel::GetInstance()->GetDnotdisturb())\r
                 {\r
                     OHOS::ConfigModel::GetInstance()->SetDnotdisturb(false); // 关闭勿扰\r
+                    SendMsgToUIService(UI_UPDATE_DNOTDISTURB_MODE,0,nullptr,0);\r
                 }\r
                 if(uapi_dev_runtime_get_sleep_status() == 0)\r
                 {\r
@@ -418,6 +419,7 @@ extern "C"
                 if (!OHOS::ConfigModel::GetInstance()->GetDnotdisturb())\r
                 {\r
                     OHOS::ConfigModel::GetInstance()->SetDnotdisturb(true); // 开启勿扰\r
+                    SendMsgToUIService(UI_UPDATE_DNOTDISTURB_MODE,0,nullptr,0);\r
                 }\r
                 LOS_Msleep(1000);\r
                 do_cywee_service_check_msg(CYWEE_SERVICE_CMD_SLEEPING_MODE, NULL);\r
index 311041d..ca8aead 100644 (file)
@@ -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();
index b46c4bd..5b584ed 100644 (file)
@@ -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
index 1e8240b..0954996 100644 (file)
@@ -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())
         {
index 4c1dca9..ef60f68 100644 (file)
@@ -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);
index 51b4af5..64eba7b 100644 (file)
@@ -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,       //更新睡眠数据
index 1644e54..2ed316c 100644 (file)
@@ -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)
 {
index 7ab73a5..c67adb7 100644 (file)
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
index 71fa640..9443534 100644 (file)
@@ -511,7 +511,9 @@ enum UIResourceTextId : uint16_t {
     STR_AVG_PACE = 498,\r
     STR_TONGYI_QIANWEN = 499,\r
     STR_IFLYTEK_SPARK = 500,\r
-    STR_MAX_ID = 501,\r
+    STR_DISTURBNOTE_OFF = 501,\r
+    STR_4G_NOTE = 502,\r
+    STR_MAX_ID = 503,\r
 }; // UIResourceTextId\r
 
 enum FontLanguageId : uint8_t {
index fd0fdf7..9c38b26 100644 (file)
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
index 0e10562..6830f46 100644 (file)
@@ -317,7 +317,7 @@ STR_15_SECONDS$15 s
 STR_30_SECONDS$30 s\r
 STR_60_SECONDS$60 s\r
 STR_300_SECONDS$300 s\r
-STR_4G_CAPABILITY$4G capability\r
+STR_4G_CAPABILITY$4G\r
 STR_VOLTE_CALL$VoLTE call\r
 STR_MOBILE_DATA_OPTION$Mobile data option\r
 STR_SYSTEM_UPDATE$System Update\r
@@ -498,4 +498,6 @@ STR_STEP_FREQUENCY$Step frequency (steps/min)
 STR_STEP_LENGTH$Stride length (CM)\r
 STR_AVG_PACE$Average pace\r
 STR_TONGYI_QIANWEN$Tongyi Qianwen\r
-STR_IFLYTEK_SPARK$Xunfei Spark
\ No newline at end of file
+STR_IFLYTEK_SPARK$Xunfei Spark\r
+STR_DISTURBNOTE_OFF$Do not disturb mode is enabled or disabled\r
+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
index e1b9379..2ca45f0 100644 (file)
@@ -317,7 +317,7 @@ STR_15_SECONDS$15秒
 STR_30_SECONDS$30秒\r
 STR_60_SECONDS$60秒\r
 STR_300_SECONDS$300秒\r
-STR_4G_CAPABILITY$4G能力\r
+STR_4G_CAPABILITY$4G\r
 STR_VOLTE_CALL$VoLTE 通话\r
 STR_MOBILE_DATA_OPTION$移动数据选项\r
 STR_SYSTEM_UPDATE$系统更新\r
@@ -498,4 +498,6 @@ STR_STEP_FREQUENCY$步频(步/分钟)
 STR_STEP_LENGTH$步幅(CM)\r
 STR_AVG_PACE$平均配速\r
 STR_TONGYI_QIANWEN$通义千问\r
-STR_IFLYTEK_SPARK$讯飞星火
\ No newline at end of file
+STR_IFLYTEK_SPARK$讯飞星火\r
+STR_DISTURBNOTE_OFF$勿扰模式已开启是否关闭\r
+STR_4G_NOTE$注:开启后,手表功耗会提高,待机时间会缩短
\ No newline at end of file
index c0bf0b9..7e54f22 100644 (file)
        <lanstr id="STR_30_SECONDS" value="30 s"/>
        <lanstr id="STR_60_SECONDS" value="60 s"/>
        <lanstr id="STR_300_SECONDS" value="300 s"/>
-       <lanstr id="STR_4G_CAPABILITY" value="4G capability"/>
+       <lanstr id="STR_4G_CAPABILITY" value="4G"/>
        <lanstr id="STR_VOLTE_CALL" value="VoLTE call"/>
        <lanstr id="STR_MOBILE_DATA_OPTION" value="Mobile data option"/>
        <lanstr id="STR_SYSTEM_UPDATE" value="System Update"/>
        <lanstr id="STR_AVG_PACE" value="Average pace"/>
        <lanstr id="STR_TONGYI_QIANWEN" value="Tongyi Qianwen"/>
        <lanstr id="STR_IFLYTEK_SPARK" value="Xunfei Spark"/>
+       <lanstr id="STR_DISTURBNOTE_OFF" value="Do not disturb mode is enabled or disabled"/>
+       <lanstr id="STR_4G_NOTE" value="Note: After opening, the power consumption of the watch will be increased and the standby time will be shortened"/>
 </language>
index bec22e9..8bce54a 100644 (file)
        <lanstr id="STR_30_SECONDS" value="30秒"/>
        <lanstr id="STR_60_SECONDS" value="60秒"/>
        <lanstr id="STR_300_SECONDS" value="300秒"/>
-       <lanstr id="STR_4G_CAPABILITY" value="4G能力"/>
+       <lanstr id="STR_4G_CAPABILITY" value="4G"/>
        <lanstr id="STR_VOLTE_CALL" value="VoLTE 通话"/>
        <lanstr id="STR_MOBILE_DATA_OPTION" value="移动数据选项"/>
        <lanstr id="STR_SYSTEM_UPDATE" value="系统更新"/>
        <lanstr id="STR_AVG_PACE" value="平均配速"/>
        <lanstr id="STR_TONGYI_QIANWEN" value="通义千问"/>
        <lanstr id="STR_IFLYTEK_SPARK" value="讯飞星火"/>
+       <lanstr id="STR_DISTURBNOTE_OFF" value="勿扰模式已开启是否关闭"/>
+       <lanstr id="STR_4G_NOTE" value="注:开启后,手表功耗会提高,待机时间会缩短"/>
 </language>
index 7ab73a5..c67adb7 100644 (file)
Binary files a/tools/language_tool/font/en.lang and b/tools/language_tool/font/en.lang differ
index 71fa640..9443534 100644 (file)
@@ -511,7 +511,9 @@ enum UIResourceTextId : uint16_t {
     STR_AVG_PACE = 498,\r
     STR_TONGYI_QIANWEN = 499,\r
     STR_IFLYTEK_SPARK = 500,\r
-    STR_MAX_ID = 501,\r
+    STR_DISTURBNOTE_OFF = 501,\r
+    STR_4G_NOTE = 502,\r
+    STR_MAX_ID = 503,\r
 }; // UIResourceTextId\r
 
 enum FontLanguageId : uint8_t {
index fd0fdf7..9c38b26 100644 (file)
Binary files a/tools/language_tool/font/zh.lang and b/tools/language_tool/font/zh.lang differ