fe970f0721f4a7d4be2d2fa9b14bf7bf64e060d2
[mirrors/FD230.git] /
1 #include "AppViewIDs.h"
2 #include "components/ui_label_ext.h"
3 #include"ui_resource_string.h"
4 #include "NativeAbility.h"
5
6 #include <iostream>
7 #include <chrono>
8 #include <thread>
9 #include "traing/training_GPS/include/TraingGPSbackPresenter.h"
10 // #include "TraingGPSbackView.h"
11
12 namespace OHOS
13 {
14
15     // 当前Presenter属性实例化的内存指针
16     static TraingGPSbackPresenter *g_pTraingGPSbackPresenter = nullptr;
17
18     TraingGPSbackPresenter::TraingGPSbackPresenter()
19     {
20
21         g_pTraingGPSbackPresenter = this;
22     }
23
24     TraingGPSbackPresenter::~TraingGPSbackPresenter()
25     {
26
27         g_pTraingGPSbackPresenter = nullptr;
28     }
29
30     TraingGPSbackPresenter *TraingGPSbackPresenter::GetInstance()
31     {
32
33         return g_pTraingGPSbackPresenter;
34     }
35
36     void TraingGPSbackPresenter::OnStart()
37     {
38
39         Presenter<TraingGPSbackView>::OnStart();
40     }
41
42     void TraingGPSbackPresenter::OnPause(void)
43     {
44
45         Presenter<TraingGPSbackView>::OnPause();
46     }
47
48     void TraingGPSbackPresenter::OnResume(void)
49     {
50
51         Presenter<TraingGPSbackView>::OnResume();
52     }
53
54     void TraingGPSbackPresenter::OnStop(void)
55     {
56
57         Presenter<TraingGPSbackView>::OnStop();
58     }
59
60     bool TraingGPSbackPresenter::OnDrag(UIView &view, const DragEvent &event)
61     {
62
63         // if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&
64         //     (event.GetDeltaX() > 40) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY()))))
65         // {
66         //     uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId();
67         //    NativeAbility::GetInstance().ChangeSlice(preSlice);
68         // }
69         UNUSED(view);
70         return true;
71     }
72
73     bool TraingGPSbackPresenter::OnClick(UIView &view, const ClickEvent &event)
74     {
75         // 根据控件id查找是哪个控件触发了点击回调
76         if (strcmp(view.GetViewId(), BUTTONOK) == 0)
77         {
78             //NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGCONTROL);
79         }
80         return true;
81     }
82 }