From: 罗正yun <1732036298@qq.com> Date: Sat, 20 Jan 2024 07:56:10 +0000 (+0800) Subject: 1.AppViewIDs.h中 将每一个id重新命名使其见名知意 X-Git-Tag: release_V1.2.70_20241020_135402~1351^2~2^2~2 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=556283474111e825678767b75ac4a42e37e188fc;p=mirrors%2FFD230.git 1.AppViewIDs.h中 将每一个id重新命名使其见名知意 --- diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h index 4b742739c..9beb592ca 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h @@ -24,35 +24,34 @@ */ 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; diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp index d9e9e2048..d90ee3c96 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp @@ -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) diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp index 14a8cd058..b2d09180c 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp @@ -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; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h index 08c4bb2ff..e77a9ef4a 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h @@ -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; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp index a9d386af3..8708e299b 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp @@ -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 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp index 1fa5d17eb..5e008369b 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp @@ -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); } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/dial/src/DialPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/dial/src/DialPresenter.cpp index 5ffd7f6d6..ebf098d88 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/dial/src/DialPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/dial/src/DialPresenter.cpp @@ -57,7 +57,7 @@ namespace OHOS if (event.GetDragDirection() == DragEvent::DIRECTION_BOTTOM_TO_TOP) { // printf("draglistene is ok!\n"); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } UNUSED(view); return true; @@ -99,35 +99,35 @@ namespace OHOS // printf("join click\n"); const std::string jsonPath = "/user/res/clocks/KUMI.json"; g_pDigital_clockView->setJsonFilePath(jsonPath); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } if (strcmp(view.GetViewId(), "flowerbudbutton") == 0) { // printf("join click\n"); const std::string jsonPath = "/user/res/clocks/flowerbud.json"; g_pDigital_clockView->setJsonFilePath(jsonPath); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } if (strcmp(view.GetViewId(), "maomaobutton") == 0) { // printf("join click\n"); const std::string jsonPath = "/user/res/clocks/maomao.json"; g_pDigital_clockView->setJsonFilePath(jsonPath); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } if (strcmp(view.GetViewId(), "momobutton") == 0) { // printf("join click\n"); const std::string jsonPath = "/user/res/clocks/momo.json"; g_pDigital_clockView->setJsonFilePath(jsonPath); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } if (strcmp(view.GetViewId(), "maliaobutton") == 0) { // printf("join click\n"); const std::string jsonPath = "/user/res/clocks/maliao.json"; g_pDigital_clockView->setJsonFilePath(jsonPath); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } #endif return true; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp index cee72e813..f8bf00661 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp @@ -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); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp b/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp index 976e9bd7d..23c3f8360 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp @@ -56,7 +56,7 @@ void KeyInputListener::OnKeyLongPress(const KeyEvent& event) WEARABLE_LOGD("","into key! keyID %u\n",keyID); if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER)) { // 电源按键 // 切换到关机/重启卡片 - NativeAbility::GetInstance().ChangeSlice(VIEW_REBOOT); + NativeAbility::GetInstance().ChangeSlice(VIEW_SHUTDOWN_OR_REBOOT); } else if (keyID == static_cast(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(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); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp index 6497b1fe6..9a390acdc 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp @@ -24,10 +24,10 @@ namespace OHOS { -map g_jumpView = { { MAIN_CLICK_WEATHER, VIEW_MAIN_SAMPLE }, // 天气界面 +map 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}, // 蓝牙 }; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp index 2777b08d4..6c85f8019 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp @@ -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; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp index 83d7edc9a..d7f9b0458 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp @@ -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); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp index 2122a80af..893cbd985 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp @@ -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"); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp index 9f3c9c07e..8675b25fd 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp @@ -872,7 +872,7 @@ void PlayerInterruptListener::ResumePlayer(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] start"); usleep(50000); // 确保界面切换完成 - if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE || + if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL || (GetCurrCallState() != HFP_HF_CALL_STATE_FINISHED && GetScoConnectState() == HFP_SCO_STATE_CONNECTED)) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] this is in calling"); return; // 通话界面,禁止音乐恢复播放 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp index 47de858c3..489cb3b51 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp @@ -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); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp index db3d965bc..4f2137449 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp @@ -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(SETTING_ITEM_ZERO, VIEW_REBOOT)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_ZERO, VIEW_SHUTDOWN_OR_REBOOT)); settingIdToViewId.insert(std::pair(SETTING_ITEM_ONE, VIEW_BLUETOOTH_EARPHONE)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_TWO, VIEW_REBOOT)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_THREE, VIEW_REBOOT)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_FOUR, VIEW_REBOOT)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_TWO, VIEW_SHUTDOWN_OR_REBOOT)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_THREE, VIEW_SHUTDOWN_OR_REBOOT)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_FOUR, VIEW_SHUTDOWN_OR_REBOOT)); } const SettingItem *SettingModel::GetSettinglistItems() const diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp index c14e23918..df9d858f2 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp @@ -66,7 +66,7 @@ namespace OHOS } else { - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } }