From: luozheng <1732036298@qq.com> Date: Fri, 9 Jan 2026 07:41:41 +0000 (+0800) Subject: 解决计算器页面息屏后按键监听失效问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=3ab121d6b8c1398c251f6e3806ef88a19494fcd1;p=mirrors%2FFD230.git 解决计算器页面息屏后按键监听失效问题 --- diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/applist/include/ApplistView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/applist/include/ApplistView.h index 0a4ad1bbd..546696221 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/applist/include/ApplistView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/applist/include/ApplistView.h @@ -54,7 +54,7 @@ public: if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) && (event.GetDeltaX() > X_DRAG_OFFSET) && (event.GetDeltaX() > (DOUBLES * MATH_ABS(event.GetDeltaY())))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Applist Ondrag!!"); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TransitionType::TRANSITION_INVALID); } return false; diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/include/CalculatorPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/include/CalculatorPresenter.h index 5cb691954..2f9697be3 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/include/CalculatorPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/include/CalculatorPresenter.h @@ -27,7 +27,7 @@ public: ~CalculatorPresenter() override; void OnStart() override; - + void OnResume() override; static CalculatorPresenter *GetInstance(void); bool OnClick(UIView &view, const ClickEvent &event) override; diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/src/CalculatorPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/src/CalculatorPresenter.cpp index ec15f74de..927425e6b 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/src/CalculatorPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/calculator/src/CalculatorPresenter.cpp @@ -44,6 +44,10 @@ void CalculatorPresenter::OnStart() Presenter::OnStart(); } +void CalculatorPresenter::OnResume() +{ + RootView::GetInstance()->SetOnKeyActListener(this); +}