#include "schedule/include/ScheduleData.h"
#include "sleepmode/include/SleepModePresenter.h"
+#include "ui_service.h"
+extern "C" void uapi_dev_runtime_set_lock_status(uint8_t status);
+extern "C" uint8_t uapi_dev_runtime_get_lock_status(void);
+
#ifdef SUPPORT_ALIPAY_SEC
#include "AlipayMainView.h"
#include "AlipayPresenter.h"
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Power is Charging!");
DialModelCharge::GetInstance()->UpdatechargeStatus(1);
}
+
/*开机读取天气历史数据*/
-
C_ScheduleDataReadFromFile();
mmi_sleep_mode_switch_read();
+
+ /*开机如果设置了密码锁,进行锁屏*/
+ int lockstate = OHOS::ConfigModel::GetInstance()->get_configData_int(OHOS::ConfigModel::CONFIGMODEL_ITEM_PASSWORD_SWITCH);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "lockstate = %d", lockstate);
+ // 打印锁定状态判断
+ if (lockstate == 1)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Native ability state is active.");
+ if (uapi_dev_runtime_get_lock_status() == 0)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Device is unlocked (lock status == 0).");
+ uapi_dev_runtime_set_lock_status(1); // 上锁
+ OHOS::MainModel::GetInstance().setDialState(OHOS::DialState::LOCK, true);
+ }
+ }
}
}
SportData *GetSportdata(); /*获取训练数据*/
void SetIntensity(int heart); /*设置训练强度*/
UIResourceTextId GetIntensity(); /*获取训练强度STR*/
+ uint32_t GetSportTime(); /*获取目前运动时长*/
bool SaveSportData(); /*保存数据*/
void SendLiveData(); /*发送实时数据*/
int CalculateAverageHeartRate(int newHeartRate); /*平均心率计算*/
{
return Openstate;
}
-
+ /*获取运动时长*/
+ uint32_t TraingModel::GetSportTime()
+ {
+ return sportdata->duration;
+ }
/*获取训练量是否达标*/
bool TraingModel::GetMomentum() {
#if 0
#include "traing/training_card/include/TrainingControlView.h"\r
#include "uicomponents/UIComponents.h"\r
#include "vibrator_service.h"\r
+\r
#include <chrono>\r
#include <iomanip>\r
#include <iostream>\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ExerciseState::End [%d]\r\n",\r
cmdState);\r
\r
+ uint32_t sport_time = TraingModel::GetInstance()->GetSportTime();\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sport_time[%d]\r\n", sport_time);\r
+\r
switch (cmdState) {\r
case ExerciseState::End:\r
+ reply_APP_SportStopModeCmd(sport_time);\r
handleEndState();\r
break;\r
case ExerciseState::Pause:\r
+ reply_APP_SportPasueResetCmd(sport_time);\r
handlePauseState();\r
break;\r
case ExerciseState::Continue:\r
+ reply_APP_SportPasueResetCmd(sport_time);\r
handleContinueState();\r
break;\r
case ExerciseState::Start:\r
}\r
}\r
\r
-void reply_APP_StopSportModeCmd(uint16_t time)\r
+void reply_APP_SportStopModeCmd(uint16_t time)\r
{\r
char data[3]={0};\r
uint32_t data_len=3;\r
void reply_APP_SportPasueResetCmd(uint16_t time);
-void reply_APP_StopSportModeCmd(uint16_t time);
+void reply_APP_SportStopModeCmd(uint16_t time);
///////////////////////////自定义文件传输协议/////////////////////////////
#define OTA_FILE_MSG_CMD 0x0601
}
distance = CalculateElasticDragLen(reboundSize, offset, distance);
}
- if ((childrenTail_->GetRelativeRect().GetBottom() + distance) <
+ if (childrenTail_->GetRelativeRect().GetBottom() <
+ (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) {
+ distance = 0;
+ } else if ((childrenTail_->GetRelativeRect().GetBottom() + distance) <
(listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) {
distance = listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)
- childrenTail_->GetRelativeRect().GetBottom();
}
}
}
+ // } else {
+ // if (childrenTail_ != nullptr) {
+ // if (isElastic_ && (reboundSize > 0) &&
+ // (childrenTail_->GetRelativeRect().GetBottom() <
+ // (listHeight - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)))) {
+ // int16_t offset = (listHeight - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))
+ // - (childrenTail_->GetRelativeRect().GetBottom());
+ // if (offset > reboundSize) {
+ // offset = reboundSize;
+ // }
+ // distance = CalculateElasticDragLen(reboundSize, offset, distance);
+ // }
+ // if ((childrenTail_->GetRelativeRect().GetBottom() + distance) <
+ // (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) {
+ // distance = listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)
+ // - childrenTail_->GetRelativeRect().GetBottom();
+ // }
+ // }
+ // }
return MoveOffset(0, distance);
}