同步viewid修改部分
authorCaisking <Casiking@zhihuishixun.com>
Tue, 25 Mar 2025 06:50:08 +0000 (14:50 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Tue, 25 Mar 2025 06:50:08 +0000 (14:50 +0800)
16 files changed:
code/sdk/application/wearable/fd230/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/include/ApplistView.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/heartrate/src/HeartModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/key/src/KeyInputListener.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainViewSample.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/player/src/BluetoothView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/src/SetDialModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/set_dial/src/SetDialPresenter.cpp

index b72e0dc..7b69aa5 100644 (file)
@@ -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;
     }
index 4edb214..fe9fec7 100644 (file)
@@ -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;
 }
index aedb638..36cb49b 100644 (file)
@@ -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;
index 6dc8def..2dcb644 100644 (file)
@@ -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;
         }
index 852053b..d7bdba3 100644 (file)
@@ -326,7 +326,7 @@ void HeartModel::RefreshHeartRateScreen(uint16_t perSec, uint16_t rest, uint16_t
     rateData = GetAveHeartRate();\r
 \r
     uint16_t currentViewId = NativeAbility::GetInstance().GetCurSliceId();\r
-    if (currentViewId == VIEW_MAIN_SAMPLE && MainClockView::GetInstance() != nullptr) {\r
+    if (currentViewId == VIEW_MAIN && MainClockView::GetInstance() != nullptr) {\r
         MainClockView::GetInstance()->RefreshHeartRate(perSec);\r
     }\r
 \r
index 7991cb3..94f098f 100644 (file)
@@ -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()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面
index ac3c411..5218095 100644 (file)
@@ -19,7 +19,7 @@ namespace OHOS {
     const CardInfo cardInfoMap[] = {\r
         { HEART_RATE, PNG_SET_CARD_HEART },\r
         { COMPASS, PNG_SET_CARD_COMPASS },\r
-        { ACTIVITY, PNG_SET_CARD_ACTIVITY },\r
+        // { ACTIVITY, PNG_SET_CARD_ACTIVITY },\r
         { MUSIC_PLAYER, PNG_SET_CARD_PLAYER },\r
     };\r
 \r
@@ -91,7 +91,7 @@ namespace OHOS {
             cardSettings[index++] = WATCH_FACE;\r
             cardSettings[index++] = HEART_RATE;\r
             cardSettings[index++] = COMPASS;\r
-            cardSettings[index++] = ACTIVITY;\r
+            // cardSettings[index++] = ACTIVITY;\r
             cardSettings[index++] = MUSIC_PLAYER;\r
             cardSettingCount = index;\r
         }\r
index c0d7def..fd98c26 100644 (file)
 
 namespace OHOS {
 
-REGIST_SLICE(VIEW_MAIN_SAMPLE, MainViewSample, MainPresenterSample);
+REGIST_SLICE(VIEW_MAIN, MainViewSample, MainPresenterSample);
 
-std::map<std::string, AppViewId> g_jumpView = { { MAIN_CLICK_WEATHER, VIEW_MAIN_SAMPLE },            // 天气界面
+std::map<std::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_ALARM, VIEW_MAIN_ALARM },           // 闹钟app
                                                 { DROPDOWN_CLICK_SETTING, VIEW_SETTING } };          // 设置界面
 
index 3784f1c..fa88864 100644 (file)
@@ -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},
 };
 
index 70f80a8..6bbfe2f 100644 (file)
@@ -628,7 +628,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 dfae528..b7bdbab 100644 (file)
@@ -296,7 +296,7 @@ int BluetoothView::LoadImage(void)
         return BLUETOOTH_ERROR;\r
     }\r
     watchImage->SetPosition(IMAGE_X, IMAGE_Y, WIDTH2, HEIGHT2);\r
-    watchImage->SetSrc(PNG_WATCH_IMAGE);\r
+    // watchImage->SetSrc(PNG_WATCH_IMAGE);\r
 \r
     phoneImage = new UIImageView();\r
     if (phoneImage == nullptr) {\r
@@ -304,7 +304,7 @@ int BluetoothView::LoadImage(void)
         return BLUETOOTH_ERROR;\r
     }\r
     phoneImage->SetPosition(IMAGE_X, IMAGE_Y2, WIDTH2, HEIGHT2);\r
-    phoneImage->SetSrc(PNG_PHONE_IMAGE);\r
+    // phoneImage->SetSrc(PNG_PHONE_IMAGE);\r
 \r
     bluetoothImage = new UIImageView();\r
     if (bluetoothImage == nullptr) {\r
@@ -312,7 +312,7 @@ int BluetoothView::LoadImage(void)
         return BLUETOOTH_ERROR;\r
     }\r
     bluetoothImage->SetPosition(IMAGE_X, IMAGE_Y3, WIDTH2, HEIGHT2);\r
-    bluetoothImage->SetSrc(PNG_BLUETOOTH_IMAGE);\r
+    // bluetoothImage->SetSrc(PNG_BLUETOOTH_IMAGE);\r
     return BLUETOOTH_OK;\r
 }\r
 \r
index c248e7e..7de3989 100644 (file)
@@ -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);
index 89cef0a..fe79bf6 100644 (file)
@@ -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);
         }
     }
 };
index 1012057..11d88d8 100644 (file)
@@ -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()
index 563e1c7..9e2c060 100644 (file)
@@ -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");
index f769b0f..2f43932 100644 (file)
@@ -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)