禅道1628,解决表冠功能--生理期编辑页面转表冠没有功能,需要优化bug 3056/1 3056/head 3057/target/1
authorluozheng <1732036298@qq.com>
Fri, 9 Jan 2026 02:48:47 +0000 (10:48 +0800)
committerluozheng <1732036298@qq.com>
Fri, 9 Jan 2026 02:48:47 +0000 (10:48 +0800)
code/sdk/application/wearable/fd272/nativeapp/nativeui/womenhealth/include/WomenHealthSettingPage.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/womenhealth/src/WomenHealthPresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/womenhealth/src/WomenHealthSettingPage.cpp

index 2dc4508..483e84e 100644 (file)
@@ -27,11 +27,12 @@ class WomenHealthSettingPage : public SlicePage<WomenHealthPresenter>,
 public:
     WomenHealthSettingPage();
     ~WomenHealthSettingPage() override;
+    static WomenHealthSettingPage* GetInstance();
     
     void OnStart(void* data) override;
     bool OnDrag(UIView& view, const DragEvent& event) override;
     bool OnClick(UIView& view, const ClickEvent& event) override;
-    
+    UIList* GetDateList();
 private:
     void InitView();                    // 初始化视图
     void InitTitleLabel();              // 初始化标题
index 44d425b..e44e321 100644 (file)
@@ -11,6 +11,7 @@
  #include "gfx_utils/mem_check.h"
  #include "common/key_code.h"
  #include "womenhealth/include/WomenHealthPresenter.h"
+ #include "womenhealth/include/WomenHealthSettingPage.h"
  #include "custom_utils.h"
  #include "NativeRegisterManager.h"
  
  
      void WomenHealthPresenter::OnResume()
      {
-         RootView::GetInstance()->SetOnKeyActListener(this);
+        RootView::GetInstance()->SetOnKeyActListener(this);
+        if(WomenHealthSettingPage::GetInstance() != nullptr && 
+            WomenHealthSettingPage::GetInstance()->GetDateList() != nullptr)
+        {
+            WomenHealthSettingPage::GetInstance()->GetDateList()->RequestFocus();
+        }
      }
  
     bool WomenHealthPresenter::OnClick(UIView &view, const ClickEvent &event)
index 64e64e5..5ac6743 100644 (file)
@@ -32,9 +32,11 @@ static constexpr uint16_t LIST_POS_Y = 100;
 static constexpr uint16_t LIST_WIDTH = 394;
 static constexpr uint16_t LIST_HEIGHT = 354;
 
+static WomenHealthSettingPage* g_pWomenHealthSettingPage = nullptr;
 WomenHealthSettingPage::WomenHealthSettingPage()
 {
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WomenHealthSettingPage::WomenHealthSettingPage");
+    g_pWomenHealthSettingPage = this;
 }
 
 WomenHealthSettingPage::~WomenHealthSettingPage()
@@ -61,6 +63,14 @@ WomenHealthSettingPage::~WomenHealthSettingPage()
         delete adapter_;
         adapter_ = nullptr;
     }
+
+    g_pWomenHealthSettingPage = nullptr;
+}
+
+
+WomenHealthSettingPage* WomenHealthSettingPage::GetInstance()
+{
+    return g_pWomenHealthSettingPage;
 }
 
 void WomenHealthSettingPage::OnStart(void* data)
@@ -112,6 +122,11 @@ void WomenHealthSettingPage::InitTitleLabel()
     group_->Add(titleLabel_);
 }
 
+UIList* WomenHealthSettingPage::GetDateList()
+{
+    return dateList_;
+}
+
 void WomenHealthSettingPage::InitDateList()
 {
     // 创建列表
@@ -141,6 +156,7 @@ void WomenHealthSettingPage::InitDateList()
     // 设置适配器并刷新列表
     dateList_->SetAdapter(adapter_);
     dateList_->RefreshList();
+    dateList_->RequestFocus();
     
     // 添加到容器
     group_->Add(dateList_);