mcu_hi3321_watch/tjd/ui/app/open_logo/TjdUiAppOpenLogoPresenter.cpp
2025-05-26 20:15:20 +08:00

40 lines
1.3 KiB
C++

#include "TjdUiAppOpenLogoPresenter.h"
#include "graphic_timer.h"
#include "TjdUiImageIds.h"
#include "common/image_cache_manager.h"
#include "TjdUiAppOpenLogoView.h"
#include "TjdUiRegisterManager.h"
using namespace OHOS;
namespace TJD {
TJD_REGIST_SLICE(TJD_APP_VIEW_OPEN_LOGO, TjdUiOpenLogoView, TjdUiOpenLogoPresenter);
#define IMAGE_OPEN_LOGO_PATH "/user/tjd_res/img_open_logo.bin"
TjdUiOpenLogoPresenter *g_pv_TjdUiOpenLogoPresenter = nullptr;
TjdUiOpenLogoPresenter::TjdUiOpenLogoPresenter()
{
printf("TjdUiOpenLogoPresenter construction ! \n");
g_pv_TjdUiOpenLogoPresenter = this;
for (int i=0; i<IMAGE_NUM; i++) {
imgInfo_[i].pos = {78, 129};
imgInfo_[i].width = 308;
imgInfo_[i].height = 222;
imgInfo_[i].imageType = IMG_SRC_IMAGE_INFO;
imgInfo_[i].imageInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(IMG_OPEN_LOGO_01+i, IMAGE_OPEN_LOGO_PATH);
}
}
TjdUiOpenLogoPresenter::~TjdUiOpenLogoPresenter()
{
printf("TjdUiOpenLogoPresenter unconstruction ! \n");
g_pv_TjdUiOpenLogoPresenter = nullptr;
OHOS::ImageCacheManager::GetInstance().UnloadAllInMultiRes(IMAGE_OPEN_LOGO_PATH);
}
TjdUiOpenLogoPresenter *TjdUiOpenLogoPresenter::GetInstance() { return g_pv_TjdUiOpenLogoPresenter; }
} // namespace TJD