66 lines
1.6 KiB
C++
66 lines
1.6 KiB
C++
#ifndef TJD_UI_APP_MS_GAME_VIEW_H
|
|
#define TJD_UI_APP_MS_GAME_VIEW_H
|
|
|
|
#include "TjdUiAppMSGamePresenter.h"
|
|
#include "View.h"
|
|
#include "components/ui_image_view.h"
|
|
#include "components/ui_label_ext.h"
|
|
#include "components/ui_scroll_view.h"
|
|
#include "components/ui_scroll_view_nested.h"
|
|
|
|
namespace TJD {
|
|
|
|
class MSGameViewBase : public OHOS::UIScrollViewNested
|
|
{
|
|
public:
|
|
MSGameViewBase() { SetHorizontalScrollState(false); }
|
|
virtual ~MSGameViewBase() {}
|
|
virtual void ShowView() { SetVisible(true); };
|
|
virtual void HideView() { SetVisible(false); };
|
|
};
|
|
|
|
class MSGameMainView : public MSGameViewBase
|
|
{
|
|
public:
|
|
MSGameMainView();
|
|
~MSGameMainView() { RemoveAll(); }
|
|
|
|
private:
|
|
OHOS::UIImageView bg_;
|
|
OHOS::UILabelExt desc_;
|
|
OHOS::UILabelExt descButtom_;
|
|
};
|
|
|
|
class MSGameDisConnectView : public MSGameViewBase
|
|
{
|
|
public:
|
|
MSGameDisConnectView();
|
|
~MSGameDisConnectView() { RemoveAll(); }
|
|
|
|
private:
|
|
OHOS::UIImageView bg_;
|
|
OHOS::UILabelExt desc_;
|
|
OHOS::UILabelExt descButtom_;
|
|
};
|
|
|
|
class TjdUiAppMSGamePresenter;
|
|
class TjdUiAppMSGameView : public OHOS::View<TjdUiAppMSGamePresenter>
|
|
{
|
|
public:
|
|
TjdUiAppMSGameView();
|
|
~TjdUiAppMSGameView();
|
|
static TjdUiAppMSGameView *GetInstance(void);
|
|
void OnStart() override;
|
|
void OnStop() override;
|
|
void ShowView(MSGameViewIndex showIndex);
|
|
static MSGameViewIndex currentViewIndex_;
|
|
|
|
private:
|
|
MSGameViewBase *viewManager_[MSGameViewIndex::MS_GAME_UNKNOWN]{nullptr};
|
|
OHOS::UIScrollView *mainView_{nullptr};
|
|
void InitTargetView(MSGameViewIndex index);
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |