94 lines
2.8 KiB
C++
94 lines
2.8 KiB
C++
#ifndef TJDUI_APP_DAILYDATA_VIEW_H
|
|
#define TJDUI_APP_DAILYDATA_VIEW_H
|
|
|
|
#include "TjdUiAppDailyDataPresenter.h"
|
|
#include "View.h"
|
|
#include "components/ui_canvas_ext.h"
|
|
#include "components/ui_swipe_view_nested.h"
|
|
#include "ui_chart.h"
|
|
#include "ui_circle_progress.h"
|
|
#include "ui_image_view.h"
|
|
#include "ui_label.h"
|
|
#include "ui_scroll_view.h"
|
|
#include "ui_swipe_view.h"
|
|
#include "ui_view.h"
|
|
#include <list>
|
|
|
|
namespace TJD {
|
|
|
|
// clang-format off
|
|
#define ABOUT_ID "about"
|
|
#define IMAGE(str) "image_" str
|
|
#define LABEL(str) "label_" str
|
|
#define STEP_ID "step"
|
|
#define CALORIE_ID "calorie"
|
|
#define SPORTTIME_ID "sporttime"
|
|
#define DISTANCE_ID "distance"
|
|
// clang-format on
|
|
|
|
enum DailyDataView
|
|
{
|
|
DAILYDATA_SWIPE_VIEW = 0,
|
|
DAILYDATA_ABOUT_VIEW,
|
|
DAILYDATA_MAX_VIEW
|
|
};
|
|
|
|
struct DDPointArray
|
|
{
|
|
uint32_t arrayMax;
|
|
uint32_t arrayStep;
|
|
OHOS::Point PointArray[DAILYDATA_DAY_MAX_NUM];
|
|
};
|
|
|
|
typedef bool (TjdUiAppDailyDataView::*DailyDataChangeView)(DailyDataView hideView);
|
|
|
|
class TjdUiAppDailyDataPresenter;
|
|
class TjdUiAppDailyDataView : public OHOS::View<TjdUiAppDailyDataPresenter>
|
|
{
|
|
public:
|
|
TjdUiAppDailyDataView();
|
|
~TjdUiAppDailyDataView();
|
|
static TjdUiAppDailyDataView *GetInstance(void);
|
|
void OnStart() override;
|
|
void OnStop() override;
|
|
|
|
uint8_t GetSwipeCurIndex(void);
|
|
void ChangedView(DailyDataView view, DailyDataView hideView);
|
|
bool ShowSwipeView(DailyDataView hideView);
|
|
bool ShowAboutView(DailyDataView hideView);
|
|
|
|
void UpdateFirstPage(void);
|
|
DDPointArray *GetPointArray(const char *);
|
|
OHOS::UISwipeViewNested *GetSwipeView(void) { return swipeContainer_; }
|
|
|
|
private:
|
|
OHOS::UIViewGroup *FirstPageViewInit(void);
|
|
OHOS::UIViewGroup *SecondPageViewInit(void);
|
|
OHOS::UIViewGroup *ThirdPageViewInit(void);
|
|
OHOS::UIViewGroup *FourthPageViewInit(void);
|
|
OHOS::UIViewGroup *FifthPageViewInit(void);
|
|
OHOS::UIScrollView *AboutPageViewInit(void);
|
|
|
|
DailyDataChangeView viewMapper_[DAILYDATA_MAX_VIEW] = {
|
|
&TjdUiAppDailyDataView::ShowSwipeView,
|
|
&TjdUiAppDailyDataView::ShowAboutView,
|
|
};
|
|
|
|
OHOS::UIViewGroup *containerAll_{nullptr};
|
|
OHOS::UIViewGroup *groupList_[DailyDataView::DAILYDATA_MAX_VIEW]{nullptr};
|
|
OHOS::UISwipeViewNested *swipeContainer_{nullptr};
|
|
|
|
DDPointArray stepArray{0, 0, {}};
|
|
DDPointArray KCALArray{0, 0, {}};
|
|
DDPointArray exerTimeArray{0, 0, {}};
|
|
DDPointArray distanceArray{0, 0, {}};
|
|
|
|
OHOS::UICanvasExt canvas_;
|
|
|
|
std::list<OHOS::UIChartPillar *> uiChartList;
|
|
std::list<OHOS::UIChartDataSerial *> uiChartdataList;
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |