47 lines
1.4 KiB
C++
47 lines
1.4 KiB
C++
/*----------------------------------------------------------------------------
|
|
* Copyright (c) TJD Technologies Co., Ltd. 2024. All rights reserved.
|
|
*
|
|
* Description:
|
|
*
|
|
* Author: huangshuyi
|
|
*
|
|
* Create: 2024-7
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
#ifndef TJDUI_WATCH_FACE_PRESENTER_H
|
|
#define TJDUI_WATCH_FACE_PRESENTER_H
|
|
|
|
#include "Presenter.h"
|
|
#include "components/root_view.h"
|
|
#include "components/ui_coverflow_view2.h"
|
|
#include "components/ui_roller_view.h"
|
|
#include "graphic_timer.h"
|
|
|
|
namespace TJD {
|
|
class TjdUiWatchFaceView;
|
|
class TjdUiWatchFacePresenter : public OHOS::Presenter<TjdUiWatchFaceView>,
|
|
public OHOS::UIView::OnClickListener,
|
|
public OHOS::RootView::OnKeyActListener,
|
|
public OHOS::UICoverFlowView2::OnCoverflowScrollListener
|
|
{
|
|
public:
|
|
TjdUiWatchFacePresenter();
|
|
virtual ~TjdUiWatchFacePresenter();
|
|
static TjdUiWatchFacePresenter *GetInstance(void);
|
|
|
|
void OnStart() override;
|
|
void OnStop() override;
|
|
void OnResume() override;
|
|
bool OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event) override;
|
|
bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event) override;
|
|
bool OnScroll(uint16_t distance) override;
|
|
void SelectDefaultWatchFace(void);
|
|
void ResetTimer(void);
|
|
|
|
private:
|
|
OHOS::GraphicTimer *timer_ = nullptr;
|
|
};
|
|
}
|
|
|
|
#endif // MAIN_PRESENTER_H
|