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(); // 初始化标题
#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)
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()
delete adapter_;
adapter_ = nullptr;
}
+
+ g_pWomenHealthSettingPage = nullptr;
+}
+
+
+WomenHealthSettingPage* WomenHealthSettingPage::GetInstance()
+{
+ return g_pWomenHealthSettingPage;
}
void WomenHealthSettingPage::OnStart(void* data)
group_->Add(titleLabel_);
}
+UIList* WomenHealthSettingPage::GetDateList()
+{
+ return dateList_;
+}
+
void WomenHealthSettingPage::InitDateList()
{
// 创建列表
// 设置适配器并刷新列表
dateList_->SetAdapter(adapter_);
dateList_->RefreshList();
+ dateList_->RequestFocus();
// 添加到容器
group_->Add(dateList_);