fc8d59c6d546e5b698dfeabf9996bc231fd4e80d
[mirrors/FD230.git] /
1 #include "AppViewIDs.h"\r
2 #include "components/ui_label_ext.h"\r
3 #include"language/font/ui_resource_string.h"\r
4 #include "NativeAbility.h"\r
5 \r
6 #include "secondaryfunction/include/FastTrainingAttentionPresenter.h"\r
7 \r
8 namespace OHOS\r
9 {\r
10 \r
11     // 当前Presenter属性实例化的内存指针\r
12     static FastTrainingAttentionPresenter *g_pFastTrainingAttentionPresenter = nullptr;\r
13 \r
14     FastTrainingAttentionPresenter::FastTrainingAttentionPresenter()\r
15     {\r
16 \r
17         g_pFastTrainingAttentionPresenter = this;\r
18     }\r
19 \r
20     FastTrainingAttentionPresenter::~FastTrainingAttentionPresenter()\r
21     {\r
22 \r
23         g_pFastTrainingAttentionPresenter = nullptr;\r
24     }\r
25 \r
26     FastTrainingAttentionPresenter *FastTrainingAttentionPresenter::GetInstance()\r
27     {\r
28 \r
29         return g_pFastTrainingAttentionPresenter;\r
30     }\r
31 \r
32     void FastTrainingAttentionPresenter::OnStart()\r
33     {\r
34 \r
35         Presenter<FastTrainingAttentionView>::OnStart();\r
36     }\r
37 \r
38     void FastTrainingAttentionPresenter::OnPause(void)\r
39     {\r
40 \r
41         Presenter<FastTrainingAttentionView>::OnPause();\r
42     }\r
43 \r
44     void FastTrainingAttentionPresenter::OnResume(void)\r
45     {\r
46 \r
47         Presenter<FastTrainingAttentionView>::OnResume();\r
48     }\r
49 \r
50     void FastTrainingAttentionPresenter::OnStop(void)\r
51     {\r
52 \r
53         Presenter<FastTrainingAttentionView>::OnStop();\r
54     }\r
55     \r
56     bool FastTrainingAttentionPresenter::OnClick(UIView &view, const ClickEvent &event)\r
57     {\r
58         // 根据控件id查找是哪个控件触发了点击回调\r
59         if (strcmp(view.GetViewId(), LABELBUTTON) == 0)\r
60         {\r
61             NativeAbility::GetInstance().ChangeSlice(VIEW_FAST_TRAINING);\r
62         }\r
63         return true;\r
64     }\r
65 }