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

38 lines
1.0 KiB
C++

#ifndef TJDUI_APP_GAME_PRESENTER_H
#define TJDUI_APP_GAME_PRESENTER_H
#include "Presenter.h"
#include "TjdUiScreenDrag.h"
#include "components/ui_view.h"
#include "root_view.h"
namespace TJD {
class TjdUiAppGameView;
class TjdUiAppGameModel;
class TjdUiAppGamePresenter : public OHOS::Presenter<TjdUiAppGameView>,
public TjdUiScreenDragListener,
public OHOS::RootView::OnKeyActListener
{
public:
TjdUiAppGamePresenter();
virtual ~TjdUiAppGamePresenter();
static TjdUiAppGamePresenter *GetInstance(void);
void OnStart() override;
void OnPause() override;
void OnResume() override;
void OnStop() override;
bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event) override;
void ExitGameView(void);
void ScreenDragEventCallback(OHOS::UIView &view, const OHOS::DragEvent &event) override { ExitGameView(); }
private:
bool isExit_{false};
int16_t dragStartX_{0};
int16_t dragCurrentX_{0};
int32_t dragDistance_{0};
};
} // namespace TJD
#endif