102 lines
2.7 KiB
C++
102 lines
2.7 KiB
C++
#ifndef TJD_UI_APP_LOCK_SCREEN_VIEW_H
|
|
#define TJD_UI_APP_LOCK_SCREEN_VIEW_H
|
|
|
|
#include "TjdUiAppLockScreenPresenter.h"
|
|
#include "components/ui_circle_progress.h"
|
|
#include "components/ui_image_animator.h"
|
|
#include "components/ui_label.h"
|
|
#include "components/ui_view_group.h"
|
|
#include "graphic_timer.h"
|
|
#include "ui_label_ext.h"
|
|
namespace TJD {
|
|
|
|
enum LockScreenViewIndex
|
|
{
|
|
LockScreen_Start_VIEW,
|
|
LockScreen_Crown_VIEW,
|
|
UnlockDone_VIEW,
|
|
LockScreen_VIEW_COUNT
|
|
};
|
|
|
|
class LockScreenViewBase : public OHOS::UIViewGroup
|
|
{
|
|
public:
|
|
LockScreenViewBase() {};
|
|
virtual ~LockScreenViewBase() {};
|
|
virtual void ShowView() {SetVisible(true);}
|
|
virtual void HideView() {SetVisible(false);}
|
|
};
|
|
|
|
class LockScreenAnimatorCallback : public OHOS::AnimatorCallback
|
|
{
|
|
public:
|
|
void Callback(OHOS::UIView *view) override;
|
|
void OnStop(OHOS::UIView &view) override;
|
|
// void SetAnimator(OHOS::Animator *animator) { animator_ = animator; }
|
|
|
|
private:
|
|
// OHOS::Animator *animator_{nullptr};
|
|
};
|
|
|
|
static void TimerStartCallback_(void *param);
|
|
class TjdUiAppLockScreenView : public LockScreenViewBase
|
|
{
|
|
public:
|
|
TjdUiAppLockScreenView();
|
|
~TjdUiAppLockScreenView();
|
|
static TjdUiAppLockScreenView *GetInstance(void);
|
|
void InitLockScreenImage();
|
|
void InitTargetView(LockScreenViewIndex viewIndex);
|
|
void ShowView(LockScreenViewIndex showView);
|
|
void TimerStart();
|
|
void TimerStop();
|
|
static LockScreenViewIndex currentViewIndex_;
|
|
friend void TimerStartCallback_(void *param);
|
|
friend class LockScreenAnimatorCallback;
|
|
|
|
private:
|
|
osTimerId_t jumpTimerId_{nullptr};
|
|
void StartJumpTimer();
|
|
OHOS::GraphicTimer *timerStart_{nullptr};
|
|
OHOS::UIViewGroup *mainView_{nullptr};
|
|
LockScreenViewBase *lockscreenView[LockScreen_VIEW_COUNT]{nullptr};
|
|
};
|
|
|
|
class LockScreenView : public LockScreenViewBase
|
|
{
|
|
public:
|
|
LockScreenView();
|
|
~LockScreenView();
|
|
static LockScreenView *GetInstance(void);
|
|
void ShowView();
|
|
void HideView();
|
|
void Drawcircle(uint8_t val);
|
|
OHOS::UICircleProgress circleProgress1_;
|
|
friend class LockScreenAnimatorCallback;
|
|
friend class TjdUiAppLockScreenPresenter;
|
|
|
|
private:
|
|
LockScreenAnimatorCallback *lockScreenCallback_{nullptr};
|
|
OHOS::Animator *lockScreenAnimator_{nullptr};
|
|
OHOS::UIImageView lockscreenstart_;
|
|
OHOS::UIImageView lockcrown_;
|
|
OHOS::UILabelExt lblLockScr_;
|
|
OHOS::UILabelExt lblLockTip_;
|
|
};
|
|
|
|
class UnlockScreenView : public LockScreenViewBase
|
|
{
|
|
public:
|
|
UnlockScreenView();
|
|
~UnlockScreenView();
|
|
static UnlockScreenView *GetInstance(void);
|
|
|
|
private:
|
|
OHOS::UIImageView unlockscreendone_;
|
|
OHOS::UILabelExt lblUnlockDone_;
|
|
OHOS::UICircleProgress circleProgress2_;
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |