116 lines
3.4 KiB
C++
116 lines
3.4 KiB
C++
/*----------------------------------------------------------------------------
|
|
* Copyright (c) TJD Technologies Co., Ltd. 2024. All rights reserved.
|
|
*
|
|
* Description:
|
|
*
|
|
* Author: huangshuyi
|
|
*
|
|
* Create: 2024-8
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
#include "TjdUiFemaleWaitFailPage.h"
|
|
#include "components/ui_label.h"
|
|
#include "wearable_log.h"
|
|
#include "common/image_cache_manager.h"
|
|
#include <time.h>
|
|
#include <unordered_map>
|
|
#include "gfx_utils/image_info.h"
|
|
#include "gfx_utils/heap_base.h"
|
|
#include "TjdUiImageIds.h"
|
|
#include "ui_label.h"
|
|
#include "ui_label_ext.h"
|
|
#include "components/ui_label_ext.h"
|
|
#include "components/ui_view.h"
|
|
#include "TjdUiMultiLanguageExt.h"
|
|
#include "sys_config.h"
|
|
#include "TjdUiMemManage.h"
|
|
#include <ctime>
|
|
#include "sql_message.h"
|
|
#include "TjdUiFemaleHealthView.h"
|
|
|
|
|
|
using namespace OHOS;
|
|
|
|
namespace TJD {
|
|
|
|
#define ENABLE_PRINT_INFO 1
|
|
#if ENABLE_PRINT_INFO
|
|
#define static_print_info(...) sys_ui_log_i(__VA_ARGS__) //一般信息打印宏控制
|
|
#define static_print_warn(...) sys_ui_log_w(__VA_ARGS__) //警告信息打印一般常开
|
|
#define static_print_error(...) sys_ui_log_e(__VA_ARGS__) //错误信息打印一般常开
|
|
#define static_print_debug(...) sys_ui_log_d(__VA_ARGS__)
|
|
#else
|
|
#define static_print_info(...)
|
|
#define static_print_warn(...)
|
|
#define static_print_error(...)
|
|
#define static_print_debug(...)
|
|
#endif
|
|
|
|
#define IMAGE_BIN_PATH TJD_IMAGE_PATH"img_female.bin"
|
|
|
|
static TjdUiFemaleWaitFailPage *g_pFemaleFailData = nullptr;
|
|
|
|
TjdUiFemaleWaitFailPage::TjdUiFemaleWaitFailPage()
|
|
{
|
|
//SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
|
|
g_pFemaleFailData = this;
|
|
}
|
|
|
|
TjdUiFemaleWaitFailPage::~TjdUiFemaleWaitFailPage()
|
|
{
|
|
g_pFemaleFailData = nullptr;
|
|
}
|
|
|
|
TjdUiFemaleWaitFailPage *TjdUiFemaleWaitFailPage::GetInstance(void)
|
|
{
|
|
return g_pFemaleFailData;
|
|
}
|
|
|
|
void TjdUiFemaleWaitFailPage::HideView(void)
|
|
{
|
|
static_print_debug("TjdUiFemaleWaitFailPage::HideView\n");
|
|
pageGroup_->SetVisible(false);
|
|
}
|
|
|
|
void TjdUiFemaleWaitFailPage::ShowView(void)
|
|
{
|
|
static_print_debug("TjdUiFemaleWaitFailPage::ShowView\n");
|
|
pageGroup_->SetVisible(true);
|
|
}
|
|
|
|
bool TjdUiFemaleWaitFailPage::OnClick(UIView &view, const ClickEvent &event)
|
|
{
|
|
static_print_debug("TjdUiFemaleWaitFailPage::retry to send ble request\n");
|
|
return true;
|
|
}
|
|
|
|
UIViewGroup *TjdUiFemaleWaitFailPage::PageInit(void)
|
|
{
|
|
UIViewGroup *container = (UIViewGroup *)TjdUiFemaleHealthView::GetInstance()->GetContainer();
|
|
pageGroup_ = new UIViewGroup();
|
|
container->Add(pageGroup_);
|
|
pageGroup_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());
|
|
|
|
UILabel *labelFail = new UILabel();
|
|
pageGroup_->Add(labelFail);
|
|
labelFail->SetFont(TJD_VECTOR_FONT_FILENAME, 34);
|
|
pageGroup_->Add(labelFail);
|
|
labelFail->SetText("加载失败,请重试");
|
|
labelFail->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
|
|
labelFail->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
|
|
labelFail->LayoutCenterOfParent(0, 0);
|
|
|
|
ImageInfo* imgInfo;
|
|
imageRetry_ = new UIImageView();
|
|
imgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(IMG_FEMALE_RETRY, IMAGE_BIN_PATH);
|
|
pageGroup_->Add(imageRetry_);
|
|
imageRetry_->SetPosition(52, 380);
|
|
imageRetry_->SetSrc(imgInfo);
|
|
imageRetry_->SetOnClickListener(this);
|
|
imageRetry_->SetTouchable(true);
|
|
|
|
return pageGroup_;
|
|
}
|
|
|
|
}
|