From: luozheng <1732036298@qq.com> Date: Wed, 28 Feb 2024 02:59:56 +0000 (+0800) Subject: 为血氧界面适配功能按键退出功能,能通过功能键进入和退出(限主界面) X-Git-Tag: release_V1.2.70_20241020_135402~1298^2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=7a2f9ed6af6b34646f354f323a4c479003179c5c;p=mirrors%2FFD230.git 为血氧界面适配功能按键退出功能,能通过功能键进入和退出(限主界面) --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/include/BloodOxygenPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/include/BloodOxygenPresenter.h index c906a5aaf..0164c1a4e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/include/BloodOxygenPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/include/BloodOxygenPresenter.h @@ -41,6 +41,7 @@ private: void ReturnInterface(void); void ProgressNotify(void); int count; + KeyInputListener *keyActListenr{nullptr}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp index 0949112c6..34ff7f2c3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp @@ -27,6 +27,11 @@ BloodOxygenPresenter::BloodOxygenPresenter() BloodOxygenPresenter::~BloodOxygenPresenter() { + if (keyActListenr != nullptr) + { + delete keyActListenr; + keyActListenr = nullptr; + } g_pMainView = nullptr; } @@ -39,6 +44,16 @@ void BloodOxygenPresenter::OnStart() { Presenter::OnStart(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodOxygenPresenter::On Start "); + + if (keyActListenr == nullptr) + { + keyActListenr = new KeyInputListener(); + if (keyActListenr != nullptr) { + RootView::GetInstance()->SetOnKeyActListener(keyActListenr); + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodOxygenPresenter::OnStart: new KeyInputListener fail"); + } + } } void BloodOxygenPresenter::OnPause(void) {}