1.AppViewIDs.h中 将每一个id重新命名使其见名知意
author罗正yun <1732036298@qq.com>
Sat, 20 Jan 2024 07:56:10 +0000 (15:56 +0800)
committer罗正yun <1732036298@qq.com>
Sat, 20 Jan 2024 07:56:10 +0000 (15:56 +0800)
17 files changed:
code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h
code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp
code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp
code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h
code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp
code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp
code/sdk/application/wearable/nativeapp/nativeui/dial/src/DialPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp
code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp
code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp
code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp
code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp

index 4b74273..9beb592 100755 (executable)
  */
 typedef enum : uint16_t
 {
-    VIEW_INVALID = 0,     // 无效视图
-    VIEW_MAIN_SAMPLE = 1, // 主界面
-    VIEW_SETTING,         // 设置
-    VIEW_APPLIST,         // App应用
-    VIEW_MAIN_ALARM,      // 闹钟
-    VIEW_SETTING_FIRST,
-    VIEW_MAIN_ACTIVITY,
-    VIEW_ALARM_POP_UP,
-    VIEW_CALLER_SAMPLE,
-    VIEW_MAEKPHONE_SAMPLE,
-    VIEW_BLOODOXY_SAMPLE,
-    VIEW_BLUETOOTH_EARPHONE,
-    VIEW_OFFLINEVOICE,
-    VIEW_WIFI,
-    VIEW_VOLUME,
-    VIEW_COMPASS,
-    VIEW_CONNECT_PHONE,
-    VIEW_MAIN_TEMP,
-    VIEW_INDOORWALK,
-    VIEW_REBOOT,
-    VIEW_UISAMPLE,
+    VIEW_INVALID = 0,            // 无效视图
+    /* ----------------------------- 每一个id对应一个slice ----------------------------- */
+    VIEW_MAIN = 1,               // 主界面
+    VIEW_SETTING,                // 设置
+    VIEW_APPLIST,                // App应用
+    VIEW_MAIN_ALARM,             // 闹钟
+    VIEW_ALARM_POP_UP,           // 闹铃界面
+    VIEW_BLUETOOTH_EARPHONE,     // 连接蓝牙耳机界面
+    VIEW_CALLER_LOG,             // 通话记录界面
+    VIEW_INCOMING_CALL,          // 来电界面
+    VIEW_BLOODOXY,               // 血氧饱和度界面
+    VIEW_COMPASS,                // 指南针界面
+    VIEW_CONNECT_PHONE,          // 连接手机界面
+    VIEW_INDOORWALK,             // 室内步行
+    VIEW_SHUTDOWN_OR_REBOOT,     // 关机或重启界面
     VIEW_DIAL,                   // 切换表盘
     VIEW_WEATHER,                // 天气
     VIEW_WEATHER_REPORT,         // 气象报告
     VIEW_FUTURE_WEATHER,         // 未来天气
     VIEW_GET_WEATHER_DATA_ERROR, // 获取天气数据失败
     /* -------------------------------------------------------------------------- */
-    VIEW_MAX_INTER_APP,       // 在此之前添加native应用ID.
-    VIEW_EXTERN_APP = 0xFFFE, // 三方应用
+    VIEW_MAIN_TEMP,              // 体温界面(暂时不用)
+    VIEW_OFFLINEVOICE,           // 语音助手界面(暂时不用)
+    VIEW_MAIN_ACTIVITY,          // 记录步数界面(暂时不用)
+    VIEW_UISAMPLE,               // 示例(暂时不用)
+    /* -------------------------------------------------------------------------- */
+    VIEW_MAX_INTER_APP,          // 在此之前添加native应用ID.
+    VIEW_EXTERN_APP = 0xFFFE,    // 三方应用
     VIEW_INVALIDE_APP = 0xFFFF,
 } AppViewId;
 
index d9e9e20..d90ee3c 100755 (executable)
@@ -89,49 +89,45 @@ namespace OHOS
     };
 
     static const AppViewMapper SLICE_MAPPER[] = {
+        {VIEW_MAIN, &NativeLauncher::InitMainSampleSlice},
         {VIEW_SETTING, &NativeLauncher::InitSettingSlice},
         {VIEW_APPLIST, &NativeLauncher::InitApplistSlice},
-        {VIEW_MAIN_SAMPLE, &NativeLauncher::InitMainSampleSlice},
         {VIEW_MAIN_ALARM, &NativeLauncher::InitMainAlarmSlice},
         {VIEW_ALARM_POP_UP, &NativeLauncher::InitAlarmPopUpSlice},
-        {VIEW_BLOODOXY_SAMPLE, &NativeLauncher::InitMainBloodOxyView},
-        {VIEW_MAIN_ACTIVITY, &NativeLauncher::InitActivitySlice},
-        {VIEW_CALLER_SAMPLE, &NativeLauncher::InitMainCallerLogView},
-        {VIEW_MAEKPHONE_SAMPLE, &NativeLauncher::InitMainMakePhoneView},
         {VIEW_BLUETOOTH_EARPHONE, &NativeLauncher::InitBluetoothSlice},
+        {VIEW_CALLER_LOG, &NativeLauncher::InitMainCallerLogView},
+        {VIEW_INCOMING_CALL, &NativeLauncher::InitMainMakePhoneView},
+        {VIEW_BLOODOXY, &NativeLauncher::InitMainBloodOxyView},
         {VIEW_COMPASS, &NativeLauncher::InitCompassSlice},
-        {VIEW_OFFLINEVOICE, &NativeLauncher::InitOfflineVoice},
         {VIEW_CONNECT_PHONE, &NativeLauncher::InitConnectPhoneSlice},
-        {VIEW_MAIN_TEMP, &NativeLauncher::InitMainTempSlice},
         {VIEW_INDOORWALK, &NativeLauncher::InitIndoorWalkSlice},
-        {VIEW_REBOOT, &NativeLauncher::InitRebootSlice},
-
+        {VIEW_SHUTDOWN_OR_REBOOT, &NativeLauncher::InitRebootSlice},
         {VIEW_DIAL, &NativeLauncher::InitDialSlice},
         {VIEW_WEATHER,&NativeLauncher::InitWeatherSlice},                                            //天气
         {VIEW_WEATHER_REPORT,&NativeLauncher::InitWeatherReportSlice},                               //气象报告
         {VIEW_FUTURE_WEATHER,&NativeLauncher::InitFutureWeatherSlice},                               //未来天气
         {VIEW_GET_WEATHER_DATA_ERROR,&NativeLauncher::InitGetWeatherDataErrorSlice},                 //获取天气数据失败
-        {VIEW_UISAMPLE, &NativeLauncher::InitUISampleSlice}};
+        //{VIEW_MAIN_ACTIVITY, &NativeLauncher::InitActivitySlice},
+        //{VIEW_OFFLINEVOICE, &NativeLauncher::InitOfflineVoice},
+        //{VIEW_MAIN_TEMP, &NativeLauncher::InitMainTempSlice},
+        //{VIEW_UISAMPLE, &NativeLauncher::InitUISampleSlice}
+        };
 
     static const ViewIdToString VIEW_MAPPER[] = {
+        {VIEW_MAIN, "mainView"},
         {VIEW_SETTING, "setting"},
         {VIEW_APPLIST, "applist"},
-        {VIEW_MAIN_SAMPLE, "mainViewSample"},
         {VIEW_MAIN_ALARM, "mainAlarmView"},
         {VIEW_ALARM_POP_UP, "alarmPopUpView"},
-        {VIEW_BLOODOXY_SAMPLE, "bloodOxygenView"},
-        {VIEW_MAIN_ACTIVITY, "mainActivityView"},
-        {VIEW_CALLER_SAMPLE, "callerLogView"},
-        {VIEW_MAEKPHONE_SAMPLE, "makePhoneView"},
         {VIEW_BLUETOOTH_EARPHONE, "mainBluetoothView"},
+        {VIEW_CALLER_LOG, "callerLogView"},
+        {VIEW_INCOMING_CALL, "makePhoneView"},
+        {VIEW_BLOODOXY, "bloodOxygenView"},
         {VIEW_COMPASS, "mainCompassView"},
-        {VIEW_OFFLINEVOICE, "offlineVoiceView"},
         {VIEW_CONNECT_PHONE, "ConnectPhoneView"},
-        {VIEW_MAIN_TEMP, "mianTempView"},
         {VIEW_INDOORWALK, "IndoorWalkView"},
-        {VIEW_REBOOT, "RebootView"},
-        {VIEW_UISAMPLE, "UISample"}};
-
+        {VIEW_SHUTDOWN_OR_REBOOT, "RebootView"}};
+    
     NativeLauncher::NativeLauncher() {}
     NativeLauncher::~NativeLauncher() {}
 
@@ -158,7 +154,7 @@ namespace OHOS
         BluetoothModel::GetInstance()->Init();
         // 初始化默认首页
         ScreenModels::GetInstance()->PreLoadAppimages();
-        NativeAbility::GetInstance().SetDefaultSliceId(VIEW_MAIN_SAMPLE);
+        NativeAbility::GetInstance().SetDefaultSliceId(VIEW_MAIN);
     }
 
     void NativeLauncher::InitAllNativeSlices(void)
@@ -184,7 +180,7 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainViewSample is nullptr");
             return;
         }
-        NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_SAMPLE, mainViewSample);
+        NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN, mainViewSample);
     }
 
     void NativeLauncher::InitMainAlarmSlice(void)
@@ -244,7 +240,7 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "rebootView is nullptr");
             return;
         }
-        NativeAbility::GetInstance().AddSliceProxy(VIEW_REBOOT, rebootView);
+        NativeAbility::GetInstance().AddSliceProxy(VIEW_SHUTDOWN_OR_REBOOT, rebootView);
     }
 
     void NativeLauncher::InitConnectPhoneSlice(void)
@@ -280,7 +276,7 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodOxygenView is nullptr");
             return;
         }
-        NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODOXY_SAMPLE, bloodOxygenView);
+        NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODOXY, bloodOxygenView);
     }
 
     void NativeLauncher::InitMainMakePhoneView(void)
@@ -292,7 +288,7 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makePhoneView is nullptr");
             return;
         }
-        NativeAbility::GetInstance().AddSliceProxy(VIEW_MAEKPHONE_SAMPLE, makePhoneView);
+        NativeAbility::GetInstance().AddSliceProxy(VIEW_INCOMING_CALL, makePhoneView);
     }
 
     void NativeLauncher::InitMainCallerLogView(void)
@@ -304,7 +300,7 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "callerLogView is nullptr");
             return;
         }
-        NativeAbility::GetInstance().AddSliceProxy(VIEW_CALLER_SAMPLE, callerLogView);
+        NativeAbility::GetInstance().AddSliceProxy(VIEW_CALLER_LOG, callerLogView);
     }
 
     void NativeLauncher::InitActivitySlice(void)
index 14a8cd0..b2d0918 100755 (executable)
@@ -833,8 +833,8 @@ uint16_t AlarmClockModel::JudgePreSlice(void)
     uint16_t preSlice;
     preSlice = NativeAbility::GetInstance().GetPreSliceId();
     if (preSlice == VIEW_ALARM_POP_UP || preSlice < VIEW_SETTING) {
-        preSlice = VIEW_MAIN_SAMPLE;
-    } else if ((preSlice == VIEW_MAEKPHONE_SAMPLE) &&
+        preSlice = VIEW_MAIN;
+    } else if ((preSlice == VIEW_INCOMING_CALL) &&
     (GetCurrCallNum() == 0 || GetScoConnectState() != HFP_SCO_STATE_CONNECTED)) {
         int num;
         PhoneCallInfo callList[MULTI_CALL_MAX_NUME]{};
@@ -842,7 +842,7 @@ uint16_t AlarmClockModel::JudgePreSlice(void)
         if (GetCurrCallNum() == 1 && callList[0].lastStatus == HFP_HF_CALL_STATE_INCOMING) {
             return preSlice;
         }
-        preSlice = VIEW_MAIN_SAMPLE;
+        preSlice = VIEW_MAIN;
     }
     return preSlice;
 }
index 08c4bb2..e77a9ef 100755 (executable)
@@ -49,7 +49,7 @@ public:
         if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) &&
             (event.GetDeltaX() > X_DRAG_OFFSET) && (event.GetDeltaX() > (DOUBLES * MATH_ABS(event.GetDeltaY())))) {
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Applist Ondrag!!");
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM);
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TRANSITION_ZOOM);
         }
 
         return false;
index a9d386a..8708e29 100755 (executable)
@@ -21,14 +21,14 @@ namespace OHOS
 {
     const AppItem g_nativeAppList[] = {
         {VIEW_MAIN_ALARM, PNG_APPLIST_ALARM_IMAGE, PNG_APPLIST_ALARM_IMAGE, "闹钟", nullptr},
-        {VIEW_BLOODOXY_SAMPLE, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_SPO2_IMAGE, "血氧饱和度", nullptr},
+        {VIEW_BLOODOXY, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_SPO2_IMAGE, "血氧饱和度", nullptr},
         {VIEW_COMPASS, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_COMPASS_IMAGE, "指南针", nullptr},
         {VIEW_INDOORWALK, PNG_APPLIST_WALK_IMAGE, PNG_APPLIST_WALK_IMAGE, "室内步行", nullptr},
         {VIEW_WEATHER, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_WEATHER_IMAGE, "天气", nullptr},
         {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "设置", nullptr},
 #if 0
         {VIEW_MAIN_TEMP, PNG_APPLIST_TEMP_IMAGE, PNG_APPLIST_TEMP_IMAGE, "体温", nullptr},
-        {VIEW_CALLER_SAMPLE, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_CALLER_IMAGE, "通话记录", nullptr},
+        {VIEW_CALLER_LOG, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_CALLER_IMAGE, "通话记录", nullptr},
         {VIEW_OFFLINEVOICE, PNG_APPLIST_VOCASSIST_IMAGE, PNG_APPLIST_VOCASSIST_IMAGE, "语音助手", nullptr},
         {VIEW_UISAMPLE, PNG_APPLIST_UI_SAMPLE_IMAGE, PNG_APPLIST_UI_SAMPLE_IMAGE, "示例", nullptr},
 #endif
index 1fa5d17..5e00836 100755 (executable)
@@ -84,7 +84,7 @@ static void StatusReset()
     DisableCallingTimer();
     // If the call is handling in the notification, the slice is not switched
     if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) {
-        NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+        NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
     }
     return;
 }
@@ -219,11 +219,11 @@ static int g_callOperate = OPERATE_NO_OPE;
 
 static void ExitMakePhoneSlice(void)
 {
-    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE) {
+    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL) {
         WEARABLE_LOGD(HILOG_MODULE_AAFWK, "ExitMakePhoneSlice");
 
         if (GetCurrCallNum() == 0) {
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
             CallModelPostGraphicEvent(CallModelResumePlayer);
         } else {
             NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST);
@@ -262,13 +262,13 @@ static void WaitingOpreate()
     CallerLogModel::GetInstance()->SetWaitingStatus(true);
     // If the call is handling in the notification, the slice is not switched
     if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) {
-        NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+        NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
     }
 }
 
 static void WatchActiveHandle(const PhoneCallInfo *phoneCall)
 {
-    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
+    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||
         NativeAbility::GetInstance().GetCurSliceId() == VIEW_OFFLINEVOICE ||
         CallerLogModel::GetInstance()->GetNotifyFlag() == true) {
         time_t seconds;
@@ -282,7 +282,7 @@ static void WatchActiveHandle(const PhoneCallInfo *phoneCall)
 
 static void PhoneActiveHandle(void)
 {
-    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
+    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||
         CallerLogModel::GetInstance()->GetNotifyFlag() == true) {
         if (GetCurrCallNum() > 1) {
             g_phoneStatus = PHONE_MULTI_STATUS;
@@ -293,7 +293,7 @@ static void PhoneActiveHandle(void)
         TransCallToMobilePhone();
         // If the call is handling in the notification, the slice is not switched
         if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) {
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); // 退出通话界面,回到主表盘应用
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); // 退出通话界面,回到主表盘应用
         }
         CallModelPostGraphicEvent(CallModelResumePlayer);
     }
@@ -303,7 +303,7 @@ static void PhoneActiveHandle(void)
 
 static void OppoActiveHandle(const PhoneCallInfo *phoneCall)
 {
-    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
+    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||
         CallerLogModel::GetInstance()->GetNotifyFlag() == true) {
         if (GetCurrCallNum() > 1) {
             g_phoneStatus = PHONE_MULTI_STATUS;
@@ -355,12 +355,12 @@ bool MulitplePhoneTextReplaces()
 static bool MultiplePhonesViewDisplay()
 {
     if (g_phoneStatus == PHONE_MULTI_STATUS) {
-        if (NativeAbility::GetInstance().GetCurSliceId() != VIEW_MAEKPHONE_SAMPLE) {
-            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay]GetCurSliceId no VIEW_MAEKPHONE_SAMPLE");
+        if (NativeAbility::GetInstance().GetCurSliceId() != VIEW_INCOMING_CALL) {
+            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay]GetCurSliceId no VIEW_INCOMING_CALL");
             DisableCallingTimer();
             CallerLogModel::GetInstance()->SetMulitplePhoneStatus(true);
             CallerLogModel::GetInstance()->SetCallStatus(true);
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+            NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
             return true;
         }
         if (MulitplePhoneTextReplaces() == false) {
@@ -374,7 +374,7 @@ static bool MultiplePhonesViewDisplay()
 /* 非手表挂断 */
 static void NonWatchFinishHandle(int laststatus)
 {
-    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
+    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||
         CallerLogModel::GetInstance()->GetNotifyFlag() == true) {
         if (GetCurrCallNum() == 0) {
             StatusReset();
@@ -392,7 +392,7 @@ static void NonWatchFinishHandle(int laststatus)
             }
             // If the call is handling in the notification, the slice is not switched
             if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) {
-                NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+                NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
             }
         }
         CallerLogModel::GetInstance()->SetNotifyFlag(false);
@@ -404,7 +404,7 @@ static void NonWatchFinishHandle(int laststatus)
 
 static void WatchFinishHandle(void)
 {
-    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
+    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||
         CallerLogModel::GetInstance()->GetNotifyFlag() == true) {
         if (GetCurrCallNum() == 0) {
             StatusReset();
@@ -443,7 +443,7 @@ static void ChangeStatusScreendisplay(int lastStatus)
     }
     // If the call is handling in the notification, the slice is not switched
     if (g_callOperate != OPERATE_PHONE_ACTIVE && CallerLogModel::GetInstance()->GetNotifyFlag() != true) {
-        NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+        NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
     }
 }
 
@@ -566,7 +566,7 @@ static void ScoConnectHandle(void)
     }
     // If the call is handling in the notification, the slice is not switched
     if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) {
-        NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+        NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
     }
 }
 
index 5ffd7f6..ebf098d 100644 (file)
@@ -57,7 +57,7 @@ namespace OHOS
         if (event.GetDragDirection() == DragEvent::DIRECTION_BOTTOM_TO_TOP)\r
         {\r
             // printf("draglistene is ok!\n");\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
         }\r
         UNUSED(view);\r
         return true;\r
@@ -99,35 +99,35 @@ namespace OHOS
             // printf("join click\n");\r
             const std::string jsonPath = "/user/res/clocks/KUMI.json";\r
             g_pDigital_clockView->setJsonFilePath(jsonPath);\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
         }\r
         if (strcmp(view.GetViewId(), "flowerbudbutton") == 0)\r
         {\r
             // printf("join click\n");\r
             const std::string jsonPath = "/user/res/clocks/flowerbud.json";\r
             g_pDigital_clockView->setJsonFilePath(jsonPath);\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
         }\r
         if (strcmp(view.GetViewId(), "maomaobutton") == 0)\r
         {\r
             // printf("join click\n");\r
             const std::string jsonPath = "/user/res/clocks/maomao.json";\r
             g_pDigital_clockView->setJsonFilePath(jsonPath);\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
         }\r
         if (strcmp(view.GetViewId(), "momobutton") == 0)\r
         {\r
             // printf("join click\n");\r
             const std::string jsonPath = "/user/res/clocks/momo.json";\r
             g_pDigital_clockView->setJsonFilePath(jsonPath);\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
         }\r
         if (strcmp(view.GetViewId(), "maliaobutton") == 0)\r
         {\r
             // printf("join click\n");\r
             const std::string jsonPath = "/user/res/clocks/maliao.json";\r
             g_pDigital_clockView->setJsonFilePath(jsonPath);\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
         }\r
 #endif\r
         return true;\r
index cee72e8..f8bf006 100755 (executable)
@@ -326,7 +326,7 @@ void HeartModel::RefreshHeartRateScreen(uint16_t perSec, uint16_t rest, uint16_t
     rateData = GetAveHeartRate();
 
     uint16_t currentViewId = NativeAbility::GetInstance().GetCurSliceId();
-    if (currentViewId == VIEW_MAIN_SAMPLE && MainClockView::GetInstance() != nullptr) {
+    if (currentViewId == VIEW_MAIN && MainClockView::GetInstance() != nullptr) {
         MainClockView::GetInstance()->RefreshHeartRate(perSec);
     }
 
index 976e9bd..23c3f83 100755 (executable)
@@ -56,7 +56,7 @@ void KeyInputListener::OnKeyLongPress(const KeyEvent& event)
     WEARABLE_LOGD("","into key! keyID %u\n",keyID);
     if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER)) { // 电源按键
         // 切换到关机/重启卡片
-        NativeAbility::GetInstance().ChangeSlice(VIEW_REBOOT);
+        NativeAbility::GetInstance().ChangeSlice(VIEW_SHUTDOWN_OR_REBOOT);
     } else if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC)) { // 功能按键
         // 切换到查看系统版本卡片
     }
@@ -91,19 +91,19 @@ void KeyInputListener::OnKeyRelease(const KeyEvent& event)
         if (longPressFlag == 0 && pressFlag == 1) { // 短按电源键
 
 
-            if (currentViewId == VIEW_MAEKPHONE_SAMPLE || IsCallingNotify() == true) { // 音量卡片
+            if (currentViewId == VIEW_INCOMING_CALL || IsCallingNotify() == true) { // 音量卡片
                 // 音量+
                 CallVolumeDipSwitchControl(1);
-            }else if (currentViewId != VIEW_MAIN_SAMPLE) { // 主表盘
+            }else if (currentViewId != VIEW_MAIN) { // 主表盘
                 if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
                     PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
-                    NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM);
+                    NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TRANSITION_ZOOM);
                 }
             } else {
                 if (!MainViewSample::GetInstance()->IsMainView()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面
                     if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
                         PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
-                        NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+                        NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
                     }
                 } else {
                     //power键要进入休眠
@@ -117,19 +117,19 @@ void KeyInputListener::OnKeyRelease(const KeyEvent& event)
         }
     } else if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC)) { // 功能按键
         if (longPressFlag == 0 && pressFlag == 1) { // 短按功能键
-            if (currentViewId == VIEW_MAEKPHONE_SAMPLE || IsCallingNotify() == true) { // 音量卡片
+            if (currentViewId == VIEW_INCOMING_CALL || IsCallingNotify() == true) { // 音量卡片
                 // 音量-
                 CallVolumeDipSwitchControl(0);
-            } else if (currentViewId != VIEW_MAIN_SAMPLE) { // 主表盘
+            } else if (currentViewId != VIEW_MAIN) { // 主表盘
                if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
                     PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
-                    NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM);
+                    NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TRANSITION_ZOOM);
                }
             } else {
                 if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
                    PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
                     if (!MainViewSample::GetInstance()->IsMainView()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面
-                        NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+                        NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
                     } else {
                         NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TRANSITION_ZOOM);
                     }
index 6497b1f..9a390ac 100755 (executable)
 namespace OHOS
 {
 
-map<string, AppViewId> g_jumpView = { { MAIN_CLICK_WEATHER, VIEW_MAIN_SAMPLE },            // 天气界面
+map<string, AppViewId> g_jumpView = { { MAIN_CLICK_WEATHER, VIEW_MAIN },            // 天气界面
                                       { MAIN_CLICK_ACTIVITY, VIEW_MAIN_ACTIVITY },         // 活动记录界面
-                                      { MAIN_CLICK_MESSAGE, VIEW_MAIN_SAMPLE },            // 消息app
-                                      { MAIN_CLICK_HEARTRATE, VIEW_MAIN_SAMPLE },          // 心率界面
+                                      { MAIN_CLICK_MESSAGE, VIEW_MAIN },            // 消息app
+                                      { MAIN_CLICK_HEARTRATE, VIEW_MAIN },          // 心率界面
                                       { DROPDOWN_CLICK_SETTING,VIEW_SETTING},              // 设置
                                       { DROPDOWN_CLICK_BLUETOOTH,VIEW_BLUETOOTH_EARPHONE}, // 蓝牙
                                       };
index 2777b08..6c85f80 100755 (executable)
@@ -174,7 +174,7 @@ bool MainCallingPresenter::HintsHandupClick()
     }
     CallerLogModel::GetInstance()->SetWaitingStatus(false);
     CallerLogModel::GetInstance()->SetCallStatus(true);
-    NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+    NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
     return true;
 }
 
index 83d7edc..d7f9b04 100755 (executable)
@@ -117,7 +117,7 @@ bool VocassistPresenter::OnDrag(UIView& view, const DragEvent& event)
         strcmp(view.GetViewId(), VOC_ID) == 0) { // 语音助手右滑退出
         int phoneStatus = VocassistModel::GetInstance()->GetPhoneDetailStatus();    // 扫描设置此时通话的状态和个数
         if (phoneStatus == ONE_ROAD_AND_INCOMING) {
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE);
+            NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL);
         } else {
             NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST);
         }
index 2122a80..893cbd9 100755 (executable)
@@ -632,11 +632,11 @@ void VoiceAssistance::ExitProgress()
         if (quitStatus == CONTINUTE_EXIT_MODE1) {
             int phoneStatus = VocassistModel::GetInstance()->GetPhoneDetailStatus();    // 扫描设置此时通话的状态和个数
             if (phoneStatus == ONE_ROAD_AND_INCOMING) {
-                NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, gSliceDefaultPriority); // 返回来电界面
+                NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, gSliceDefaultPriority); // 返回来电界面
                 return;
             }
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Too long no operate, now exit vocassist");
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
             return;
         } else if (quitStatus == CONTINUTE_EXIT_MODE2) {
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Too long no operate, now change model to vocassist label");
index 9f3c9c0..8675b25 100755 (executable)
@@ -872,7 +872,7 @@ void PlayerInterruptListener::ResumePlayer(void)
 {\r
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] start");\r
     usleep(50000); // 确保界面切换完成\r
-    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||\r
+    if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||\r
         (GetCurrCallState() != HFP_HF_CALL_STATE_FINISHED && GetScoConnectState() == HFP_SCO_STATE_CONNECTED)) {\r
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] this is in calling");\r
         return; // 通话界面,禁止音乐恢复播放\r
index 47de858..489cb3b 100755 (executable)
@@ -75,7 +75,7 @@ bool RebootPresenter::OnDrag(UIView& view, const DragEvent& event)
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RebootPresenter::OnDrag");
     if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) {
         if (strcmp(view.GetViewId(), REBOOT_VIEW) == 0) {
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
         } else if (strcmp(view.GetViewId(), REBOOTDEVICE_VIEW) == 0) {
             if (RebootModel::GetInstance()->GetExitsView() == 0) {
                 RebootView::GetInstance()->ChangeView(REBOOTDEVICEVIEW, REBOOTVIEW);
index db3d965..4f21374 100755 (executable)
@@ -27,11 +27,11 @@ namespace OHOS
         settings[2] = {SETTING_ITEM_TWO, PNG_SETTINGS_SOUND_VIBRATION, "声音与震动", true};
         settings[3] = {SETTING_ITEM_THREE, PNG_SETTINGS_SECONDARY_FUNCTION, "辅助功能", true};
         settings[4] = {SETTING_ITEM_FOUR, PNG_SETTINGS_SYSTEM, "系统", true};
-        settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_ZERO, VIEW_REBOOT));
+        settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_ZERO, VIEW_SHUTDOWN_OR_REBOOT));
         settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_ONE, VIEW_BLUETOOTH_EARPHONE));
-        settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_TWO, VIEW_REBOOT));
-        settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_THREE, VIEW_REBOOT));
-        settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_FOUR, VIEW_REBOOT));
+        settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_TWO, VIEW_SHUTDOWN_OR_REBOOT));
+        settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_THREE, VIEW_SHUTDOWN_OR_REBOOT));
+        settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_FOUR, VIEW_SHUTDOWN_OR_REBOOT));
     }
 
     const SettingItem *SettingModel::GetSettinglistItems() const
index c14e239..df9d858 100755 (executable)
@@ -66,7 +66,7 @@ namespace OHOS
             }
             else 
             {
-                NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+                NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
             }
 
         }