99 lines
2.8 KiB
C++
99 lines
2.8 KiB
C++
#ifndef TJDUI_APP_SLEEP_VIEW_H
|
|
#define TJDUI_APP_SLEEP_VIEW_H
|
|
|
|
#include "View.h"
|
|
#include "components/ui_swipe_view_nested.h"
|
|
#include "ui_canvas.h"
|
|
#include "ui_chart.h"
|
|
#include "ui_image_animator.h"
|
|
#include "ui_image_view.h"
|
|
#include "ui_label.h"
|
|
#include "ui_label_ext.h"
|
|
#include "ui_slider.h"
|
|
#include "ui_swipe_view.h"
|
|
|
|
namespace TJD {
|
|
|
|
#define SLEEP_HOME_VIEW "sleepHomeView_"
|
|
#define SLEEP_DAYDATA_VIEW "sleepDayDataView_"
|
|
#define SLEEP_WEEKDATA_VIEW "sleepWeekDataView_"
|
|
#define SLEEP_NODATA_LABEL "sleepNoDataLabel_"
|
|
#define SLEEP_TOTAL_TIME "sleepTotalTime"
|
|
#define SLEEP_BLINK_TIME "blinkTime"
|
|
#define SLEEP_WAKEUP_TIME "wakeupTime"
|
|
#define SLEEP_DEEP_TIME "sleepDeepTime"
|
|
#define SLEEP_LIGHT_TIME "sleepLightTime"
|
|
#define SLEEP_AVERAGE_TIME "sleepAverageTime"
|
|
#define SLEEP_BLINK_PERSENT "blinkPersent"
|
|
#define SLEEP_WAKEUP_PERSENT "wakeupPersent"
|
|
#define SLEEP_DEEP_PERSENT "sleepDeepPersent"
|
|
#define SLEEP_LIGHT_PERSENT "sleepLightPersent"
|
|
#define SLEEP_BLINK_SLIDER "blink_slider"
|
|
#define SLEEP_WAKEUP_SLIDER "wakeup_slider"
|
|
#define SLEEP_DEEP_SLIDER "deep_slider"
|
|
#define SLEEP_LIGHT_SLIDER "light_slider"
|
|
#define SLEEP_BLINK_CHART "blink_chart"
|
|
#define SLEEP_WAKEUP_CHART "wakeup_chart"
|
|
#define SLEEP_DEEP_CHART "deep_chart"
|
|
#define SLEEP_LIGHT_CHART "light_chart"
|
|
|
|
enum SleepDataType
|
|
{
|
|
TOTAL_TIME,
|
|
AVERAGE_TIME,
|
|
BLINK_TIME,
|
|
WAKEUP_TIME,
|
|
DEEP_TIME,
|
|
LIGHT_TIME,
|
|
BLINK_PERSENT,
|
|
WAKEUP_PERSENT,
|
|
DEEP_PERSENT,
|
|
LIGHT_PERSENT,
|
|
BLINK_SLIDER,
|
|
WAKEUP_SLIDER,
|
|
DEEP_SLIDER,
|
|
LIGHT_SLIDER,
|
|
BLINK_CHART,
|
|
WAKEUP_CHART,
|
|
DEEP_CHART,
|
|
LIGHT_CHART,
|
|
};
|
|
|
|
class TjdUiAppSleepPresenter;
|
|
class TjdUiAppSleepView : public OHOS::View<TjdUiAppSleepPresenter>
|
|
{
|
|
public:
|
|
TjdUiAppSleepView();
|
|
~TjdUiAppSleepView();
|
|
static TjdUiAppSleepView *GetInstance(void);
|
|
void OnStart() override;
|
|
void OnStop() override;
|
|
|
|
void LoadImageRes(void);
|
|
void UpdateData(SleepDataType, const char *);
|
|
void UpdateData(SleepDataType, uint32_t);
|
|
void UpdateData(SleepDataType, uint16_t *, uint16_t);
|
|
|
|
OHOS::UISwipeViewNested *GetSwipeView(void) { return swipeContainer_; }
|
|
|
|
private:
|
|
OHOS::UIViewGroup *SleepHomeViewInit(void);
|
|
OHOS::UIViewGroup *SleepDayDataViewInit(void);
|
|
OHOS::UIViewGroup *SleepWeekDataViewInit(void);
|
|
|
|
void ShowChart(bool);
|
|
|
|
OHOS::UISwipeViewNested *swipeContainer_{nullptr};
|
|
OHOS::UIViewGroup *sleepHomeView_{nullptr};
|
|
OHOS::UIViewGroup *sleepDayDataView_{nullptr};
|
|
OHOS::UIViewGroup *sleepWeekDataView_{nullptr};
|
|
|
|
OHOS::UIChartDataSerial *uiChartDeepdata{nullptr};
|
|
OHOS::UIChartDataSerial *uiChartLightdata{nullptr};
|
|
OHOS::UIChartDataSerial *uiChartBlinkdata{nullptr};
|
|
OHOS::UIChartDataSerial *uiChartWakeupdata{nullptr};
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |