From: 罗正 <1732036298@qq.com> Date: Sat, 28 Sep 2024 23:36:24 +0000 (+0000) Subject: Merge #1047 into sdk602patch0626 from refs/changes/1047/head X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=bff546a9c37963e80685ad073e941989afa70ae1;p=mirrors%2FFD230.git Merge #1047 into sdk602patch0626 from refs/changes/1047/head Code review from 罗正 * refs/changes/1047/head: (9 commits squashed) - 解决天气内存泄漏 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 修复AI语音聆听中界面计时标签显示问题 - 主界面view析构函数修改 - 解决切换到手机音乐还可以播放本地音乐bug - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 解决#671,蓝牙设备名称只显示一个时需要固定不能,去掉下面横线bug - 解决#674,蓝牙搜索界面,优化重新搜索字样显示位置bug - 解决,#672,蓝牙耳机界面退出,稍微右滑就退出了bug Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1047 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp index 724d37dd5..6230e2872 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:14:50 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-26 22:12:14 + * @LastEditTime: 2024-09-28 10:30:19 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp */ #include "aivoice/include/AiVoiceModel.h" @@ -861,16 +861,14 @@ namespace OHOS static void AIListeningCallbackProc(int data) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AIListeningCallbackProc %d", LISTENING_TIMEOUT); + LISTENING_TIMEOUT--; if (LISTENING_TIMEOUT <= 0) { AiVoiceModel::GetInstance().StopListenAndRecordingUserQuestion(); //停止聆听用户问题 AiVoiceModel::GetInstance().stop_listening_timer(); //停止聆听定时器 if (AiVoiceView::GetInstance() && AivoiceListeningView::GetInstance() ) { - AivoiceListeningView::GetInstance()->GetShowtimeoutLabel()->SetText(""); - AivoiceListeningView::GetInstance()->GetShowtimeoutLabel()->Invalidate(); AiVoiceView::GetInstance()->ChangeView(AIVOICE_LISTENING_VIEWID, AIVOICE_THINKING_VIEWID); // 切换到思考中界面 - AiVoiceModel::GetInstance().AIVoice_StartTimer(); } } @@ -882,7 +880,6 @@ namespace OHOS AivoiceListeningView::GetInstance()->GetShowtimeoutLabel()->Invalidate(); } } - LISTENING_TIMEOUT--; } static void AIListeningCallback(int data) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp index c88853d3c..575376721 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-05-07 11:25:58 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-26 15:37:15 + * @LastEditTime: 2024-09-28 14:18:24 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp */ #include "aivoice/include/AiVoicePresenter.h" @@ -588,6 +588,11 @@ namespace OHOS AiVoiceScrollView[thisView] = p_AivoiceListeningView->CreateAivoiceListeningView(); container_->Add(AiVoiceScrollView[thisView]); } + if(p_AivoiceListeningView) + { + p_AivoiceListeningView->GetShowtimeoutLabel()->SetText("15"); + p_AivoiceListeningView->GetShowtimeoutLabel()->Invalidate(); + } AiVoiceModel::GetInstance().start_listening_timer(); return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothPresenter.h index e6c7e1037..50303a5dd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothPresenter.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-08-05 15:20:01 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-04 15:43:50 + * @LastEditTime: 2024-09-28 18:06:32 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothPresenter.h */ @@ -44,6 +44,7 @@ public: ~BluetoothPresenter(); bool OnClick(UIView &view, const ClickEvent &event) override; static BluetoothPresenter *GetInstance(); + bool OnDrag(UIView& view, const DragEvent& event) override; bool OnDragEnd(UIView& view, const DragEvent& event) override; bool OnKeyAct(UIView &view, const KeyEvent &event) override; void OnStart() override; @@ -60,6 +61,7 @@ public: void ClickConnfailBackButton(void); private: BluetoothModel *bluetoothMode_{nullptr}; + bool X_DRAG_FLAG{false}; }; } // namespace OHOS #endif diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp index 43b524601..313221db6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp @@ -148,7 +148,7 @@ UIView *BluetoothCaseListAdapter::GetView(UIView *inView, int16_t index) return nullptr; } if ((static_cast(index) > bluetoothCaseList.size() - 1) || (index < 0)) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BluetoothCaseListAdapter::GetView %d %d", index, bluetoothCaseList.size()); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothCaseListAdapter::GetView %d %d", index, bluetoothCaseList.size()); return nullptr; } std::list::iterator node = bluetoothCaseList.begin(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceListView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceListView.cpp index 17a2a381b..263363c7b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceListView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceListView.cpp @@ -245,7 +245,7 @@ namespace OHOS list->Resize(380, 200); break; default: - list->Resize(380, 300); + list->Resize(380, 250); break; } newEquipmentButton->SetY(list->GetY() + list->GetHeight() + 20); diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothEarListView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothEarListView.cpp index 9122a94ed..ef37e1b3a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothEarListView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothEarListView.cpp @@ -94,7 +94,7 @@ namespace OHOS // list->SetIntercept(true); list->SetDragACCLevel(5); list->SetSwipeACCLevel(800); - list->SetReboundSize(30); + // list->SetReboundSize(30); // list->SetScrollBlankSize(30); list->SetAdapter(adapterText); group->Add(list); @@ -183,7 +183,7 @@ namespace OHOS return; } } - rescanButton->SetPosition(173, list->GetY() + list->GetHeight() + 20, 120, 40); + rescanButton->SetPosition(173, 390, 120, 40); rescanButton->SetTextId(STR_BT_HEADSET_RESCAN); // 重新搜索 rescanButton->SetViewId(BLUETOOTH_RESCAN_BUTTON); rescanButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); @@ -277,7 +277,7 @@ namespace OHOS // 刷新扫描出来的设备列表 void BluetoothEarListView::RefreshBluetoothEarListView(void) { - if (list && rescanButton) + if (list) { switch (BluetoothModel::GetInstance()->GetCase().size())//根据扫描出的设备数量,设置扫描列表的高度,使其高度自适应 { @@ -291,13 +291,11 @@ namespace OHOS list->Resize(380, 200); break; default: - list->Resize(380, 300); + list->Resize(380, 250); break; } - rescanButton->SetY(list->GetY() + list->GetHeight() + 20); list->RefreshList(); list->Invalidate(); - rescanButton->Invalidate(); } } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothItemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothItemView.cpp index 69adb8a56..fc5b95f96 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothItemView.cpp @@ -101,8 +101,9 @@ namespace OHOS } } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "index = %d", GetViewIndex()); - List &bluetoothCaseList = BluetoothModel::GetInstance()->GetConnedDevicesCase(); - if (GetViewIndex() == bluetoothCaseList.Size() - 1) + List &btConnedDevicesList_ = BluetoothModel::GetInstance()->GetConnedDevicesCase(); + std::list &btScansDevicesList_ = BluetoothModel::GetInstance()->GetCase(); + if (GetViewIndex() == btConnedDevicesList_.Size() - 1 || GetViewIndex() == btScansDevicesList_.size() - 1) { lineImage.SetVisible(false); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp index 9d6b02e17..aa5f2ff2a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp @@ -190,10 +190,25 @@ void BluetoothPresenter::ClickConnfailBackButton(void) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ClickConnfailBackButton ConnectRemoteDevice retVal = %d", retVal); } -bool BluetoothPresenter::OnDragEnd(UIView& view, const DragEvent& event) +bool BluetoothPresenter::OnDrag(UIView& view, const DragEvent& event) { if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { + int16_t deltaX; + int16_t deltaY; + deltaX = event.GetDeltaX(); + deltaY = event.GetDeltaY(); + if (MATH_ABS(deltaX) >= MATH_ABS(deltaY) && MATH_ABS(deltaX) > 30) { + X_DRAG_FLAG = true; + } + } + return true; +} + +bool BluetoothPresenter::OnDragEnd(UIView& view, const DragEvent& event) +{ + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && X_DRAG_FLAG) { view_->DropView(view); + X_DRAG_FLAG = false; } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp index a198fb31b..469ae4fc0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp @@ -64,9 +64,6 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample::~MainViewSample"); mainSwipeGroup->RemoveAll(); - dropDownView->ClearBackgroundBlur(); - messageView->ClearBackgroundBlur(); - for (int32_t i = 0; i < MAX_CARD; i++) { recordCard[i] = nullptr; @@ -94,7 +91,7 @@ namespace OHOS } if (dropDownView != nullptr) { - dropDownView->RemoveAll(); + dropDownView->ClearBackgroundBlur(); delete dropDownView; dropDownView = nullptr; } @@ -107,6 +104,7 @@ namespace OHOS } if (messageView != nullptr) { + messageView->ClearBackgroundBlur(); messageView->RemoveAll(); delete messageView; messageView = nullptr; @@ -416,7 +414,6 @@ namespace OHOS View::OnStop(); container_ = nullptr; - messageView->RemoveAll(); RootView::GetInstance()->ClearOnKeyActListener(); RootView::GetInstance()->RemoveAll(); return; diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersModel.h b/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersModel.h index 8ce15f274..c02c6ea8c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersModel.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-08-05 15:20:03 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-26 14:21:11 + * @LastEditTime: 2024-09-28 14:58:16 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersModel.h */ @@ -110,6 +110,7 @@ public: void set_phone_music_play_state(avrcp_key_operation_t notify); void get_avrcp_ct_get_element_attributes(void); void set_player_state(bool value); + bool get_player_state(); // /* -------------------------------------------------------------------------- */ std::unordered_map> &getIdToMusicNameMap(void); std::string getRealMusicNameById(int id); @@ -120,6 +121,7 @@ public: void showIdToMusicNameMapData(void); // /* -------------------------------------------------------------------------- */ private: + bool phonePlayButtonState{false}; bool musicSourceFlag{false};//音乐来源标志:false:默认为手表音乐,true:手机音乐 int64_t playerCurrentTime_{0}; int64_t playerMusicDuration_{0}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp index 95fa0d413..aefa17d3e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp @@ -1032,11 +1032,16 @@ bool PlayersModel::GetCurrentMusicIsPlaying(void) { PlayersPresenter *playersPresenter = PlayersPresenter::GetInstance(); if (playersPresenter != nullptr) - { + { + phonePlayButtonState = value; playersPresenter->SetPhonePlayerState(value); } } + bool PlayersModel::get_player_state() + { + return phonePlayButtonState; + } std::unordered_map> &PlayersModel::getIdToMusicNameMap(void) { return idToMusicNameMap; diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp index 67badc2e2..3c7f2bbf0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp @@ -606,14 +606,6 @@ void ButtonOnClickListener::PlayerButtonOnClick() return; } - if(PlayersListGroup::GetInstance()->GetCase().IsEmpty() && !PlayersModel::GetInstance()->GetMusicSource()) //若当前歌曲列表为空且为本地音乐他跳转到音乐列表进行提示 - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "current playersCaseList_ is empty!!"); - playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED); - playersView->ChangeView(PlayersView::MAIN_MUSICPLAYER_VIEW,PlayersView::MUSIC_LIST_VIEW); - return; - } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "play_or_pause_Button OnClick"); uint8_t state = UICheckBox::UICheckBoxState::MAX_STATUS_NUM; int32_t playerState; @@ -641,29 +633,47 @@ void ButtonOnClickListener::PlayerButtonOnClick() WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[PlayerButtonOnClick] calling phone"); return; } - /* -------------------------- 若ct或tg端是已连接状态且当前为手机音乐 ------------------------- */ - if(PlayersModel::GetInstance()->get_avrcp_ct_or_tg_is_connected() && PlayersModel::GetInstance()->GetMusicSource()) + + if( !PlayersModel::GetInstance()->GetMusicSource()) { - if (state == UICheckBox::UICheckBoxState::SELECTED) + if(PlayersListGroup::GetInstance()->GetCase().IsEmpty()) //若当前歌曲列表为空且为本地音乐他跳转到音乐列表进行提示 { - PlayersModel::GetInstance()->set_phone_music_play_state(AVRCP_KEY_PLAY); //控制手机音乐播放 - } - else if (state == UICheckBox::UICheckBoxState::UNSELECTED) + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "current playersCaseList_ is empty!!"); + playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED); + playersView->ChangeView(PlayersView::MAIN_MUSICPLAYER_VIEW,PlayersView::MUSIC_LIST_VIEW); + return; + } + else { - PlayersModel::GetInstance()->set_phone_music_play_state(AVRCP_KEY_PAUSE);//控制手机音乐暂停 + if (state == UICheckBox::UICheckBoxState::SELECTED) { + /* start play */ + PlayersModel::GetInstance()->ConnectBtAndLocalPlay(connCtState, connTgState, playerState); + } else if (state == UICheckBox::UICheckBoxState::UNSELECTED) { + PlayersModel::GetInstance()->ConnectBtAndLocalPause(connCtState, connTgState); + } + PlayersModel::GetInstance()->SetCurrentIndex(PlayersModel::GetInstance()->GetCurrentIndex()); } - return; } - /* -------------------------------------------------------------------------- */ - - if (state == UICheckBox::UICheckBoxState::SELECTED) { - /* start play */ - PlayersModel::GetInstance()->ConnectBtAndLocalPlay(connCtState, connTgState, playerState); - } else if (state == UICheckBox::UICheckBoxState::UNSELECTED) { - PlayersModel::GetInstance()->ConnectBtAndLocalPause(connCtState, connTgState); + else //手机音乐 + { + /* -------------------------- 若ct或tg端是已连接状态且当前为手机音乐 ------------------------- */ + if(PlayersModel::GetInstance()->get_avrcp_ct_or_tg_is_connected()) + { + if (state == UICheckBox::UICheckBoxState::SELECTED) + { + PlayersModel::GetInstance()->set_phone_music_play_state(AVRCP_KEY_PLAY); //控制手机音乐播放 + } + else if (state == UICheckBox::UICheckBoxState::UNSELECTED) + { + PlayersModel::GetInstance()->set_phone_music_play_state(AVRCP_KEY_PAUSE);//控制手机音乐暂停 + } + return; + } + else + { + playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED); + } } - /* -------------------------------------------------------------------------- */ - PlayersModel::GetInstance()->SetCurrentIndex(PlayersModel::GetInstance()->GetCurrentIndex()); } /*下一首按钮被点击时调用*/ void ButtonOnClickListener::NextButtonOnClick() @@ -1595,7 +1605,6 @@ void PlayersPresenter::SetPhonePlayerState(bool value) { PlayersView *playersView = PlayersView::GetInstance(); if (playersView != nullptr) { - PlayersModel::GetInstance()->SetPlayButtonState(value); playersView->SetPlayerButtonState(value ? UICheckBox::UICheckBoxState::SELECTED:UICheckBox::UICheckBoxState::UNSELECTED); } return; diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp index 21dfa9d03..322095cf3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp @@ -872,6 +872,8 @@ namespace OHOS /* -------------------------------------------------------------------------- */ if (musicSourceType) // 如果切換到手机音乐,且当前在放歌,就停止音乐 { + bool value = PlayersModel::GetInstance()->get_player_state(); + SetPlayerButtonState(value ? UICheckBox::UICheckBoxState::SELECTED:UICheckBox::UICheckBoxState::UNSELECTED); /*停止音乐*/ StopCurPlayingMusic(); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp index 6553338f1..2fcefe7c4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-19 09:52:56 + * @LastEditTime: 2024-09-27 20:49:01 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp */ #include "weather/include/GetWeatherDataErrorView.h" @@ -83,22 +83,19 @@ namespace OHOS void GetWeatherDataErrorView::ClearAll() { - scrollView->RemoveAll(); - - if (label != nullptr) - { - delete label; - label = nullptr; - } - - if (image != nullptr) - { - delete image; - image = nullptr; - } - if (scrollView != nullptr) { + scrollView->RemoveAll(); + if (label != nullptr) + { + delete label; + label = nullptr; + } + if (image != nullptr) + { + delete image; + image = nullptr; + } delete scrollView; scrollView = nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp index a95e8bba9..71c11c532 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp @@ -106,7 +106,7 @@ namespace OHOS // FreeImagePathsArray(HumidityPathsArray, HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); FreeImageInfoArray(UVPathsArray, UVPaths, UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); - FreeImageInfoArray(UVPathsArray, WindSpeedPaths, WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); + FreeImageInfoArray(WindSpeedPathsArray, WindSpeedPaths, WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); FreeImageInfoArray(HumidityPathsArray, HumidityPaths, HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); } }