From d5b118a6fbd018acaecfe3c08076e72e47af0bcb Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Tue, 10 Mar 2026 14:42:05 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E5=8D=95=E7=8B=AC=E4=B8=8A?= =?utf8?q?=E6=8B=89=E8=BF=9B=E5=85=A5=E4=BF=A1=E6=81=AF=E8=A1=A8=E5=86=A0?= =?utf8?q?=E5=A4=B1=E7=84=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/main/src/MainPresenterSample.cpp | 13 ++++++++----- .../nativeui/message/include/MessageControlView.h | 3 ++- .../nativeui/message/src/MessageControlView.cpp | 7 +++++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/MainPresenterSample.cpp index dad1bdbb4..fb1192cb7 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/MainPresenterSample.cpp @@ -315,11 +315,14 @@ PullUpDownView::GetInstance()->UpdateSignalStrengthStatusAndBatteryPosition(); PullUpDown_StartTimer(2000); } - } else if (MainViewSample::GetInstance()->IsPullUpViewPage() == DROPDOWN) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "开始上拉更新"); - isPullDownPageView = false; - PullUpDown_StopTimer(); - } else { + } else if (MainViewSample::GetInstance()->IsPullUpViewPage() == DROPDOWN) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "开始上拉更新"); + isPullDownPageView = false; + PullUpDown_StopTimer(); + if (MessageControlView::GetInstance() != nullptr) { + MessageControlView::GetInstance()->RequestFocusForMessageList(); + } + } else { isPullDownPageView = false; PullUpDown_StopTimer(); } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/message/include/MessageControlView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/message/include/MessageControlView.h index 16b411a7d..f0ac39455 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/message/include/MessageControlView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/message/include/MessageControlView.h @@ -33,7 +33,8 @@ namespace OHOS void PreLoad(void) override; void UnLoad(void) override; void SetLackView(bool flag); - + /** 让消息列表请求焦点,便于表冠滚动生效(主界面上拉进入消息页时调用) */ + void RequestFocusForMessageList(); private: MessageLackView *messageLackView{nullptr}; diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/message/src/MessageControlView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/message/src/MessageControlView.cpp index d95047a63..832bb2ddb 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/message/src/MessageControlView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/message/src/MessageControlView.cpp @@ -101,6 +101,13 @@ void MessageControlView::SetLackView(bool flag) { } } +void MessageControlView::RequestFocusForMessageList() { + if (messageCardView != nullptr && messageCardView->GetList() != nullptr) { + messageCardView->GetList()->RequestFocus(); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MessageControlView::RequestFocusForMessageList"); + } +} + void MessageControlView::PreLoad(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MessageControlView::PreLoad"); if (!viewiInitStatus) { -- 2.17.1