From 0e1e9701443d92df1900eb7108209ec2ba3e4e83 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 21 Oct 2025 20:22:35 +0800 Subject: [PATCH] =?utf8?q?272=EF=BC=9A=E8=A7=A3=E5=86=B3=E5=8E=8B=E5=8A=9B?= =?utf8?q?=E7=95=8C=E9=9D=A2=E6=8C=89=E9=94=AE=E6=97=A0=E6=B3=95=E9=80=80?= =?utf8?q?=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeapp/nativeui/stress/include/stressTestModel.h | 6 +++--- .../nativeui/stress/include/stressTestPresenter.h | 1 + .../nativeapp/nativeui/stress/src/stressTestFailView.cpp | 6 +++--- .../nativeapp/nativeui/stress/src/stressTestPresenter.cpp | 7 ++++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/include/stressTestModel.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/include/stressTestModel.h index 98ee175f4..29b7ece91 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/include/stressTestModel.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/include/stressTestModel.h @@ -6,8 +6,8 @@ namespace OHOS { enum FailType :uint8_t { - FAIL_TYPE_NOT_WORN = 0,//未佩戴 - FAIL_TYPE_INVALID_DATA,//数据无效 + FAIL_TYPE_INVALID_DATA = 0,//数据无效 + FAIL_TYPE_NOT_WORN ,//未佩戴 FAIL_TYPE_OTHER,//其他错误 }; @@ -26,7 +26,7 @@ namespace OHOS StressTestModel(const StressTestModel &) = delete; StressTestModel &operator=(const StressTestModel &) = delete; uint8_t currentView{0}; - uint8_t currentFailType{FAIL_TYPE_NOT_WORN};//当前错误类型 + uint8_t currentFailType{FAIL_TYPE_INVALID_DATA};//当前错误类型 }; } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/include/stressTestPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/include/stressTestPresenter.h index 6a364dad5..fa0175781 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/include/stressTestPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/include/stressTestPresenter.h @@ -20,6 +20,7 @@ namespace OHOS static StressTestPresenter *GetInstance(); void OnStart() override; + void OnResume() override; uint8_t GetCurrentFailType(void); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/src/stressTestFailView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/src/stressTestFailView.cpp index 4ba57792c..613088727 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/src/stressTestFailView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/src/stressTestFailView.cpp @@ -211,7 +211,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "error1DescriptionLabel new fail!!"); return nullptr; } - error1DescriptionLabel->SetPosition(53, 230, 360, 70); + error1DescriptionLabel->SetPosition(53, 210, 360, 70); error1DescriptionLabel->SetText("请确认已带上手表,并保持静止"); error1DescriptionLabel->SetStyle(STYLE_TEXT_FONT, 30); error1DescriptionLabel->SetStyle(STYLE_LINE_HEIGHT, 35); @@ -229,7 +229,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "retryButton new fail!!"); return nullptr; } - retryButton->SetPosition(238, 328,170,90); + retryButton->SetPosition(238, 300,170,90); retryButton->SetText("重测"); retryButton->SetAlign(TEXT_ALIGNMENT_CENTER); retryButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); @@ -249,7 +249,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "stopButton new fail!!"); return nullptr; } - stopButton->SetPosition(58, 328,170,90); + stopButton->SetPosition(58, 300,170,90); stopButton->SetText("停止"); stopButton->SetAlign(TEXT_ALIGNMENT_CENTER); stopButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/src/stressTestPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/src/stressTestPresenter.cpp index d2a660982..6325d2c15 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/src/stressTestPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/src/stressTestPresenter.cpp @@ -41,6 +41,11 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "StressTestPresenter::OnStart"); } + void StressTestPresenter::OnResume() + { + RootView::GetInstance()->SetOnKeyActListener(this); + } + bool StressTestPresenter::OnClick(UIView &view, const ClickEvent &event) { @@ -109,7 +114,7 @@ namespace OHOS uint16_t keyID = event.GetKeyId(); uint16_t keyState = event.GetState(); // 如果是power键,且是亮屏状态,按键释放就返回上一级 - if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0) + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { NativeAbility::GetInstance().Back(); } -- 2.17.1