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
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
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
* @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
static DnotDisturbModel &GetInstance(void);
void SetDoNotDisturbModeEnabled(bool enabled);
bool GetDoNotDisturbModeEnabled() const;
+ void UpdateDoNotDisturbMode(void);
private:
DnotDisturbModel();
* @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
{
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
* @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"
}
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())
{
* @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"
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);
* @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
*/
/*
UI_UPDATE_CALL_VOLUME, //更新通话音量
UI_UPDATE_VIBRATION_MODE, //更新震动模式
UI_UPDATE_SILENT_MODE, //更新静音模式
+ UI_UPDATE_DNOTDISTURB_MODE, //更新勿扰模式
UI_UPDATE_WEATHER_DATA, //天气数据更新
UI_UPDATE_SLEEP_DATA, //更新睡眠数据
#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"
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);
{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},
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)
{
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 {
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
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
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
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
<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>
<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>
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 {