static constexpr const char *DROPDOWN_CLICK_FINDMYPHONE = "dropdownclickfindmyphone"; // 找手机
static constexpr const char *CONNECTEDSTATUSBACKGROUNDBUTTON = "connectedstatusbackgroundbutton"; // 连接状态按钮
- static constexpr const char *CONNECTEDSTATUSVIEWCLOSEBUTTON = "connectedstatusviewclosebutton"; // 连接状态视图的关闭按钮
-
+ static constexpr const char *CONNECTEDSTATUSVIEWCLOSEBUTTON = "connectedstatusviewclosebutton"; // 连接状态视图的关闭按钮
constexpr uint16_t VERTICAL_STATUS = 1;
constexpr uint16_t HORIZONTAL_STATUS = 0;
-class MainViewSample;
-class MainPresenterSample : public Presenter<MainViewSample>, public ModelListenerSample,
- public UIView::OnClickListener, public UIView::OnDragListener, public UISwipeView::OnSwipeListener,
- public UIView::OnLongPressListener, public UISwipeView, public CompassPresenter {
-public:
- MainPresenterSample();
- virtual ~MainPresenterSample();
- static MainPresenterSample *GetInstance(void);
+ class MainViewSample;
+ class MainPresenterSample : public Presenter<MainViewSample>, public ModelListenerSample, public UIView::OnClickListener, public UIView::OnDragListener, public UISwipeView::OnSwipeListener, public UIView::OnLongPressListener, public UISwipeView, public CompassPresenter
+ {
+ public:
+ MainPresenterSample();
+ virtual ~MainPresenterSample();
+ static MainPresenterSample *GetInstance(void);
void OnStart() override;
void OnPause() override;
void OnStop() override;
virtual void Notify() override;
bool OnClick(UIView &view, const ClickEvent &event) override;
- bool OnDrag(UIView& view, const DragEvent& event) override;
+ bool OnDrag(UIView &view, const DragEvent &event) override;
bool OnLongPress(UIView &view, const LongPressEvent &event) override;
virtual void OnSwipe(UISwipeView &view) override;
void SetPage(int8_t id);
callback_ = callback;
}
- void InitCardSettings(void);
- uint8_t GetCardSettingCount(void);
- CardId *GetCardSettings(void);
- void InitDialSettings(void);
- DialSetting& GetDialSetting();
- void UpdataTime();
- void UpdataBaseData();
- void PullUpDown_StartTimer(uint32_t interval);
- void PullUpDown_StopTimer(void);
- static uint8_t g_PullUpDownTimes;
+ void InitCardSettings(void);
+ uint8_t GetCardSettingCount(void);
+ CardId *GetCardSettings(void);
+ void InitDialSettings(void);
+ DialSetting &GetDialSetting();
+ void UpdataTime();
+ void UpdataBaseData();
+ void PullUpDown_StartTimer(uint32_t interval);
+ void PullUpDown_StopTimer(void);
+ static uint8_t g_PullUpDownTimes;
+
+ void get_memcheck();
-private:
- void ProcessDataNotify(void);
- void SetCircleProgress(void);
- void SetCompassRotate(void);
- KeyInputListener *keyActListener_{nullptr};
- ZoomEffect* callback_{nullptr};
- uint8_t state_ = UICheckBox::UICheckBoxState::MAX_STATUS_NUM;
- int64_t playerCurrentTime_{0};
- int64_t playerMusicDuration_{0};
- int64_t playerProgressValue_{0};
- bool isCompassSensorOpened_{false};
-};
+ private:
+ void ProcessDataNotify(void);
+ void SetCircleProgress(void);
+ void SetCompassRotate(void);
+ KeyInputListener *keyActListener_{nullptr};
+ ZoomEffect *callback_{nullptr};
+ uint8_t state_ = UICheckBox::UICheckBoxState::MAX_STATUS_NUM;
+ int64_t playerCurrentTime_{0};
+ int64_t playerMusicDuration_{0};
+ int64_t playerProgressValue_{0};
+ bool isCompassSensorOpened_{false};
+ };
}
#endif // MAIN_PRESENTER_H
{
map<string, AppViewId> g_jumpView = {
- {DROPDOWN_CLICK_SETTING, VIEW_SETTING}, // 设置
- {DROPDOWN_CLICK_LIGHTING, VIEW_CLASSIC_BLUETOOTH},// 蓝牙
- {DROPDOWN_CLICK_DNOTDISTURB, VIEW_DNOTDISTURB}, // 勿扰
- {DROPDOWN_CLICK_SAVEELE, VIEW_SAVEELE}, // 省电模式
- {DROPDOWN_CLICK_FINDMYPHONE, VIEW_FIND_PHONE}, // 查找手机
+ {DROPDOWN_CLICK_SETTING, VIEW_SETTING}, // 设置
+ {DROPDOWN_CLICK_LIGHTING, VIEW_CLASSIC_BLUETOOTH}, // 蓝牙
+ {DROPDOWN_CLICK_DNOTDISTURB, VIEW_DNOTDISTURB}, // 勿扰
+ {DROPDOWN_CLICK_SAVEELE, VIEW_SAVEELE}, // 省电模式
+ {DROPDOWN_CLICK_FINDMYPHONE, VIEW_FIND_PHONE}, // 查找手机
};
static MainPresenterSample *g_pMainPresenterSample = nullptr;
#endif
}
- if(curViewId == CONNECTEDSTATUSBACKGROUNDBUTTON)
+ if (curViewId == CONNECTEDSTATUSBACKGROUNDBUTTON)
{
- PullUpDownView::GetInstance()->ChangeView(DROPDOWNVIEW,CONNECTEDSTATUSVIEW);
+ PullUpDownView::GetInstance()->ChangeView(DROPDOWNVIEW, CONNECTEDSTATUSVIEW);
return true;
}
- else if(curViewId == CONNECTEDSTATUSVIEWCLOSEBUTTON)
+ else if (curViewId == CONNECTEDSTATUSVIEWCLOSEBUTTON)
{
- PullUpDownView::GetInstance()->ChangeView(CONNECTEDSTATUSVIEW,DROPDOWNVIEW);
+ PullUpDownView::GetInstance()->ChangeView(CONNECTEDSTATUSVIEW, DROPDOWNVIEW);
return true;
}
// if(&view == PullUpDownView::GetInstance()->GetConnectedStatusView()->GetCloseButton())
if (g_jumpView.count(curViewId) != 0)
{
- //NativeAbility::GetInstance().ChangeSlice(g_jumpView[curViewId]);
+ // NativeAbility::GetInstance().ChangeSlice(g_jumpView[curViewId]);
NativeAbility::GetInstance().EnterSlice(g_jumpView[curViewId]);
}
return true;
PRINT("ALLData are refresh!\n");
}
-
+ void MainPresenterSample::get_memcheck()
+ {
+ MemCheck::GetInstance()->DumpMemInfo();
+ }
/* -------------------------------------------------------------------------- */
// 声明定时器变量
static osTimerId_t g_timer = NULL;
MainPresenterSample::GetInstance()->UpdataTime();
PullUpDownView::GetInstance()->UpdateSignalStrengthStatusAndBatteryPosition();
}
-
+
if (uapi_get_screen_state() == 1) // 息屏停止更新数据
{
GraphicService::GetInstance()->PostGraphicEvent(std::bind(&MainPresenterSample::PullUpDown_StopTimer, MainPresenterSample::GetInstance()));
}
-
+
return;
}