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

54 lines
1.5 KiB
C++

#ifndef TJDUI_APP_WALLET_PRESENTER_H
#define TJDUI_APP_WALLET_PRESENTER_H
#include "Presenter.h"
#include "components/ui_view.h"
#include "root_view.h"
#include "TjdUiScreenDrag.h"
enum WalletView
{
TIPVIEW = 0,
LISTVIEW,
CARDVIEW,
MAXTHVIEW
};
enum WalletItemIndex
{
WALLET_TITLE_INDEX = 0, // 卡包
WALLET_WECHAT_INDEX , // 微信
WALLET_ALIPAY_INDEX , // 支付宝
WALLET_MAX_INDEX ,
};
namespace TJD {
class TjdUiAppWalletView;
class TjdUiAppWalletPresenter : public OHOS::Presenter<TjdUiAppWalletView>,
public TJD::TjdUiScreenDragListener,
public OHOS::RootView::OnKeyActListener,
public OHOS::UIView::OnClickListener
{
public:
TjdUiAppWalletPresenter();
virtual ~TjdUiAppWalletPresenter();
static TjdUiAppWalletPresenter *GetInstance(void);
void OnStart() override;
void OnStop() override;
void ScreenDragEventCallback(OHOS::UIView &view, const OHOS::DragEvent &event) override;
bool OnKeyAct(OHOS::UIView& view, const OHOS::KeyEvent& event) override;
bool OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event) override;
void ExitWalletView(void);
void ViewExitEvent(bool isSwipe);
private:
bool isExit_{false};
int16_t dragStartX_{0};
int16_t dragCurrentX_{0};
int32_t dragDistance_{0};
};
} // namespace TJD
#endif