indoorwalk 文件夹修改
authorluozheng <1732036298@qq.com>
Tue, 28 May 2024 12:50:17 +0000 (20:50 +0800)
committerluozheng <1732036298@qq.com>
Tue, 28 May 2024 12:50:17 +0000 (20:50 +0800)
24 files changed:
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/include/CustomizationView.h
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/include/IndoorWalkModel.h
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/include/IndoorWalkMotionView.h
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/include/IndoorWalkPresenter.h
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/include/MotionPageFifth.h
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/include/MotionPageFirst.h
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/include/MotionPageFourth.h
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/include/MotionPageSecond.h
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/include/MotionPageThird.h
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/CustomizationView.cpp
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/IndoorWalkEndView.cpp
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/IndoorWalkModel.cpp
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/IndoorWalkView.cpp
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/MotionPageFifth.cpp
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/MotionPageFirst.cpp
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/MotionPageFourth.cpp
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/MotionPageSecond.cpp
code/sdk/application/wearable/fd230app/nativeui/indoorwalk/src/MotionPageThird.cpp
code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistView.cpp
code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveElePresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/screennotify/src/ui_screennotify.cpp
code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialPresenter.cpp

index 557cde5..6ad618f 100644 (file)
@@ -20,7 +20,7 @@ namespace OHOS {
 class IndoorWalkUIScrollView : public UIScrollView {\r
 public:\r
     IndoorWalkUIScrollView() {}\r
-    virtual ~IndoorWalkUIScrollView() {}\r
+    ~IndoorWalkUIScrollView() override {}\r
 \r
     bool OnDragEvent(const DragEvent& event) override\r
     {\r
index 679802a..2afd4ef 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef INDOORWALK_MODEL_H\r
 #define INDOORWALK_MODEL_H\r
 \r
-#include "stdio.h"\r
+#include <cstdio>\r
 #include "string"\r
 #include "gfx_utils/list.h"\r
 #include "components/ui_label.h"\r
@@ -24,46 +24,45 @@ void DisableIndoorWalkTimer();
 #endif\r
 \r
 namespace OHOS {\r
-using namespace std;\r
 class IndoorWalkModel {\r
 public:\r
     ~IndoorWalkModel();\r
     static IndoorWalkModel *GetInstance(void);\r
-    string GetConnectionView();\r
+    std::string GetConnectionView();\r
     void SetConnectionView(const char* id);\r
     void SetTextLableFirstTop(const char *lable, const char *lableUnit);\r
-    string GetTextLableFirstTop();\r
-    string GetTextLableUnitFirstTop();\r
+    std::string GetTextLableFirstTop();\r
+    std::string GetTextLableUnitFirstTop();\r
     void SetTextLableFirstLeft(const char *lable, const char *lableUnit);\r
-    string GetTextLableFirstLeft();\r
-    string GetTextLableUnitFirstLeft();\r
+    std::string GetTextLableFirstLeft();\r
+    std::string GetTextLableUnitFirstLeft();\r
     void SetTextLableFirstRight(const char *lable, const char *lableUnit);\r
-    string GetTextLableFirstRight();\r
-    string GetTextLableUnitFirstRight();\r
+    std::string GetTextLableFirstRight();\r
+    std::string GetTextLableUnitFirstRight();\r
     void SetTextLableFirstBottom(const char *lable, const char *lableUnit);\r
-    string GetTextLableFirstBottom();\r
-    string GetTextLableUnitFirstBottom();\r
+    std::string GetTextLableFirstBottom();\r
+    std::string GetTextLableUnitFirstBottom();\r
     void SetTextLableSecondTop(const char *lable, const char *lableUnit);\r
-    string GetTextLableSecondTop();\r
-    string GetTextLableUnitSecondTop();\r
+    std::string GetTextLableSecondTop();\r
+    std::string GetTextLableUnitSecondTop();\r
     void SetTextLableSecondLeft(const char *lable, const char *lableUnit);\r
-    string GetTextLableSecondLeft();\r
-    string GetTextLableUnitSecondLeft();\r
+    std::string GetTextLableSecondLeft();\r
+    std::string GetTextLableUnitSecondLeft();\r
     void SetTextLableSecondRight(const char *lable, const char *lableUnit);\r
-    string GetTextLableSecondRight();\r
-    string GetTextLableUnitSecondRight();\r
+    std::string GetTextLableSecondRight();\r
+    std::string GetTextLableUnitSecondRight();\r
     void SetTextLableThirdTop(const char *lable, const char *lableUnit);\r
-    string GetTextLableThirdTop();\r
-    string GetTextLableUnitThirdTop();\r
+    std::string GetTextLableThirdTop();\r
+    std::string GetTextLableUnitThirdTop();\r
     void SetTextLableThirdBottom(const char *lable, const char *lableUnit);\r
-    string GetTextLableThirdBottom();\r
-    string GetTextLableUnitThirdBottom();\r
+    std::string GetTextLableThirdBottom();\r
+    std::string GetTextLableUnitThirdBottom();\r
     void SetTextLableFourth(const char *lable, const char *lableUnit);\r
-    string GetTextLableFourth();\r
-    string GetTextLableUnitFourth();\r
+    std::string GetTextLableFourth();\r
+    std::string GetTextLableUnitFourth();\r
     void SetInitialStep(const uint32_t &value);\r
     int GetInitialStep();\r
-    char *DisplayMotionDuration();\r
+    std::string& DisplayMotionDuration();\r
     bool OpenDistancesSensor(void);\r
     bool CloseDistancesSensor(void);\r
     void SetInitialDistances(const float &value);\r
@@ -73,32 +72,32 @@ public:
 \r
 private:\r
     IndoorWalkModel();\r
-    string selectPropertiesID;\r
+    std::string selectPropertiesID;\r
     uint32_t initialStep;\r
     float initialDistances;\r
     float currentDistances;\r
-    string textLableFirstTop{"00:00:00"};\r
-    string textLableUnitFirstTop{"时间"};\r
-    string textLableFirstLeft{"00:00:00"};\r
-    string textLableUnitFirstLeft{"时间"};\r
-    string textLableFirstRight{"00:00:00"};\r
-    string textLableUnitFirstRight{"时间"};\r
-    string textLableFirstBottom{"00:00:00"};\r
-    string textLableUnitFirstBottom{"时间"};\r
-    string textLableSecondTop{"00:00:00"};\r
-    string textLableUnitSecondTop{"时间"};\r
-    string textLableSecondLeft{"00:00:00"};\r
-    string textLableUnitSecondLeft{"时间"};\r
-    string textLableSecondRight{"00:00:00"};\r
-    string textLableUnitSecondRight{"时间"};\r
-    string textLableThirdTop{"00:00:00"};\r
-    string textLableUnitThirdTop{"时间"};\r
-    string textLableThirdBottom{"00:00:00"};\r
-    string textLableUnitThirdBottom{"时间"};\r
-    string textLableFourth{"00:00:00"};\r
-    string textLableUnitFourth{"时间"};\r
+    std::string textLableFirstTop{"00:00:00"};\r
+    std::string textLableUnitFirstTop{"时间"};\r
+    std::string textLableFirstLeft{"00:00:00"};\r
+    std::string textLableUnitFirstLeft{"时间"};\r
+    std::string textLableFirstRight{"00:00:00"};\r
+    std::string textLableUnitFirstRight{"时间"};\r
+    std::string textLableFirstBottom{"00:00:00"};\r
+    std::string textLableUnitFirstBottom{"时间"};\r
+    std::string textLableSecondTop{"00:00:00"};\r
+    std::string textLableUnitSecondTop{"时间"};\r
+    std::string textLableSecondLeft{"00:00:00"};\r
+    std::string textLableUnitSecondLeft{"时间"};\r
+    std::string textLableSecondRight{"00:00:00"};\r
+    std::string textLableUnitSecondRight{"时间"};\r
+    std::string textLableThirdTop{"00:00:00"};\r
+    std::string textLableUnitThirdTop{"时间"};\r
+    std::string textLableThirdBottom{"00:00:00"};\r
+    std::string textLableUnitThirdBottom{"时间"};\r
+    std::string textLableFourth{"00:00:00"};\r
+    std::string textLableUnitFourth{"时间"};\r
 \r
-    string motionDuration;\r
+    std::string motionDuration;\r
 };\r
 }\r
 \r
index 303045f..40e0e45 100644 (file)
@@ -48,8 +48,6 @@ private:
     MotionPageFifth *motionPageFifth{nullptr};\r
     AppGroupView *recordCard[MAX_MOTIONPAGE]{nullptr};\r
     bool pageStatus[MAX_MOTIONPAGE]{false};\r
-    UISwipeView::OnSwipeListener* motionclickListener{nullptr};\r
-    UIView::OnDragListener* motionDragListener{nullptr};\r
 };\r
 } // namespace OHOS\r
 #endif // INDOORWALK_MOTION_VIEW_H
\ No newline at end of file
index b3f4c7d..20755a1 100644 (file)
@@ -66,7 +66,7 @@ class IndoorWalkPresenter : public Presenter<IndoorWalkView>, public UISwipeView
                                  public UIView::OnDragListener {\r
 public:\r
     IndoorWalkPresenter();\r
-    virtual ~IndoorWalkPresenter();\r
+    ~IndoorWalkPresenter() override;\r
     static IndoorWalkPresenter *GetInstance();\r
     void OnStart() override;\r
     void OnPause() override;\r
@@ -75,7 +75,7 @@ public:
     bool OnClick(UIView& view, const ClickEvent& event) override;\r
     bool OnDrag(UIView& view, const DragEvent& event) override;\r
     bool OnLongPress(UIView& view, const LongPressEvent& event) override;\r
-    virtual void OnSwipe(UISwipeView& view) override;\r
+    void OnSwipe(UISwipeView& view) override;\r
     void HidePageImageView(void);\r
     void ModifiesProperties(const char* id, const char *lable, const char *lableUnit);\r
     void ModifiesPageFirstTop(const char *lable, const char *lableUnit);\r
index 745f0fc..61f676d 100644 (file)
@@ -19,7 +19,7 @@ namespace OHOS {
 class MotionPageFifth : public AppGroupView {\r
 public:\r
     MotionPageFifth();\r
-    virtual ~MotionPageFifth();\r
+    ~MotionPageFifth() override;\r
     static MotionPageFifth *GetInstance(void);\r
     bool InitView(void *caller) override;\r
     bool InitPageFifthLableView(void);\r
index 8b0c1d1..78259fe 100644 (file)
@@ -19,7 +19,7 @@ namespace OHOS {
 class MotionPageFirst : public AppGroupView {\r
 public:\r
     MotionPageFirst();\r
-    virtual ~MotionPageFirst();\r
+    ~MotionPageFirst() override;\r
     static MotionPageFirst *GetInstance(void);\r
     bool InitView(void *caller) override;\r
     bool InitPageFirstImageView(void);\r
index f141257..34dc316 100644 (file)
@@ -19,7 +19,7 @@ namespace OHOS {
 class MotionPageFourth : public AppGroupView {\r
 public:\r
     MotionPageFourth();\r
-    virtual ~MotionPageFourth();\r
+    ~MotionPageFourth() override;\r
     static MotionPageFourth *GetInstance(void);\r
     bool InitView(void *caller) override;\r
     bool InitPageFourthLableView(void);\r
index 005178a..2297aa6 100644 (file)
@@ -19,7 +19,7 @@ namespace OHOS {
 class MotionPageSecond : public AppGroupView {\r
 public:\r
     MotionPageSecond();\r
-    virtual ~MotionPageSecond();\r
+    ~MotionPageSecond() override;\r
     static MotionPageSecond *GetInstance(void);\r
     bool InitView(void *caller) override;\r
     bool InitPageSecondImageView(void);\r
index de2e517..e26fcc3 100644 (file)
@@ -19,7 +19,7 @@ namespace OHOS {
 class MotionPageThird : public AppGroupView {\r
 public:\r
     MotionPageThird();\r
-    virtual ~MotionPageThird();\r
+    ~MotionPageThird() override;\r
     static MotionPageThird *GetInstance(void);\r
     bool InitView(void *caller) override;\r
     bool InitPageThirdImageView(void);\r
index 1762a8b..4e3e637 100644 (file)
@@ -353,8 +353,8 @@ UIViewGroup *CustomizationView::InitPropertiesView()
     group->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);\r
     group->SetHorizontalScrollState(false);\r
 \r
-    if ((ShowUpTitleLabel() == false) || (InitTimeView() == false) || (InitDistancesView() == false) ||\r
-        (InitHeartView() == false) || (InitSpeedView() == false) || (InitStepsView() == false)) {\r
+    if ((!ShowUpTitleLabel()) || (!InitTimeView()) || (!InitDistancesView()) ||\r
+        (!InitHeartView()) || (!InitSpeedView()) || (!InitStepsView())) {\r
         return nullptr;\r
     }\r
     group->Add(lable);\r
index ae39724..bcaa1e7 100644 (file)
@@ -104,12 +104,12 @@ UIViewGroup *IndoorWalkEndView::InitShowUpView()
     group->SetWidth(HORIZONTAL_RESOLUTION);\r
     group->SetHeight(VERTICAL_RESOLUTION);\r
     ret = ShowUpTitleLabel();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return nullptr;\r
     }\r
     group->Add(titleLabel);\r
     ret = CreateUIButton();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return nullptr;\r
     }\r
     group->Add(cancelButton);\r
index ebfb885..a89626e 100644 (file)
@@ -17,7 +17,7 @@ typedef struct {
 } fa_treadmill_distance_result;\r
 \r
 static int g_motionTimes{0};\r
-osTimerId_t g_startCounting = NULL; // 定时器\r
+osTimerId_t g_startCounting = nullptr; // 定时器\r
 static constexpr uint64_t MS_ONE_SECONDS = 1000;\r
 static constexpr uint16_t NUM_TEN = 10;\r
 static constexpr uint16_t NUM_TIME_MIN = 60;\r
@@ -40,7 +40,7 @@ void IndoorWalkModel::SetConnectionView(const char* id)
     selectPropertiesID = id;\r
 }\r
 \r
-string IndoorWalkModel::GetConnectionView()\r
+std::string IndoorWalkModel::GetConnectionView()\r
 {\r
     return selectPropertiesID;\r
 }\r
@@ -51,12 +51,12 @@ void IndoorWalkModel::SetTextLableFirstTop(const char *lable, const char *lableU
     textLableUnitFirstTop = lableUnit;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableFirstTop()\r
+std::string IndoorWalkModel::GetTextLableFirstTop()\r
 {\r
     return textLableFirstTop;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableUnitFirstTop()\r
+std::string IndoorWalkModel::GetTextLableUnitFirstTop()\r
 {\r
     return textLableUnitFirstTop;\r
 }\r
@@ -67,12 +67,12 @@ void IndoorWalkModel::SetTextLableFirstLeft(const char *lable, const char *lable
     textLableUnitFirstLeft = lableUnit;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableFirstLeft()\r
+std::string IndoorWalkModel::GetTextLableFirstLeft()\r
 {\r
     return textLableFirstLeft;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableUnitFirstLeft()\r
+std::string IndoorWalkModel::GetTextLableUnitFirstLeft()\r
 {\r
     return textLableUnitFirstLeft;\r
 }\r
@@ -83,12 +83,12 @@ void IndoorWalkModel::SetTextLableFirstRight(const char *lable, const char *labl
     textLableUnitFirstRight = lableUnit;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableFirstRight()\r
+std::string IndoorWalkModel::GetTextLableFirstRight()\r
 {\r
     return textLableFirstRight;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableUnitFirstRight()\r
+std::string IndoorWalkModel::GetTextLableUnitFirstRight()\r
 {\r
     return textLableUnitFirstRight;\r
 }\r
@@ -99,12 +99,12 @@ void IndoorWalkModel::SetTextLableFirstBottom(const char *lable, const char *lab
     textLableUnitFirstBottom = lableUnit;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableFirstBottom()\r
+std::string IndoorWalkModel::GetTextLableFirstBottom()\r
 {\r
     return textLableFirstBottom;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableUnitFirstBottom()\r
+std::string IndoorWalkModel::GetTextLableUnitFirstBottom()\r
 {\r
     return textLableUnitFirstBottom;\r
 }\r
@@ -115,12 +115,12 @@ void IndoorWalkModel::SetTextLableSecondTop(const char *lable, const char *lable
     textLableUnitSecondTop = lableUnit;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableSecondTop()\r
+std::string IndoorWalkModel::GetTextLableSecondTop()\r
 {\r
     return textLableSecondTop;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableUnitSecondTop()\r
+std::string IndoorWalkModel::GetTextLableUnitSecondTop()\r
 {\r
     return textLableUnitSecondTop;\r
 }\r
@@ -131,12 +131,12 @@ void IndoorWalkModel::SetTextLableSecondLeft(const char *lable, const char *labl
     textLableUnitSecondLeft = lableUnit;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableSecondLeft()\r
+std::string IndoorWalkModel::GetTextLableSecondLeft()\r
 {\r
     return textLableSecondLeft;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableUnitSecondLeft()\r
+std::string IndoorWalkModel::GetTextLableUnitSecondLeft()\r
 {\r
     return textLableUnitSecondLeft;\r
 }\r
@@ -147,12 +147,12 @@ void IndoorWalkModel::SetTextLableSecondRight(const char *lable, const char *lab
     textLableUnitSecondRight = lableUnit;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableSecondRight()\r
+std::string IndoorWalkModel::GetTextLableSecondRight()\r
 {\r
     return textLableSecondRight;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableUnitSecondRight()\r
+std::string IndoorWalkModel::GetTextLableUnitSecondRight()\r
 {\r
     return textLableUnitSecondRight;\r
 }\r
@@ -163,12 +163,12 @@ void IndoorWalkModel::SetTextLableThirdTop(const char *lable, const char *lableU
     textLableUnitThirdTop = lableUnit;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableThirdTop()\r
+std::string IndoorWalkModel::GetTextLableThirdTop()\r
 {\r
     return textLableThirdTop;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableUnitThirdTop()\r
+std::string IndoorWalkModel::GetTextLableUnitThirdTop()\r
 {\r
     return textLableUnitThirdTop;\r
 }\r
@@ -179,12 +179,12 @@ void IndoorWalkModel::SetTextLableThirdBottom(const char *lable, const char *lab
     textLableUnitThirdBottom = lableUnit;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableThirdBottom()\r
+std::string IndoorWalkModel::GetTextLableThirdBottom()\r
 {\r
     return textLableThirdBottom;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableUnitThirdBottom()\r
+std::string IndoorWalkModel::GetTextLableUnitThirdBottom()\r
 {\r
     return textLableUnitThirdBottom;\r
 }\r
@@ -195,12 +195,12 @@ void IndoorWalkModel::SetTextLableFourth(const char *lable, const char *lableUni
     textLableUnitFourth = lableUnit;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableFourth()\r
+std::string IndoorWalkModel::GetTextLableFourth()\r
 {\r
     return textLableFourth;\r
 }\r
 \r
-string IndoorWalkModel::GetTextLableUnitFourth()\r
+std::string IndoorWalkModel::GetTextLableUnitFourth()\r
 {\r
     return textLableUnitFourth;\r
 }\r
@@ -236,12 +236,12 @@ float IndoorWalkModel::GetCurrentDistances()
 }\r
 \r
 /* 时间显示 */\r
-char *IndoorWalkModel::DisplayMotionDuration()\r
+std::string& IndoorWalkModel::DisplayMotionDuration()\r
 {\r
     motionDuration.erase();\r
-    string hours;\r
-    string minute;\r
-    string seconds;\r
+    std::string hours;\r
+    std::string minute;\r
+    std::string seconds;\r
     if (g_motionTimes >= NUM_TIME_DAY) {\r
         g_motionTimes = 0;\r
     }\r
@@ -249,23 +249,23 @@ char *IndoorWalkModel::DisplayMotionDuration()
     int min = (g_motionTimes % NUM_TIME_HOUR) / NUM_TIME_MIN;\r
     int sec = (g_motionTimes % NUM_TIME_HOUR) % NUM_TIME_MIN;\r
     if (hour >= 0 && hour < NUM_TEN) {\r
-        hours = "0" + to_string(hour);\r
+        hours = "0" + std::to_string(hour);\r
     } else {\r
-        hours = to_string(hour);\r
+        hours = std::to_string(hour);\r
     }\r
     if (min >= 0 && min < NUM_TEN) {\r
-        minute = "0" + to_string(min);\r
+        minute = "0" + std::to_string(min);\r
     } else {\r
-        minute = to_string(min);\r
+        minute = std::to_string(min);\r
     }\r
     if (sec >= 0 && sec < NUM_TEN) {\r
-        seconds = "0" + to_string(sec);\r
+        seconds = "0" + std::to_string(sec);\r
     } else {\r
-        seconds = to_string(sec);\r
+        seconds = std::to_string(sec);\r
     }\r
 \r
     motionDuration = hours + ":" + minute + ":" + seconds;\r
-    return (char *)motionDuration.c_str();\r
+    return motionDuration;\r
 }\r
 \r
 #ifdef __cplusplus\r
@@ -287,12 +287,12 @@ void IndoorWalkTimerCallback()
 /* 开启定时器 */\r
 void InitIndoorWalkTimer()\r
 {\r
-    if (g_startCounting != NULL) {\r
+    if (g_startCounting != nullptr) {\r
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "IndoorWalkModel::IndoorWalkTimer already exists!!");\r
         return;\r
     }\r
-    g_startCounting = osTimerNew((osTimerFunc_t)IndoorWalkTimerCallback, osTimerPeriodic, NULL, NULL);\r
-    if (g_startCounting == NULL) {\r
+    g_startCounting = osTimerNew((osTimerFunc_t)IndoorWalkTimerCallback, osTimerPeriodic, nullptr, nullptr);\r
+    if (g_startCounting == nullptr) {\r
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkModel::IndoorWalkTimer osTimerNew failed!!");\r
         return;\r
     }\r
@@ -300,13 +300,13 @@ void InitIndoorWalkTimer()
     osStatus_t retTimer = osTimerStart(g_startCounting, tick);\r
     if (retTimer != osOK) {\r
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkModel::IndoorWalkTimer osTimerStart failed, ret = %lx!!", retTimer);\r
-        if (g_startCounting != NULL) {\r
+        if (g_startCounting != nullptr) {\r
             retTimer = osTimerDelete(g_startCounting);\r
             if (retTimer != osOK) {\r
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkModel::osTimerDelete failed, ret = %lx!!", retTimer);\r
                 return;\r
             }\r
-            g_startCounting = NULL;\r
+            g_startCounting = nullptr;\r
         }\r
         return;\r
     }\r
@@ -314,13 +314,13 @@ void InitIndoorWalkTimer()
 /* 关闭定时器 */\r
 void DisableIndoorWalkTimer()\r
 {\r
-    if (g_startCounting != NULL) {\r
+    if (g_startCounting != nullptr) {\r
         osStatus_t ret = osTimerDelete(g_startCounting);\r
         if (ret != osOK) {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanTimerCallback osTimerDelete failed, ret = %lx!!", ret);\r
             return;\r
         }\r
-        g_startCounting = NULL;\r
+        g_startCounting = nullptr;\r
         g_motionTimes = 0;\r
     }\r
 }\r
index 326e860..6f3efcd 100644 (file)
@@ -135,7 +135,7 @@ bool IndoorWalkPreparedView::InitBatteryView() // 加载电量
         return false;\r
     }\r
     battery->SetPosition(BATTERY_X, BATTERY_Y);\r
-   // ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, battery, DROPDOWN_DROPDOWN_BATTERY);\r
+    ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, battery, DROPDOWN_DROPDOWN_BATTERY);\r
     group->Add(battery);\r
 \r
     batteryLable = new UILabel();\r
@@ -247,15 +247,15 @@ UIViewGroup *IndoorWalkPreparedView::InitShowUpView()
     walkButton->SetViewId(WALK_BUTTON);\r
     group->Add(walkButton);\r
     ret = InitBatteryView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return nullptr;\r
     }\r
     ret = InitHeartbeatView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return nullptr;\r
     }\r
     ret = InitLableVIew();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return nullptr;\r
     }\r
     UIView::OnDragListener *indoorWalkDragListener = (UIView::OnDragListener *)OHOS::IndoorWalkPresenter::GetInstance();\r
index 6e33f8f..6f817f0 100644 (file)
@@ -15,7 +15,7 @@
 \r
 namespace OHOS {\r
 static IndoorWalkPresenter *g_pIndoorWalkPresenter = nullptr;\r
-static string g_distancesChar;\r
+static std::string g_distancesChar;\r
 static constexpr uint16_t CENTERED_Y = 192;\r
 static constexpr uint32_t CONVERSION_NUM = 100000;\r
 static constexpr uint16_t STEP_CHAR_NUM = 255;\r
@@ -78,35 +78,36 @@ void IndoorWalkPresenter::WalkButtonOnClick(const char* id)
 void IndoorWalkPresenter::TimeViewOnClick(const char* id)\r
 {\r
     UNUSED(id);\r
-    string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView();\r
-    ModifiesProperties(selectPropertiesid.c_str(), IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+    std::string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView();\r
+    std::string duration = IndoorWalkModel::GetInstance()->DisplayMotionDuration();\r
+    ModifiesProperties(selectPropertiesid.c_str(), duration.c_str(), "时间");\r
 }\r
 \r
 void IndoorWalkPresenter::DistancesViewOnClick(const char* id)\r
 {\r
     UNUSED(id);\r
-    string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView();\r
+    std::string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView();\r
     ModifiesProperties(selectPropertiesid.c_str(), "0.00", "距离(km)");\r
 }\r
 \r
 void IndoorWalkPresenter::HeartViewOnClick(const char* id)\r
 {\r
     UNUSED(id);\r
-    string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView();\r
+    std::string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView();\r
     ModifiesProperties(selectPropertiesid.c_str(), "--", "心率(bpm)");\r
 }\r
 \r
 void IndoorWalkPresenter::SpeedViewOnClick(const char* id)\r
 {\r
     UNUSED(id);\r
-    string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView();\r
+    std::string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView();\r
     ModifiesProperties(selectPropertiesid.c_str(), "0.00", "速度(km/h)");\r
 }\r
 \r
 void IndoorWalkPresenter::StepsViewOnClick(const char* id)\r
 {\r
     UNUSED(id);\r
-    string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView();\r
+    std::string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView();\r
     char stepChar[STEP_CHAR_NUM] = {0};\r
     InitStepsValue(stepChar);\r
     ModifiesProperties(selectPropertiesid.c_str(), stepChar, "步数(steps)");\r
@@ -419,71 +420,61 @@ static const IndoorWalkPropertiesMapper g_pWalkPropertiesMapper[] = {
 \r
 void IndoorWalkPresenter::SetPropertiesPageFirstTop()\r
 {\r
-    string lableUnit;\r
-    lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstTop();\r
+    std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstTop();\r
     SetCustomizationState(lableUnit.c_str());\r
 }\r
 \r
 void IndoorWalkPresenter::SetPropertiesPageFirstLeft()\r
 {\r
-    string lableUnit;\r
-    lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstLeft();\r
+    std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstLeft();\r
     SetCustomizationState(lableUnit.c_str());\r
 }\r
 \r
 void IndoorWalkPresenter::SetPropertiesPageFirstRight()\r
 {\r
-    string lableUnit;\r
-    lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstRight();\r
+    std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstRight();\r
     SetCustomizationState(lableUnit.c_str());\r
 }\r
 \r
 void IndoorWalkPresenter::SetPropertiesPageFirstBottom()\r
 {\r
-    string lableUnit;\r
-    lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstBottom();\r
+    std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstBottom();\r
     SetCustomizationState(lableUnit.c_str());\r
 }\r
 \r
 void IndoorWalkPresenter::SetPropertiesPageSecondTop()\r
 {\r
-    string lableUnit;\r
-    lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondTop();\r
+    std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondTop();\r
     SetCustomizationState(lableUnit.c_str());\r
 }\r
 \r
 void IndoorWalkPresenter::SetPropertiesPageSecondLeft()\r
 {\r
-    string lableUnit;\r
-    lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondLeft();\r
+    std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondLeft();\r
     SetCustomizationState(lableUnit.c_str());\r
 }\r
 \r
 void IndoorWalkPresenter::SetPropertiesPageSecondRight()\r
 {\r
-    string lableUnit;\r
-    lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondRight();\r
+    std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondRight();\r
     SetCustomizationState(lableUnit.c_str());\r
 }\r
 \r
 void IndoorWalkPresenter::SetPropertiesPageThirdTop()\r
 {\r
-    string lableUnit;\r
-    lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdTop();\r
+    std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdTop();\r
     SetCustomizationState(lableUnit.c_str());\r
 }\r
 \r
 void IndoorWalkPresenter::SetPropertiesPageThirdBottom()\r
 {\r
-    string lableUnit;\r
-    lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdBottom();\r
+    std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdBottom();\r
     SetCustomizationState(lableUnit.c_str());\r
 }\r
 \r
 void IndoorWalkPresenter::SetPropertiesPageFourth()\r
 {\r
-    string lableUnit;\r
-    lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFourth();\r
+    std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFourth();\r
     SetCustomizationState(lableUnit.c_str());\r
 }\r
 \r
@@ -550,39 +541,36 @@ void IndoorWalkPresenter::SetCustomizationState(const char *lableUnit)
 \r
 void IndoorWalkPresenter::ModifiesTime()\r
 {\r
-    if (IndoorWalkModel::GetInstance()->DisplayMotionDuration() == nullptr) {\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkModel::GetInstance()->DisplayMotionDuration() nullptr");\r
-        return;\r
-    }\r
+    std::string duration = IndoorWalkModel::GetInstance()->DisplayMotionDuration();\r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFirstTop().c_str(), "时间") == 0) {\r
-        ModifiesPageFirstTop(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+        ModifiesPageFirstTop(duration.c_str(), "时间");\r
     }\r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFirstLeft().c_str(), "时间") == 0) {\r
-        ModifiesPageFirstLeft(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+        ModifiesPageFirstLeft(duration.c_str(), "时间");\r
     }\r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFirstRight().c_str(), "时间") == 0) {\r
-        ModifiesPageFirstRight(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+        ModifiesPageFirstRight(duration.c_str(), "时间");\r
     }\r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFirstBottom().c_str(), "时间") == 0) {\r
-        ModifiesPageFirstBottom(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+        ModifiesPageFirstBottom(duration.c_str(), "时间");\r
     }\r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitSecondTop().c_str(), "时间") == 0) {\r
-        ModifiesPageSecondTop(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+        ModifiesPageSecondTop(duration.c_str(), "时间");\r
     }\r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitSecondLeft().c_str(), "时间") == 0) {\r
-        ModifiesPageSecondLeft(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+        ModifiesPageSecondLeft(duration.c_str(), "时间");\r
     }\r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitSecondRight().c_str(), "时间") == 0) {\r
-        ModifiesPageSecondRight(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+        ModifiesPageSecondRight(duration.c_str(), "时间");\r
     }\r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitThirdTop().c_str(), "时间") == 0) {\r
-        ModifiesPageThirdTop(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+        ModifiesPageThirdTop(duration.c_str(), "时间");\r
     }\r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitThirdBottom().c_str(), "时间") == 0) {\r
-        ModifiesPageThirdBottom(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+        ModifiesPageThirdBottom(duration.c_str(), "时间");\r
     }\r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFourth().c_str(), "时间") == 0) {\r
-        ModifiesPageFourth(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间");\r
+        ModifiesPageFourth(duration.c_str(), "时间");\r
     }\r
 }\r
 \r
@@ -591,7 +579,7 @@ void IndoorWalkPresenter::ModifiesDistances(float value)
     g_distancesChar.erase();\r
     value -= IndoorWalkModel::GetInstance()->GetInitialDistances();\r
     value /= CONVERSION_NUM;\r
-    string g_distancesChar = to_string(value).substr(0, to_string(value).find(".") + 3);\r
+    g_distancesChar = std::to_string(value).substr(0, std::to_string(value).find(".") + 3);\r
 \r
     if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFirstTop().c_str(), "距离(km)") == 0) {\r
         ModifiesPageFirstTop(g_distancesChar.c_str(), "距离(km)");\r
index 23bd608..9c7e85f 100644 (file)
@@ -183,14 +183,14 @@ void IndoorWalkView::ChangeView(int16_t hideView, int16_t showView)
 {\r
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "IndoorWalkView::ChangeView %d, %d", hideView, showView);\r
 \r
-    if (CheckViewParam(hideView, showView) == false) {\r
+    if (!CheckViewParam(hideView, showView)) {\r
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkView::CheckViewParam failed.");\r
         return;\r
     }\r
 \r
     PreprosssChangeView tmpPreProcessView = preProcessView[showView];\r
 \r
-    if ((this->*tmpPreProcessView)(hideView, showView) == false) {\r
+    if (!(this->*tmpPreProcessView)(hideView, showView)) {\r
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkView::ChangeView %d %dfailed", showView, hideView);\r
         return;\r
     }\r
index 8a5be9c..a3da2bb 100644 (file)
@@ -83,13 +83,12 @@ bool MotionPageFifth::InitPageFifthImageView()
 bool MotionPageFifth::InitView(void *caller)\r
 {\r
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MotionPageFifth InitView %p", caller);\r
-    bool ret;\r
-    ret = InitPageFifthLableView();\r
-    if (ret == false) {\r
+    bool ret = InitPageFifthLableView();\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageFifthImageView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     return true;\r
index 02dbf59..c16b941 100644 (file)
@@ -107,8 +107,8 @@ void MotionPageFirst::SetUnitLableTemplate(UILabel *label)
 \r
 bool MotionPageFirst::InitPageFirstLableTopView()\r
 {\r
-    string lable;\r
-    string lableUnit;\r
+    std::string lable;\r
+    std::string lableUnit;\r
     lable = IndoorWalkModel::GetInstance()->GetTextLableFirstTop();\r
     lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstTop();\r
     if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) {\r
@@ -139,8 +139,8 @@ bool MotionPageFirst::InitPageFirstLableTopView()
 \r
 bool MotionPageFirst::InitPageFirstLableLeftView()\r
 {\r
-    string lable;\r
-    string lableUnit;\r
+    std::string lable;\r
+    std::string lableUnit;\r
     lable = IndoorWalkModel::GetInstance()->GetTextLableFirstLeft();\r
     lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstLeft();\r
     if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) {\r
@@ -172,8 +172,8 @@ bool MotionPageFirst::InitPageFirstLableLeftView()
 \r
 bool MotionPageFirst::InitPageFirstLableRightView()\r
 {\r
-    string lable;\r
-    string lableUnit;\r
+    std::string lable;\r
+    std::string lableUnit;\r
     lable = IndoorWalkModel::GetInstance()->GetTextLableFirstRight();\r
     lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstRight();\r
     if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) {\r
@@ -204,8 +204,8 @@ bool MotionPageFirst::InitPageFirstLableRightView()
 \r
 bool MotionPageFirst::InitPageFirstLableBottomView()\r
 {\r
-    string lable;\r
-    string lableUnit;\r
+    std::string lable;\r
+    std::string lableUnit;\r
     lable = IndoorWalkModel::GetInstance()->GetTextLableFirstBottom();\r
     lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstBottom();\r
     if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) {\r
@@ -357,23 +357,23 @@ bool MotionPageFirst::InitView(void *caller)
     backGroundFirst->SetSrc(PNG_WALK_BACK_GROUND);\r
     Add(backGroundFirst);\r
     ret = InitPageFirstLableTopView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageFirstLableLeftView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageFirstLableRightView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageFirstLableBottomView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageFirstImageView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     HideInitPageFirstImageView();\r
index 4c72740..a43ab8f 100644 (file)
@@ -44,8 +44,8 @@ MotionPageFourth *MotionPageFourth::GetInstance()
 \r
 bool MotionPageFourth::InitPageFourthLableView()\r
 {\r
-    string lable;\r
-    string lableUnit;\r
+    std::string lable;\r
+    std::string lableUnit;\r
     lable = IndoorWalkModel::GetInstance()->GetTextLableFourth();\r
     lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFourth();\r
     if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) {\r
@@ -153,16 +153,15 @@ bool MotionPageFourth::InitView(void *caller)
     backGroundFourth->SetSrc(PNG_WALK_BACK_GROUND);\r
     Add(backGroundFourth);\r
     ret = InitPageFourthLableView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageFourthImageView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     HideInitPageFourthImageView();\r
     SetTouchable(true);\r
     return true;\r
-\r
 }\r
 }
\ No newline at end of file
index 545fb69..34e136d 100644 (file)
@@ -81,8 +81,8 @@ void MotionPageSecond::SetLableTemplate(UILabel *label)
 \r
 bool MotionPageSecond::InitPageSecondLableTopView()\r
 {\r
-    string lable;\r
-    string lableUnit;\r
+    std::string lable;\r
+    std::string lableUnit;\r
     lable = IndoorWalkModel::GetInstance()->GetTextLableSecondTop();\r
     lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondTop();\r
     if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) {\r
@@ -114,8 +114,8 @@ bool MotionPageSecond::InitPageSecondLableTopView()
 \r
 bool MotionPageSecond::InitPageSecondLableLeftView()\r
 {\r
-    string lable;\r
-    string lableUnit;\r
+    std::string lable;\r
+    std::string lableUnit;\r
     lable = IndoorWalkModel::GetInstance()->GetTextLableSecondLeft();\r
     lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondLeft();\r
     if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) {\r
@@ -147,8 +147,8 @@ bool MotionPageSecond::InitPageSecondLableLeftView()
 \r
 bool MotionPageSecond::InitPageSecondLableRightView()\r
 {\r
-    string lable;\r
-    string lableUnit;\r
+    std::string lable;\r
+    std::string lableUnit;\r
     lable = IndoorWalkModel::GetInstance()->GetTextLableSecondRight();\r
     lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondRight();\r
     if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) {\r
@@ -292,24 +292,23 @@ bool MotionPageSecond::InitView(void *caller)
     backGroundSecond->SetSrc(PNG_WALK_BACK_GROUND);\r
     Add(backGroundSecond);\r
     ret = InitPageSecondLableTopView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageSecondLableLeftView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageSecondLableRightView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageSecondImageView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     HideInitPageSecondImageView();\r
     SetTouchable(true);\r
     return true;\r
-\r
 }\r
 }
\ No newline at end of file
index a0898ba..668d78c 100644 (file)
@@ -71,8 +71,8 @@ void MotionPageThird::SetLableTemplate(UILabel *label)
 \r
 bool MotionPageThird::InitPageThirdLableTopView()\r
 {\r
-    string lable;\r
-    string lableUnit;\r
+    std::string lable;\r
+    std::string lableUnit;\r
     lable = IndoorWalkModel::GetInstance()->GetTextLableThirdTop();\r
     lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdTop();\r
     if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) {\r
@@ -115,8 +115,8 @@ void MotionPageThird::SetUnitLableTemplate(UILabel *label)
 \r
 bool MotionPageThird::InitPageThirdLableBottomView()\r
 {\r
-    string lable;\r
-    string lableUnit;\r
+    std::string lable;\r
+    std::string lableUnit;\r
     lable = IndoorWalkModel::GetInstance()->GetTextLableThirdBottom();\r
     lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdBottom();\r
     if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) {\r
@@ -227,15 +227,15 @@ bool MotionPageThird::InitView(void *caller)
     backGroundThird->SetSrc(PNG_WALK_BACK_GROUND);\r
     Add(backGroundThird);\r
     ret = InitPageThirdLableTopView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageThirdLableBottomView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     ret = InitPageThirdImageView();\r
-    if (ret == false) {\r
+    if (!ret) {\r
         return false;\r
     }\r
     HideInitPageThirdImageView();\r
index 98705f6..777adfe 100644 (file)
@@ -636,7 +636,7 @@ void VoiceAssistance::ExitProgress()
                 return;\r
             }\r
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Too long no operate, now exit vocassist");\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
             return;\r
         } else if (quitStatus == CONTINUTE_EXIT_MODE2) {\r
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Too long no operate, now change model to vocassist label");\r
index bf9e632..9ddd6d9 100644 (file)
@@ -70,7 +70,7 @@ namespace OHOS
         // if (strcmp(view.GetViewId(), 控件ID) == 0)\r
         if (strcmp(view.GetViewId(), "button1") == 0)\r
         {\r
-            // NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+            // NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
             uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId();\r
             NativeAbility::GetInstance().ChangeSlice(preSlice);\r
         }\r
index 5644098..b9ea61d 100644 (file)
@@ -49,8 +49,8 @@ static void ChangeToHomeView(void)
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetNativeAbilityState = %u",
                       OHOS::NativeAbility::GetInstance().GetNativeAbilityState());
         if (OHOS::NativeAbility::GetInstance().GetNativeAbilityState() == STATE_ACTIVE) {
-            if (current_slice_id != VIEW_MAIN_SAMPLE) { // 主表盘
-                OHOS::NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+            if (current_slice_id != VIEW_MAIN) { // 主表盘
+                OHOS::NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
             } else {
                 if (!OHOS::MainViewSample::GetInstance()->IsMainClockPage()) {
                     // 当前页面为主表盘的其他页面时,切换回主表盘页面
index 2c3ae78..6ad00d5 100644 (file)
@@ -51,7 +51,7 @@ namespace OHOS {
     {
         uint8_t pageIndex = view_->GetCoverflowPage();
         model->SaveDialSetting(pageIndex);
-        NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+        NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
     }
 
     bool SetDialPresenter::OnClick(UIView &view, const ClickEvent &event)