From 0d0b0c4f7b086d71bd46b6927c723861eef9a821 Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Tue, 26 Aug 2025 14:38:14 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E4=B9=85=E5=9D=90=E6=8F=90?= =?utf8?q?=E9=86=92=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/SedentarySettingModel.cpp | 30 ++++++++++++------- .../nativeui/system/src/SystemView.cpp | 2 +- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/sedentary_setting/src/SedentarySettingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/sedentary_setting/src/SedentarySettingModel.cpp index cb120e008..d1800d438 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/sedentary_setting/src/SedentarySettingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/sedentary_setting/src/SedentarySettingModel.cpp @@ -1,19 +1,27 @@ #include "sedentary_setting/include/SedentarySettingModel.h" +#include "ConfigModelC.h" +#include "ConfigModel.h" #include "custom_runtime.h" -namespace OHOS { - -void SedentarySettingModel::SetSwitch(bool enable) +namespace OHOS { - uapi_dev_runtime_set_sedentary_status(enable ? 1 : 0); -} -bool SedentarySettingModel::GetSwitch() -{ - return uapi_dev_runtime_get_sedentary_status() ? true : false; -} - -} // namespace OHOS + void SedentarySettingModel::SetSwitch(bool enable) + { + if (enable == true) + { + ConfigModel::GetInstance()->SetSedentarySwitch(true); + ConfigModel::GetInstance()->SetSedentaryInterval(1); + } + else + ConfigModel::GetInstance()->SetSedentarySwitch(false); + } + bool SedentarySettingModel::GetSwitch() + { + + return (ConfigModel::GetInstance()->GetSedentarySwitch() == 1) ? true:false; + } +} // namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp index c89b58d9d..079f00070 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp @@ -172,7 +172,7 @@ namespace OHOS LabelSetup labelSetups[] = { {153, STR_ABOUT_WATCH}, // {273, STR_SYSTEM_UPDATE}, - {273, STR_TIME_FORMAT_SET}, + {273, STR_SEDENTARY_REMINDER}, {393, STR_TIME_FORMAT_SET}, {513, STR_WATCH_QR_CODE}, {633, STR_SYSTEM_LANGUAGE}, -- 2.17.1