From: Caisking Date: Tue, 25 Mar 2025 06:50:08 +0000 (+0800) Subject: 同步viewid修改部分 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~404^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9f35835f6900850f2518ef260da1338f72a64bed;p=mirrors%2FFD230.git 同步viewid修改部分 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp index b72e0dcfc..7b69aa5ea 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp @@ -32,7 +32,7 @@ REGIST_SLICE(VIEW_ADD_CARD, AddCardView, AddCardPresenter); 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, "AddCardPresenter::OnDrag ChangeSlice"); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } return false; } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp index 4edb2149a..fe9fec70d 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp @@ -813,7 +813,7 @@ uint16_t AlarmClockModel::JudgePreSlice(void) { uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); if (preSlice == VIEW_ALARM_POP_UP || preSlice < VIEW_SETTING) { - preSlice = VIEW_MAIN_SAMPLE; + preSlice = VIEW_MAIN; } else if ((preSlice == VIEW_MAEKPHONE_SAMPLE) && (GetCurrCallNum() == 0 || GetScoConnectState() != HFP_SCO_STATE_CONNECTED)) { int num; @@ -822,7 +822,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/fd230/nativeapp/nativeui/applist/include/ApplistView.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/include/ApplistView.h index aedb6381d..36cb49b88 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/include/ApplistView.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/include/ApplistView.h @@ -52,7 +52,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, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TransitionType::TRANSITION_ZOOM); } return false; diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp index 6dc8defd7..2dcb6441c 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp @@ -82,7 +82,7 @@ static void StatusReset() DisableCallingTimer(); // If the call is handling in the notification, the slice is not switched if (!CallerLogModel::GetInstance()->GetNotifyFlag()) { - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } else { g_isWatchCallView = false; } @@ -214,7 +214,7 @@ static void ExitMakePhoneSlice(void) 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); @@ -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()) { - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); // 退出通话界面,回到主表盘应用 + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); // 退出通话界面,回到主表盘应用 } else { g_isWatchCallView = false; } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartModel.cpp index 852053b9b..d7bdba3fc 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartModel.cpp +++ b/code/sdk/application/wearable/fd230/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/fd230/nativeapp/nativeui/key/src/KeyInputListener.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/key/src/KeyInputListener.cpp index 7991cb3f4..94f098fa9 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/key/src/KeyInputListener.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/key/src/KeyInputListener.cpp @@ -115,9 +115,9 @@ void KeyInputListener::OnKeyRelease(const KeyEvent& event) NotificationManager::GetInstance()->GetWatchCallStatus()) { // 音量卡片 // 音量+ CallVolumeDipSwitchControl(VOLUMEUP); - } else if (currentViewId != VIEW_MAIN_SAMPLE) { // 主表盘 + } else if (currentViewId != VIEW_MAIN) { // 主表盘 PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面 - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TransitionType::TRANSITION_ZOOM); } else { PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面 if (!MainViewSample::GetInstance()->IsMainClockPage()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面 diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp index ac3c411ed..521809562 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp @@ -19,7 +19,7 @@ namespace OHOS { const CardInfo cardInfoMap[] = { { HEART_RATE, PNG_SET_CARD_HEART }, { COMPASS, PNG_SET_CARD_COMPASS }, - { ACTIVITY, PNG_SET_CARD_ACTIVITY }, + // { ACTIVITY, PNG_SET_CARD_ACTIVITY }, { MUSIC_PLAYER, PNG_SET_CARD_PLAYER }, }; @@ -91,7 +91,7 @@ namespace OHOS { cardSettings[index++] = WATCH_FACE; cardSettings[index++] = HEART_RATE; cardSettings[index++] = COMPASS; - cardSettings[index++] = ACTIVITY; + // cardSettings[index++] = ACTIVITY; cardSettings[index++] = MUSIC_PLAYER; cardSettingCount = index; } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp index c0d7def8e..fd98c264a 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp @@ -29,12 +29,12 @@ namespace OHOS { -REGIST_SLICE(VIEW_MAIN_SAMPLE, MainViewSample, MainPresenterSample); +REGIST_SLICE(VIEW_MAIN, MainViewSample, MainPresenterSample); -std::map g_jumpView = { { MAIN_CLICK_WEATHER, VIEW_MAIN_SAMPLE }, // 天气界面 +std::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_ALARM, VIEW_MAIN_ALARM }, // 闹钟app { DROPDOWN_CLICK_SETTING, VIEW_SETTING } }; // 设置界面 diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainViewSample.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainViewSample.cpp index 3784f1c90..fa88864aa 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainViewSample.cpp @@ -26,7 +26,7 @@ static const MainViewMapper CardMapper[] = { {WATCH_FACE, &MainViewSample::InitWatchFacePage}, {HEART_RATE, &MainViewSample::InitHeartRatePage}, {COMPASS, &MainViewSample::InitCompassPage}, - {ACTIVITY, &MainViewSample::InitActivityPage}, + // {ACTIVITY, &MainViewSample::InitActivityPage}, {MUSIC_PLAYER, &MainViewSample::InitMusicPlayerPage}, }; diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp index 70f80a813..6bbfe2f54 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp @@ -628,7 +628,7 @@ void VoiceAssistance::ExitProgress() 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/fd230/nativeapp/nativeui/player/src/BluetoothView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/src/BluetoothView.cpp index dfae52888..b7bdbab1b 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/src/BluetoothView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/player/src/BluetoothView.cpp @@ -296,7 +296,7 @@ int BluetoothView::LoadImage(void) return BLUETOOTH_ERROR; } watchImage->SetPosition(IMAGE_X, IMAGE_Y, WIDTH2, HEIGHT2); - watchImage->SetSrc(PNG_WATCH_IMAGE); + // watchImage->SetSrc(PNG_WATCH_IMAGE); phoneImage = new UIImageView(); if (phoneImage == nullptr) { @@ -304,7 +304,7 @@ int BluetoothView::LoadImage(void) return BLUETOOTH_ERROR; } phoneImage->SetPosition(IMAGE_X, IMAGE_Y2, WIDTH2, HEIGHT2); - phoneImage->SetSrc(PNG_PHONE_IMAGE); + // phoneImage->SetSrc(PNG_PHONE_IMAGE); bluetoothImage = new UIImageView(); if (bluetoothImage == nullptr) { @@ -312,7 +312,7 @@ int BluetoothView::LoadImage(void) return BLUETOOTH_ERROR; } bluetoothImage->SetPosition(IMAGE_X, IMAGE_Y3, WIDTH2, HEIGHT2); - bluetoothImage->SetSrc(PNG_BLUETOOTH_IMAGE); + // bluetoothImage->SetSrc(PNG_BLUETOOTH_IMAGE); return BLUETOOTH_OK; } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp index c248e7ea7..7de3989c3 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp @@ -61,7 +61,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/fd230/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp index 89cef0ac3..fe79bf6ec 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp @@ -47,8 +47,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()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面 @@ -74,7 +74,7 @@ static void GuiEnterAod(bool entry) if (newState == DisplayState::AOD) { NativeAbility::GetInstance().ChangeSlice(VIEW_AOD); } else { - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } } }; diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp index 1012057c9..11d88d816 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp @@ -119,7 +119,7 @@ REGIST_SLICE(VIEW_SET_CARD, SetCardView, SetCardPresenter); MainModel::GetInstance().SetFromCardId(info->id); } } - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); } void SetCardPresenter::OnTickEvent() diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/src/SetDialModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/src/SetDialModel.cpp index 563e1c790..9e2c060e7 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/src/SetDialModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/src/SetDialModel.cpp @@ -73,7 +73,7 @@ namespace OHOS { struct dirent *direntp; // 打开目录 - DIR *dirp = opendir(APP_DIAL_PATH); + DIR *dirp = opendir(APP_DEFAULT_DIAL_PATH); // 遍历文件 if (dirp != nullptr) { while ((direntp = readdir(dirp)) != nullptr) { @@ -98,7 +98,7 @@ namespace OHOS { int32_t SetDialModel::ParseDialHeader(const std::string &dialFileName, SetDialInfo &dialInfo) { - std::string dialFullName = APP_DIAL_PATH; + std::string dialFullName = APP_DEFAULT_DIAL_PATH; dialFullName += "/"; dialFullName += dialFileName; FILE *fp = fopen(dialFullName.c_str(), "rb"); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/src/SetDialPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/src/SetDialPresenter.cpp index f769b0f9d..2f4393226 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/src/SetDialPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/src/SetDialPresenter.cpp @@ -32,7 +32,7 @@ REGIST_SLICE(VIEW_SET_DIAL, SetDialView, SetDialPresenter); { 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)