104 lines
3.4 KiB
C++
104 lines
3.4 KiB
C++
/*
|
|
* Copyright (c) CompanyNameMagicTag 2022-2022. All rights reserved.
|
|
* Description: temperature
|
|
* Author:
|
|
* Create: 2022-02-15
|
|
*/
|
|
|
|
#ifndef TEMP_PRESENTER_H
|
|
#define TEMP_PRESENTER_H
|
|
|
|
#include "Presenter.h"
|
|
#include "UiConfig.h"
|
|
#include "components/ui_image_view.h"
|
|
#include "components/ui_swipe_view.h"
|
|
#include "wearable_log.h"
|
|
#include "color.h"
|
|
#include "ModelListenerSample.h"
|
|
|
|
namespace OHOS {
|
|
constexpr char* TEMP_JOIN_STUDY = (char*)"tempjoinstudy";
|
|
constexpr char* TEMP_INTER_JOIN = (char*)"tempjoin";
|
|
constexpr char* TEMP_INTER_EXIT = (char*)"tempexit";
|
|
constexpr char* TEMP_MEASURE_BUTTON = (char*)"measurebutton";
|
|
constexpr char* TEMP_MEASURE_IMAGE = (char*)"measureimage";
|
|
constexpr char* TEMP_MEASURE_PROCESS = (char*)"measureprocess";
|
|
constexpr char* TEMP_PROMPT_NEXT = (char*)"temppromptnext";
|
|
constexpr char* TEMP_MEA_EXIT = (char*)"tempmeaexit";
|
|
constexpr char* TEMP_MEA_IN = (char*)"tempmeain";
|
|
constexpr char* TEMP_MEA_AGAIN = (char*)"tempmeaagain";
|
|
constexpr char* TEMP_WARN_BUTTON = (char*)"tempwarn";
|
|
constexpr char* TEMP_IMAGE_LIT_TIP = (char*)"tempimagelietip";
|
|
constexpr char* TEMP_EXIT_THIS = (char*)"tempexitstudy";
|
|
constexpr char* TEMP_STUDY_THIS = (char*)"tempaboutstudy";
|
|
constexpr char* TEMP_WARN_ID = (char*)"tempwarnid";
|
|
constexpr char* TEMP_EXIT_DELETE = (char*)"tempexitdelete";
|
|
constexpr char* TEMP_EXIT_TRUE = (char*)"tempexittrue";
|
|
constexpr char* TEMP_SWIPE_EXIT = (char*)"tempswipeexit";
|
|
constexpr int16 BACKGROUND_IMAGE_WIDTH = 190;
|
|
constexpr int16 SET_ZERO = 0;
|
|
constexpr int16 SET_ONE = 1;
|
|
constexpr int16 SET_TWO = 2;
|
|
constexpr int16 SET_THREE = 3;
|
|
constexpr int16 SET_FOUR = 4;
|
|
constexpr int16 SET_FIVE = 5;
|
|
constexpr int16 TEMP_SET_SIX = 6;
|
|
constexpr int16 SET_SEVEN = 7;
|
|
constexpr int16 SET_EIGHT = 8;
|
|
constexpr int16 SET_NINE = 9;
|
|
constexpr int16 SET_HUNDRED = 100;
|
|
|
|
typedef enum {
|
|
JOIN_STUDY_INTER = 0,
|
|
MEASURE_INTER,
|
|
PROMPT_WEAR,
|
|
CLICK_MEA,
|
|
REMIND_WEAR,
|
|
MEASURE_ING,
|
|
MEASURE_INIT,
|
|
TEMP_WARN_INTER,
|
|
TEMP_TIP,
|
|
TEMP_EXIT_STUDY,
|
|
TEMP_STUDY
|
|
} tempInterfacesId;
|
|
|
|
class TempMainView;
|
|
class TempPresenter : public Presenter<TempMainView>, public UIView::OnClickListener, public UIView::OnDragListener,
|
|
public ModelListenerSample, public UISwipeView::OnSwipeListener {
|
|
public:
|
|
TempPresenter();
|
|
~TempPresenter() override;
|
|
void OnResume() override;
|
|
void OnStop() override;
|
|
void ClickTempJoin();
|
|
void ClickPromptWear();
|
|
void ClickPromptNext();
|
|
void ClickExitMea();
|
|
void ClickIfWear();
|
|
void ClickMeaAgain(void);
|
|
void ClickMeasure();
|
|
void ClickTempTip(void);
|
|
void ClickTempExit(void);
|
|
void ClickStudyTip(void);
|
|
void ClickWarnBack(void);
|
|
void ClickExitDelete(void);
|
|
void ClickExit(void);
|
|
void ClickExitTemp(void);
|
|
int8 GetTempListen(void);
|
|
ColorType CyanColor(void);
|
|
static TempPresenter *GetInstance();
|
|
bool OnClick(UIView &view, const ClickEvent &event) override;
|
|
bool OnDrag(UIView& view, const DragEvent& event) override;
|
|
bool ClickFuncId(const char *buttonName);
|
|
void OnSwipe(UISwipeView &view) override;
|
|
void ProgressNotify(void);
|
|
void SetTempCountMax(void);
|
|
void UpdateTempCount(void);
|
|
void Notify() override;
|
|
private:
|
|
uint8 wearListen{0};
|
|
int8 tempListen{-1}; // 监测隐藏界面
|
|
int16 countTemp{100}; // 体温进度条默认值为100
|
|
};
|
|
}
|
|
#endif |