52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#ifndef TJD_UI_SCREENOFF_VIEW_H
|
|
#define TJD_UI_SCREENOFF_VIEW_H
|
|
|
|
#include "graphic_timer.h"
|
|
#include "root_view.h"
|
|
#include "ui_image_view.h"
|
|
#include "ui_sweep_clock.h"
|
|
#include "ui_view_group.h"
|
|
|
|
namespace TJD {
|
|
|
|
enum ScreenOffViewIndex
|
|
{
|
|
ANALOG_VIEW,
|
|
DIGITAL_VIEW,
|
|
SCREENOFF_VIEW_COUNT
|
|
};
|
|
|
|
class TjdUiScreenOffView : public OHOS::UIViewGroup,
|
|
public OHOS::RootView::OnKeyActListener
|
|
{
|
|
public:
|
|
TjdUiScreenOffView();
|
|
~TjdUiScreenOffView();
|
|
static TjdUiScreenOffView *GetInstance(void);
|
|
|
|
bool OnKeyAct(OHOS::UIView &view, const OHOS::KeyEvent &event) override;
|
|
|
|
void InitImage();
|
|
void InitView(ScreenOffViewIndex type);
|
|
void UpdateTimeView();
|
|
|
|
uint8_t timecount_{0};
|
|
private:
|
|
OHOS::UIImageView img_hour_high;
|
|
OHOS::UIImageView img_hour_low;
|
|
OHOS::UIImageView img_min_high;
|
|
OHOS::UIImageView img_min_low;
|
|
OHOS::UIImageView scroff_colon;
|
|
OHOS::UISweepClock sweepClock_;
|
|
|
|
OHOS::GraphicTimer *timescreenoff_{nullptr};
|
|
uint8_t offScreenId{0};
|
|
};
|
|
|
|
void ShowScreenOffClockView();
|
|
void HideScreenOffClockView();
|
|
bool IsShowScreenOffClockView();
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |