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

40 lines
1.0 KiB
C++

#ifndef TJD_UI_APP_MS_GAME_PRESENTER_H
#define TJD_UI_APP_MS_GAME_PRESENTER_H
#include "Presenter.h"
#include "TjdUiScreenDrag.h"
#include "components/root_view.h"
#include "components/ui_view.h"
#include <cmsis_os.h>
namespace TJD {
enum MSGameViewIndex
{
MS_GAME_MAIN,
MS_GAME_DISCONNECT,
MS_GAME_UNKNOWN
};
class TjdUiAppMSGameView;
class TjdUiAppMSGamePresenter : public OHOS::Presenter<TjdUiAppMSGameView>,
public TjdUiScreenDragListener,
public OHOS::RootView::OnKeyActListener
{
public:
TjdUiAppMSGamePresenter();
virtual ~TjdUiAppMSGamePresenter();
static TjdUiAppMSGamePresenter *GetInstance(void);
void OnStart() override;
void OnStop() override;
bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event) override;
void ScreenDragEventCallback(OHOS::UIView &view, const OHOS::DragEvent &event) override { ViewExitEvent(true); }
private:
void ViewExitEvent(bool isSwipe);
osThreadId_t ms_game_task_id = NULL;
};
} // namespace TJD
#endif