66 lines
2.0 KiB
C++
66 lines
2.0 KiB
C++
#ifndef TJDUI_APP_BUSINESSCARD_PRESENTER_H
|
|
#define TJDUI_APP_BUSINESSCARD_PRESENTER_H
|
|
|
|
#include "Presenter.h"
|
|
#include "components/ui_view.h"
|
|
#include "root_view.h"
|
|
#include "TjdUiScreenDrag.h"
|
|
|
|
enum BusinessCardView
|
|
{
|
|
TIP_VIEW = 0,
|
|
LIST_VIEW,
|
|
CARD_VIEW,
|
|
MAXTH_VIEW
|
|
};
|
|
|
|
enum BusinessCardItemIndex
|
|
{
|
|
BUSINESSCARD_WECHAT_INDEX = 0 , // 微信
|
|
BUSINESSCARD_QQ_INDEX = 1 , // QQ
|
|
BUSINESSCARD_FACEBOOK_INDEX = 2 , // FaceBook
|
|
BUSINESSCARD_INSTAGRAM_INDEX = 3, // Instagram
|
|
BUSINESSCARD_LINE_INDEX = 4 , // LINE
|
|
BUSINESSCARD_TWITTER_INDEX = 5 , // Twitter
|
|
BUSINESSCARD_WHATSAPP_INDEX = 6 , // WhatsApp
|
|
BUSINESSCARD_MAX_INDEX
|
|
};
|
|
|
|
namespace TJD {
|
|
|
|
// #define TIP_VIEW 0
|
|
// #define LIST_VIEW 1
|
|
// #define CARD_VIEW 2
|
|
|
|
class TjdUiAppBusinessCardView;
|
|
// class TjdUiAppBusinesscardModel;
|
|
class TjdUiAppBusinesscardPresenter : public OHOS::Presenter<TjdUiAppBusinessCardView>,
|
|
public TjdUiScreenDragListener,
|
|
public OHOS::RootView::OnKeyActListener,
|
|
public OHOS::UIView::OnClickListener
|
|
{
|
|
public:
|
|
TjdUiAppBusinesscardPresenter();
|
|
virtual ~TjdUiAppBusinesscardPresenter();
|
|
static TjdUiAppBusinesscardPresenter *GetInstance(void);
|
|
void OnStart() override;
|
|
void OnStop() override;
|
|
bool OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event) override;
|
|
void ScreenDragEventCallback(OHOS::UIView &view, const OHOS::DragEvent &event) override
|
|
{
|
|
ViewExitEvent(true);
|
|
}
|
|
bool OnKeyAct(OHOS::UIView& view, const OHOS::KeyEvent& event) override;
|
|
void ExitBusinessCardView(void);
|
|
void ViewExitEvent(bool isSwipe);
|
|
|
|
private:
|
|
bool isExit_{false};
|
|
int16_t dragStartX_{0};
|
|
int16_t dragCurrentX_{0};
|
|
int32_t dragDistance_{0};
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |