g_pMainPresenterSample = nullptr;
/*从主界面退出,关闭心率检测*/
HeartModel::GetInstance()->Heart_Stop();
- HeartModel::GetInstance()->Heart_Control(HeartState::End,
- HeartCheck::CARDCHECK);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Heart_Stop");
+ HeartModel::GetInstance()->Heart_Control(HeartState::End, HeartCheck::CARDCHECK);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Heart_Control");
}
MainPresenterSample *MainPresenterSample::GetInstance(void)
void MainPresenterSample::OnPause()
{
+ if(view_ == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnPause: view_ is nullptr");
+ return;
+ }
// Save watchface content for slide back
UIView* watchFace = view_->GetViewById(WATCH_FACE)->GetParent();
uint8_t opaScale = watchFace->GetOpaScale();
PageTransitionMgr::GetInstance().SaveSlideBackSnapShotIfNecessary(watchFace);
watchFace->SetOpaScale(opaScale);
- uint8_t curCardId = view_->GetHorCurrentCard();
- UICardPage *card = view_->GetViewById(curCardId);
- if (card != nullptr) {
- card->OnPause();
- }
- mainPresenterState_ = MainPresenterState::PAUSE;
-
+ uint8_t curCardId = view_->GetHorCurrentCard();
+ UICardPage *card = view_->GetViewById(curCardId);
+ if (card != nullptr) {
+ card->OnPause();
+ }
+ mainPresenterState_ = MainPresenterState::PAUSE;
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnPause: mainPresenterState_ = %d", mainPresenterState_);
//进行视频表盘的暂停
// WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "暂停视频") ;
// DialSetting &setting = GetDialSetting();
// DialModelTime::GetInstance()->UpdateTime();
// dynamic_cast<DialViewGroup *>(view_->GetViewById(WATCH_FACE))->StartDial();
// }
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnResume: mainPresenterState_ = %d", mainPresenterState_);
}
void MainPresenterSample::OnStop(void)
{
mainPresenterState_ = MainPresenterState::STOP;
- if (isCompassSensorOpened_) {
- CompassModel::GetInstance()->CloseCompassSensor();
- }
-
PullUpDown_StopTimer();
- CloseCompassSensor(); //切换Slice时要关闭指南针传感器
}
MainPresenterState MainPresenterSample::GetMainPresenterState(void)