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

56 lines
1.2 KiB
C++

#ifndef TJD_UI_APP_CHARGER_PRESENTER_H
#define TJD_UI_APP_CHARGER_PRESENTER_H
#include "Presenter.h"
#include "TjdUiTaskListener.h"
#include "animator/animator.h"
#include "components/root_view.h"
#include <string>
namespace TJD {
struct ChargerTime
{
uint8_t hour;
uint8_t min;
uint8_t date;
uint8_t week;
};
enum class GsensorDir
{
UP,
DOWN,
LEFT,
RIGHT,
NONE
};
class ChargerExitAnimatorCallback : public OHOS::AnimatorCallback
{
public:
void Callback(OHOS::UIView *view) override;
void OnStop(OHOS::UIView &view) override;
void SetAnimator(OHOS::Animator *animator) { animator_ = animator; }
void SetDirection(bool direction) { direction_ = direction; }
private:
uint32_t curTime_{0};
OHOS::Animator *animator_{nullptr};
bool direction_{false};
};
class TjdUiAppChargerPresenter : public OHOS::RootView::OnKeyActListener, public TjdUiTaskListener
{
public:
TjdUiAppChargerPresenter();
virtual ~TjdUiAppChargerPresenter();
static TjdUiAppChargerPresenter *GetInstance(void);
bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event) override;
void ViewExitEvent(bool isSwipe);
void Notify(void) override;
};
} // namespace TJD
#endif