From dd8b7633e07386229cf66d56ed2c571546602acd Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Thu, 8 Jan 2026 11:21:55 +0800 Subject: [PATCH] =?utf8?q?=E7=A6=85=E9=81=931655=EF=BC=8C=E8=A7=A3?= =?utf8?q?=E5=86=B3=E6=89=8B=E8=A1=A8=EF=BC=8C=E8=BF=9B=E5=85=A5=E5=8D=A1?= =?utf8?q?=E7=89=87=E7=AE=A1=E7=90=86=E5=90=8E=EF=BC=8C=E7=AD=89=E5=BE=85?= =?utf8?q?=E6=89=8B=E8=A1=A8=E8=87=AA=E5=8A=A8=E6=81=AF=E5=B1=8F=EF=BC=8C?= =?utf8?q?=E6=81=AF=E5=B1=8F=E5=90=8E=E5=86=8D=E4=B8=BB=E5=8A=A8=E5=94=A4?= =?utf8?q?=E9=86=92=E5=B1=8F=E5=B9=95=EF=BC=8C=E6=97=8B=E8=BD=AC=E7=BC=96?= =?utf8?q?=E7=A0=81=E5=99=A8=EF=BC=8C=E6=97=A0=E6=B3=95=E6=97=8B=E8=BD=AC?= =?utf8?q?=E5=88=87=E6=8D=A2=E5=8D=A1=E7=89=87bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeapp/nativeui/add_card/include/AddCardView.h | 1 + .../nativeapp/nativeui/add_card/src/AddCardPresenter.cpp | 4 ++++ .../nativeapp/nativeui/add_card/src/AddCardView.cpp | 5 +++++ .../nativeui/set_card/include/SetCardPresenter.h | 1 - .../nativeapp/nativeui/set_card/include/SetCardView.h | 1 + .../nativeapp/nativeui/set_card/src/SetCardPresenter.cpp | 7 ++++--- .../nativeapp/nativeui/set_card/src/SetCardView.cpp | 9 +++++++-- 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/include/AddCardView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/include/AddCardView.h index e82b8cd85..fdd9784dc 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/include/AddCardView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/include/AddCardView.h @@ -38,6 +38,7 @@ public: void RefreshCardList(void); void ExceedsCardCountEvent(bool isVisible); + UIList *GetAddCardList(void); private: void SetUpListInfo(void); void SetUpListView(void); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp index df60ed0ae..cd99156b4 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp @@ -37,6 +37,10 @@ namespace OHOS void AddCardPresenter::OnResume() { RootView::GetInstance()->SetOnKeyActListener(this); + if (view_->GetAddCardList() != nullptr) + { + view_->GetAddCardList()->RequestFocus(); + } } bool AddCardPresenter::OnDrag(UIView &view, const DragEvent &event) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/src/AddCardView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/src/AddCardView.cpp index 87a1c4605..f6b63f654 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/src/AddCardView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/add_card/src/AddCardView.cpp @@ -71,6 +71,11 @@ namespace OHOS } } + UIList *AddCardView::GetAddCardList(void) + { + return &contentList_; + } + void AddCardView::SetUpListView(void) { contentList_.SetPosition(0, 0); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/include/SetCardPresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/include/SetCardPresenter.h index 5c711a653..32901cdd7 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/include/SetCardPresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/include/SetCardPresenter.h @@ -48,7 +48,6 @@ public: void OnStart() override; void OnResume() override; - void OnStop() override; bool OnClick(UIView &view, const ClickEvent &event) override; void OnScrollStart(int16_t index, UIView *view) override; void OnScrollEnd(int16_t index, UIView *view) override; diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/include/SetCardView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/include/SetCardView.h index 32b60a9a5..6940b9262 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/include/SetCardView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/include/SetCardView.h @@ -42,6 +42,7 @@ public: void ShowAddView(bool show); void RefreshCardList(void); void SaveSelectCardIndex(void); + UIList *GetCardList(void); private: void SetUpListInfo(void); void SetUpListView(void); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp index 19b923946..85c978e91 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp @@ -31,12 +31,13 @@ namespace OHOS void SetCardPresenter::OnResume(void) { + if (view_->GetCardList() != nullptr) + { + view_->GetCardList()->RequestFocus(); + } } - void SetCardPresenter::OnStop(void) - { - } bool SetCardPresenter::OnClick(UIView &view, const ClickEvent &event) { diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/src/SetCardView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/src/SetCardView.cpp index 89e76c83b..8d88bec74 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/src/SetCardView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_card/src/SetCardView.cpp @@ -12,12 +12,12 @@ namespace OHOS { SetCardView::SetCardView():contentList_(UIList::HORIZONTAL) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::SetCardView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetCardView::SetCardView"); } SetCardView::~SetCardView() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::~SetCardView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetCardView::~SetCardView"); if (deleteView_ != nullptr) { delete deleteView_; deleteView_ = nullptr; @@ -77,6 +77,11 @@ void SetCardView::SetUpListInfo(void) } } +UIList *SetCardView::GetCardList(void) +{ + return &contentList_; +} + void SetCardView::SetUpListView(void) { addImg_.SetPosition(187, 10); -- 2.17.1