增加主界面训练卡片进入训练Slice接口,优化训练交互
authorCaisking <3449750381@qq.com>
Fri, 22 Mar 2024 08:22:36 +0000 (16:22 +0800)
committerCaisking <3449750381@qq.com>
Fri, 22 Mar 2024 08:22:36 +0000 (16:22 +0800)
44 files changed:
code/sdk/application/wearable/fd230app/CMakeLists.txt
code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingCardPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingControlPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingDataPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingDetailPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingEnddataPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingEndnote2Presenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingEndnotePresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingGPSPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingGPSbackPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingGPSlackPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingGPSlostPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingGPSnotePresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingGPSsetPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingLimitPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingMorePresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingNomalPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetCaluliPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetDistPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetSeptPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetTimePresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingStrongPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingWinPresenter.h
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingCardPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingControlPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDetailPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingGPSPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingGPSlackPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingGPSnotePresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingGPSsetPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingLimitPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMorePresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/traing_card/Traing_CardPresenter.cpp [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/traing/traing_card/Traing_CardPresenter.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/traing/traing_card/Traing_CardView.cpp

index 080e0ed..2eab106 100644 (file)
@@ -441,6 +441,7 @@ set(SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingWinView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingWinPresenter.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/traing_card/Traing_CardView.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/traing_card/Traing_CardPresenter.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traingrecord/src/TraingRecordView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traingrecord/src/TraingRecordPresenter.cpp
 
index 2b53a36..5b0af19 100644 (file)
@@ -25,6 +25,7 @@
 #include "DialModelTime.h"
 #include "DialModelPower.h"
 #include "gfx_utils/mem_check.h"
+#include "traing/traing_card/Traing_CardView.h"
 #if USE_OFFLINE_DIAL
 #include "DialViewGroup.h"
 #endif
index 224ebcd..44ec554 100644 (file)
@@ -171,7 +171,6 @@ namespace OHOS
                 return;
             }
         }
-
         HorizontalViewInit();
         HorViewLoad();
         VerticalViewInit();
@@ -438,6 +437,7 @@ namespace OHOS
     }
     void MainViewSample::SetPage(int16_t page)
     {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetPage is %d", page);
         if (mainSwipeGroup != nullptr)
         {
             mainSwipeGroup->SetHorCurrentPage(page);
index d011868..127d8b4 100644 (file)
@@ -1,3 +1,4 @@
+\r
 #ifndef _TraingCard_PRESENTER_H\r
 #define _TraingCard_PRESENTER_H\r
 \r
@@ -26,6 +27,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;\r
         bool OnClick(UIView &view, const ClickEvent &event) override;\r
         bool OnDrag(UIView &view, const DragEvent &event) override;\r
+        //bool OnDragEnd(UIView& view, const DragEvent& event) override;\r
     };\r
 } // namespace OHOS\r
 \r
index c1ebbfd..5815522 100644 (file)
@@ -27,6 +27,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;\r
         bool OnClick(UIView &view, const ClickEvent &event) override;\r
         bool OnDrag(UIView &view, const DragEvent &event) override;\r
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;\r
     };\r
 } // namespace OHOS\r
 \r
index 256325e..0de0fab 100644 (file)
@@ -26,6 +26,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;\r
         bool OnClick(UIView &view, const ClickEvent &event) override;\r
         bool OnDrag(UIView &view, const DragEvent &event) override;\r
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;\r
     };\r
 } // namespace OHOS\r
 \r
index 351c7e3..5f0683b 100644 (file)
@@ -26,6 +26,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;\r
         bool OnClick(UIView &view, const ClickEvent &event) override;\r
         bool OnDrag(UIView &view, const DragEvent &event) override;\r
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;\r
     };\r
 } // namespace OHOS\r
 \r
index c7877fb..26167a1 100644 (file)
@@ -1,3 +1,12 @@
+/*** 
+ * @Author: Caisking 3449750381@qq.com
+ * @Date: 2024-03-19 17:37:18
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-03-22 15:32:34
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/include/TraingEnddataPresenter.h
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
 #ifndef _TraingEnddata_PRESENTER_H
 #define _TraingEnddata_PRESENTER_H
 
@@ -26,6 +35,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        //bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index 4b4ef7b..90f9561 100644 (file)
@@ -1,3 +1,11 @@
+/*** 
+ * @Author: Caisking 3449750381@qq.com
+ * @Date: 2024-03-19 17:37:18
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-03-22 15:31:56
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/include/TraingEndnote2Presenter.h
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
 #ifndef _TraingEndnote2_PRESENTER_H
 #define _TraingEndnote2_PRESENTER_H
 
@@ -26,6 +34,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+       // bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index 428b3d0..219e397 100644 (file)
@@ -1,3 +1,4 @@
+
 #ifndef _TraingEndnote_PRESENTER_H
 #define _TraingEndnote_PRESENTER_H
 
@@ -26,6 +27,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        //bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index aa6055e..c2a9cf0 100644 (file)
@@ -1,3 +1,11 @@
+/*** 
+ * @Author: Caisking 3449750381@qq.com
+ * @Date: 2024-03-19 17:37:18
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-03-22 15:16:06
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/include/TraingGPSPresenter.h
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
 #ifndef _TraingGPS_PRESENTER_H
 #define _TraingGPS_PRESENTER_H
 
@@ -27,6 +35,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index 306df22..980e070 100644 (file)
@@ -27,6 +27,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        //bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index 21713d7..a5d66d3 100644 (file)
@@ -1,3 +1,11 @@
+/*** 
+ * @Author: Caisking 3449750381@qq.com
+ * @Date: 2024-03-19 17:37:18
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-03-22 15:34:08
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/include/TraingGPSlackPresenter.h
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE/
+ */
 #ifndef _TraingGPSlack_PRESENTER_H
 #define _TraingGPSlack_PRESENTER_H
 
@@ -27,6 +35,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index c757e23..72042cc 100644 (file)
@@ -1,3 +1,4 @@
+
 #ifndef _TraingGPSlost_PRESENTER_H
 #define _TraingGPSlost_PRESENTER_H
 
@@ -9,8 +10,8 @@ namespace OHOS
     class TraingGPSlostView;
 
     class TraingGPSlostPresenter : public Presenter<TraingGPSlostView>,
-                                 public UIView::OnClickListener,
-                                 public UIView::OnDragListener
+                                   public UIView::OnClickListener,
+                                   public UIView::OnDragListener
     {
     public:
         TraingGPSlostPresenter();
@@ -27,6 +28,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        //bool OnDragEnd(UIView &view, const DragEvent &event) override;
     };
 } // namespace OHOS
 
index cbaf8ea..c37597f 100644 (file)
@@ -27,6 +27,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index 99e9c48..e090dd7 100644 (file)
@@ -27,6 +27,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index 6a20991..ef58d0e 100644 (file)
@@ -1,3 +1,4 @@
+
 #ifndef _TraingLimit_PRESENTER_H
 #define _TraingLimit_PRESENTER_H
 
@@ -27,6 +28,8 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;
+
     };
 } // namespace OHOS
 
index 8685e83..e0a2cb8 100644 (file)
@@ -27,6 +27,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index 9d3d9bb..8033849 100644 (file)
@@ -1,3 +1,4 @@
+
 #ifndef _TraingNomal_PRESENTER_H
 #define _TraingNomal_PRESENTER_H
 
@@ -27,6 +28,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index 6759a3b..012eeff 100644 (file)
@@ -1,3 +1,11 @@
+/*** 
+ * @Author: Caisking 3449750381@qq.com
+ * @Date: 2024-03-19 18:18:30
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-03-22 15:24:40
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/include/TraingPresenter.h
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
 #ifndef _Traing_PRESENTER_H
 #define _Traing_PRESENTER_H
 
@@ -27,6 +35,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        bool OnDragEnd(UIView &view, const DragEvent &event) override;
     };
 } // namespace OHOS
 
index 5706845..1c94e82 100644 (file)
@@ -27,6 +27,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;\r
         bool OnClick(UIView &view, const ClickEvent &event) override;\r
         bool OnDrag(UIView &view, const DragEvent &event) override;\r
+        //bool OnDragEnd(UIView& view, const DragEvent& event) override;\r
     };\r
 } // namespace OHOS\r
 \r
index 23af5de..6a8ff2f 100644 (file)
@@ -1,3 +1,11 @@
+/*** 
+ * @Author: Caisking 3449750381@qq.com
+ * @Date: 2024-03-19 17:37:18
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-03-22 15:16:44
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetDistPresenter.h
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
 #ifndef _TraingSetDist_PRESENTER_H
 #define _TraingSetDist_PRESENTER_H
 
@@ -27,6 +35,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        //bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index 7e650aa..f1e647a 100644 (file)
@@ -27,6 +27,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        //bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index 74034c0..f2be675 100644 (file)
@@ -1,3 +1,4 @@
+
 #ifndef _TraingSetSept_PRESENTER_H
 #define _TraingSetSept_PRESENTER_H
 
@@ -27,6 +28,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        //bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index cacd63a..fd852ad 100644 (file)
@@ -1,3 +1,11 @@
+/*** 
+ * @Author: Caisking 3449750381@qq.com
+ * @Date: 2024-03-19 17:37:18
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-03-22 15:30:44
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetTimePresenter.h
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE/
+ */
 #ifndef _TraingSetTime_PRESENTER_H
 #define _TraingSetTime_PRESENTER_H
 
@@ -27,6 +35,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        //bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index b69a7c6..d3122e3 100644 (file)
@@ -1,3 +1,4 @@
+
 #ifndef _TraingStrong_PRESENTER_H
 #define _TraingStrong_PRESENTER_H
 
@@ -27,6 +28,8 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        bool OnDragEnd(UIView& view, const DragEvent& event) override;
+
     };
 } // namespace OHOS
 
index a034c77..ed8b1e1 100644 (file)
@@ -27,6 +27,7 @@ namespace OHOS
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        //bool OnDragEnd(UIView& view, const DragEvent& event) override;
     };
 } // namespace OHOS
 
index cac32c0..99c7ad3 100644 (file)
@@ -1,3 +1,11 @@
+/*** \r
+ * @Author: Caisking 3449750381@qq.com\r
+ * @Date: 2024-03-19 17:37:19\r
+ * @LastEditors: Caisking 3449750381@qq.com\r
+ * @LastEditTime: 2024-03-22 14:55:18\r
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/src/TraingCardPresenter.cpp\r
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\r
+ */\r
 #include "AppViewIDs.h"\r
 #include "NativeAbility.h"\r
 \r
index a499f43..12df75e 100644 (file)
@@ -54,8 +54,11 @@ namespace OHOS
 \r
         Presenter<TraingControlView>::OnStop();\r
     }\r
-\r
     bool TraingControlPresenter::OnDrag(UIView &view, const DragEvent &event)\r
+    {\r
+        return true;\r
+    }\r
+    bool TraingControlPresenter::OnDragEnd(UIView &view, const DragEvent &event)\r
     {\r
 \r
         if (event.GetDragDirection() == DragEvent::DIRECTION_RIGHT_TO_LEFT)\r
index d55dc6c..5004cff 100644 (file)
@@ -47,8 +47,11 @@ namespace OHOS
     {\r
         Presenter<TraingDataView>::OnStop();\r
     }\r
-\r
     bool TraingDataPresenter::OnDrag(UIView &view, const DragEvent &event)\r
+    {\r
+        return true;\r
+    }\r
+    bool TraingDataPresenter::OnDragEnd(UIView &view, const DragEvent &event)\r
     {\r
 \r
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&\r
index f473ff1..6feb59d 100644 (file)
@@ -1,3 +1,12 @@
+/*** \r
+ * @Author: Caisking 3449750381@qq.com\r
+ * @Date: 2024-03-19 17:37:19\r
+ * @LastEditors: Caisking 3449750381@qq.com\r
+ * @LastEditTime: 2024-03-22 15:23:15\r
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/src/TraingDetailPresenter.cpp\r
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\r
+ */\r
+\r
 #include "AppViewIDs.h"\r
 #include "NativeAbility.h"\r
 \r
@@ -54,8 +63,11 @@ namespace OHOS
 \r
         Presenter<TraingDetailView>::OnStop();\r
     }\r
-\r
     bool TraingDetailPresenter::OnDrag(UIView &view, const DragEvent &event)\r
+    {\r
+        return true;\r
+    }\r
+    bool TraingDetailPresenter::OnDragEnd(UIView &view, const DragEvent &event)\r
     {\r
 \r
         if (event.GetDragDirection() == DragEvent::DIRECTION_TOP_TO_BOTTOM)\r
index 8bb2633..8265666 100644 (file)
@@ -1,3 +1,4 @@
+
 #include "AppViewIDs.h"
 #include "NativeAbility.h"
 
@@ -54,8 +55,11 @@ namespace OHOS
 
         Presenter<TraingGPSView>::OnStop();
     }
-
     bool TraingGPSPresenter::OnDrag(UIView &view, const DragEvent &event)
+    {
+        return true;
+    }
+    bool TraingGPSPresenter::OnDragEnd(UIView &view, const DragEvent &event)
     {
 
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&
index 8887c53..8e39d3b 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: Caisking 3449750381@qq.com
  * @Date: 2023-12-12 16:55:28
  * @LastEditors: Caisking 3449750381@qq.com
- * @LastEditTime: 2024-01-16 15:44:47
+ * @LastEditTime: 2024-03-22 15:40:56
  * @FilePath: /1.FD230/FD230/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingGPSlackPresenter.cpp
  * @Description: 
  * @
@@ -64,8 +64,11 @@ namespace OHOS
 
         Presenter<TraingGPSlackView>::OnStop();
     }
-
     bool TraingGPSlackPresenter::OnDrag(UIView &view, const DragEvent &event)
+    {
+        return true;
+    }
+    bool TraingGPSlackPresenter::OnDragEnd(UIView &view, const DragEvent &event)
     {
 
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&
index dc96663..b9c2bab 100644 (file)
@@ -54,8 +54,11 @@ namespace OHOS
 
         Presenter<TraingGPSnoteView>::OnStop();
     }
-
     bool TraingGPSnotePresenter::OnDrag(UIView &view, const DragEvent &event)
+    {
+        return true;
+    }
+    bool TraingGPSnotePresenter::OnDragEnd(UIView &view, const DragEvent &event)
     {
 
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&
index 706a124..66f8f02 100644 (file)
@@ -54,8 +54,11 @@ namespace OHOS
 
         Presenter<TraingGPSsetView>::OnStop();
     }
-
     bool TraingGPSsetPresenter::OnDrag(UIView &view, const DragEvent &event)
+    {
+        return true;
+    }
+    bool TraingGPSsetPresenter::OnDragEnd(UIView &view, const DragEvent &event)
     {
 
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&
index 745fc09..e2cd6a6 100644 (file)
@@ -1,3 +1,11 @@
+/*** \r
+ * @Author: Caisking 3449750381@qq.com\r
+ * @Date: 2024-03-19 17:37:19\r
+ * @LastEditors: Caisking 3449750381@qq.com\r
+ * @LastEditTime: 2024-03-22 15:20:33\r
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/src/TraingLimitPresenter.cpp\r
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\r
+ */\r
 #include "AppViewIDs.h"\r
 #include "NativeAbility.h"\r
 \r
@@ -54,8 +62,11 @@ namespace OHOS
 \r
         Presenter<TraingLimitView>::OnStop();\r
     }\r
-\r
     bool TraingLimitPresenter::OnDrag(UIView &view, const DragEvent &event)\r
+    {\r
+        return true;\r
+    }\r
+    bool TraingLimitPresenter::OnDragEnd(UIView &view, const DragEvent &event)\r
     {\r
 \r
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&\r
index 5b6f363..9a53331 100644 (file)
@@ -5,6 +5,8 @@
 #include <chrono>\r
 #include <thread>\r
 #include "traing/include/TraingMorePresenter.h"\r
+#include "MainViewSample.h"\r
+#include "ScreenModels.h"\r
 // #include "TraingMoreView.h"\r
 \r
 namespace OHOS\r
@@ -54,14 +56,24 @@ namespace OHOS
 \r
         Presenter<TraingMoreView>::OnStop();\r
     }\r
-\r
     bool TraingMorePresenter::OnDrag(UIView &view, const DragEvent &event)\r
+    {\r
+        return true;\r
+    }\r
+    bool TraingMorePresenter::OnDragEnd(UIView &view, const DragEvent &event)\r
     {\r
 \r
-        if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&\r
-            (event.GetDeltaX() > 40) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY()))))\r
+        if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT)\r
         {\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING);\r
+            uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId();\r
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Id:[%d]", preSlice);\r
+            if (preSlice == VIEW_MAIN)\r
+            {\r
+                NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
+                // MainViewSample::GetInstance()->SetPage(CardId::TRAINING);\r
+                return true;\r
+            }\r
+            NativeAbility::GetInstance().ChangeSlice(preSlice);\r
         }\r
         UNUSED(view);\r
         return true;\r
index 49c7693..2ec6210 100644 (file)
@@ -54,15 +54,22 @@ namespace OHOS
 \r
         Presenter<TraingNomalView>::OnStop();\r
     }\r
-\r
     bool TraingNomalPresenter::OnDrag(UIView &view, const DragEvent &event)\r
+    {\r
+        return true;\r
+    }\r
+    bool TraingNomalPresenter::OnDragEnd(UIView &view, const DragEvent &event)\r
     {\r
 \r
-        if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&\r
-            (event.GetDeltaX() > 40) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY()))))\r
+        uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId();\r
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Id:[%d]", preSlice);\r
+        if (preSlice == VIEW_MAIN)\r
         {\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGMORE);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
+            // MainViewSample::GetInstance()->SetPage(CardId::TRAINING);\r
+            return true;\r
         }\r
+        NativeAbility::GetInstance().ChangeSlice(preSlice);\r
         UNUSED(view);\r
         return true;\r
     }\r
index e7306fa..352b988 100644 (file)
@@ -1,3 +1,11 @@
+/*** 
+ * @Author: Caisking 3449750381@qq.com
+ * @Date: 2024-03-19 18:18:50
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-03-22 15:22:11
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/src/TraingPresenter.cpp
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
 
 #include "AppViewIDs.h"
 #include "NativeAbility.h"
@@ -48,8 +56,11 @@ namespace OHOS
     {
         Presenter<TraingView>::OnStop();
     }
-
     bool TraingPresenter::OnDrag(UIView &view, const DragEvent &event)
+    {
+        return true;
+    }
+    bool TraingPresenter::OnDragEnd(UIView &view, const DragEvent &event)
     {
         UNUSED(view);
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT)
index f0fb44b..9e3bdbf 100644 (file)
@@ -54,8 +54,11 @@ namespace OHOS
 
         Presenter<TraingStrongView>::OnStop();
     }
-
     bool TraingStrongPresenter::OnDrag(UIView &view, const DragEvent &event)
+    {
+        return true;
+    }
+    bool TraingStrongPresenter::OnDragEnd(UIView &view, const DragEvent &event)
     {
 
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&
index 76fe505..0d3d439 100644 (file)
@@ -1,3 +1,11 @@
+/*** 
+ * @Author: Caisking 3449750381@qq.com
+ * @Date: 2024-03-19 17:37:19
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-03-22 15:21:30
+ * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinPresenter.cpp
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
 #include "AppViewIDs.h"
 #include "NativeAbility.h"
 
diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/traing_card/Traing_CardPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/traing_card/Traing_CardPresenter.cpp
new file mode 100644 (file)
index 0000000..a06e02d
--- /dev/null
@@ -0,0 +1,40 @@
+
+#include "traing/traing_card/Traing_CardPresenter.h"
+#include "traing/traing_card/Traing_CardView.h"
+
+#include "AppViewIDs.h"
+#include "NativeAbility.h"
+#include "UiConfig.h"
+#include "wearable_log.h"
+namespace OHOS
+{
+
+    bool TraingOnClickListener::OnClick(UIView &view, const ClickEvent &event)
+    {
+        UNUSED(event);
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Traing_CardView::OnClick %s", view.GetViewId());
+        Traing_CardView *cardpage = Traing_CardView::GetInstance();
+        if (cardpage == nullptr)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Traing_CardView::GetInstance");
+            return false;
+        }
+        if (strcmp(view.GetViewId(), BUTTON1) == 0)
+        {
+            NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL);
+        }
+        if (strcmp(view.GetViewId(), BUTTON2) == 0)
+        {
+            NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL);
+        }
+        if (strcmp(view.GetViewId(), BUTTON3) == 0)
+        {
+            NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL);
+        }
+        if (strcmp(view.GetViewId(), BUTTONMORE) == 0)
+        {
+            NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGMORE);
+        }
+        return true;
+    }
+} // namespace OHOS
\ No newline at end of file
diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/traing_card/Traing_CardPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/traing/traing_card/Traing_CardPresenter.h
new file mode 100644 (file)
index 0000000..8c7650d
--- /dev/null
@@ -0,0 +1,24 @@
+
+#ifndef TRAING_CARD_PRESENTER_H
+#define TRAING_CARD_PRESENTER_H
+#include "components/ui_view.h"
+namespace OHOS
+{
+    class TraingOnClickListener : public UIView::OnClickListener
+    {
+    public:
+        TraingOnClickListener() {}
+        TraingOnClickListener(UIView *view) : view_(view) {}
+        ~TraingOnClickListener(){};
+        static TraingOnClickListener *GetInstance()
+        {
+            static TraingOnClickListener instance;
+            return &instance;
+        }
+        bool OnClick(UIView &view, const ClickEvent &event) override;
+
+    private:
+        UIView *view_{nullptr};
+    };
+}
+#endif
\ No newline at end of file
index e514a9d..1672332 100644 (file)
@@ -8,7 +8,8 @@
 #include "components/ui_button.h"\r
 #include "components/ui_view_group.h"\r
 #include "common/image_cache_manager.h"\r
-\r
+#include "MainPresenterSample.h"\r
+#include "traing/traing_card/Traing_CardPresenter.h"\r
 namespace OHOS\r
 {\r
     static Traing_CardView *g_pTraing_CardView{nullptr};\r
@@ -93,6 +94,7 @@ namespace OHOS
         struct ButtonInfo\r
         {\r
             std::string text;\r
+            char *viewid;\r
             uint32_t defaultImgSrc;\r
             UILabelButtonExt *button;\r
             uint16_t posX;\r
@@ -100,10 +102,10 @@ namespace OHOS
         };\r
 \r
         ButtonInfo buttons[] = {\r
-            {"健走", TRAINING_BUTTONGROUND2, Button1, 86, 118},\r
-            {"骑行", TRAINING_BOUTTONGROUND, Button2, 236, 118},\r
-            {"跑步", TRAINING_BOUTTONGROUND, Button3, 86, 268},\r
-            {"更多", TRAINING_MORE, ButtonMore, 236, 268}};\r
+            {"健走", BUTTON1, TRAINING_BUTTONGROUND2, Button1, 86, 118},\r
+            {"骑行", BUTTON2, TRAINING_BOUTTONGROUND, Button2, 236, 118},\r
+            {"跑步", BUTTON3, TRAINING_BOUTTONGROUND, Button3, 86, 268},\r
+            {"更多", BUTTONMORE, TRAINING_MORE, ButtonMore, 236, 268}};\r
 \r
         for (auto &buttonInfo : buttons)\r
         {\r
@@ -120,12 +122,20 @@ namespace OHOS
 \r
             buttonInfo.button->SetPosition(buttonInfo.posX, buttonInfo.posY);\r
             buttonInfo.button->Resize(140, 140);\r
+            //WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Id:[%s]", buttonInfo.viewid);\r
             buttonInfo.button->SetText(buttonInfo.text.c_str());\r
             buttonInfo.button->SetLabelPosition(0, 70);\r
             buttonInfo.button->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);\r
             buttonInfo.button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff19ff41, UIButton::PRESSED);\r
             buttonInfo.button->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
-\r
+            buttonInfo.button->SetViewId(buttonInfo.viewid);\r
+            UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::TraingOnClickListener::GetInstance();\r
+            if (clickListener == nullptr)\r
+            {\r
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AddButton::OnStart clickListener NULL");\r
+                return false;\r
+            }\r
+            buttonInfo.button->SetOnClickListener(clickListener);\r
             Add(buttonInfo.button);\r
         }\r
 \r