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

49 lines
1.1 KiB
C++

#ifndef TJDUI_OPENLOGO_VIEW
#define TJDUI_OPENLOGO_VIEW
#include "View.h"
#include "graphic_timer.h"
#include "ui_image_animator.h"
#include "TjdUiAppOpenLogoPresenter.h"
namespace TJD {
class OpenLogoAnimator : public OHOS::UIImageAnimatorView, public OHOS::UIImageAnimatorView::AnimatorStopListener
{
public:
OpenLogoAnimator();
~OpenLogoAnimator()
{
if (timer != nullptr) {
delete timer;
timer = nullptr;
}
}
void OnAnimatorStop(UIView &view) override
{
if (timer != nullptr) {
timer->Start();
}
}
private:
OHOS::GraphicTimer *timer;
};
class TjdUiOpenLogoPresenter;
class TjdUiOpenLogoView : public OHOS::View<TjdUiOpenLogoPresenter>
{
public:
TjdUiOpenLogoView();
~TjdUiOpenLogoView();
static TjdUiOpenLogoView *GetInstance();
void OnStart() override;
void OnStop() override;
private:
OHOS::UIViewGroup *containerAll_{nullptr};
OpenLogoAnimator *logo_ = nullptr;
};
} // namespace TJD
#endif