From: xue <2144439972@qq.com> Date: Tue, 10 Mar 2026 06:42:05 +0000 (+0800) Subject: 修复单独上拉进入信息表冠失焦 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F3259%2F1;p=mirrors%2FFD230.git 修复单独上拉进入信息表冠失焦 --- 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) {